diff options
author | Chris Wren <cwren@android.com> | 2015-05-11 15:07:17 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-11 15:07:18 +0000 |
commit | 46c8f759fdad71380504ad61a49031331ea39004 (patch) | |
tree | 3b7b2d553ed1d97b34d5b93fc35466595bbac1d2 /src/com/android/settings/notification | |
parent | 69a03f75171c9f21ee4517f8e6d02cfa955c6a84 (diff) | |
parent | 1b6ffba9e69dc1926e3c4cbcb52d1844c6ccaa32 (diff) | |
download | packages_apps_Settings-46c8f759fdad71380504ad61a49031331ea39004.zip packages_apps_Settings-46c8f759fdad71380504ad61a49031331ea39004.tar.gz packages_apps_Settings-46c8f759fdad71380504ad61a49031331ea39004.tar.bz2 |
Merge "log more settings actions" into mnc-dev
Diffstat (limited to 'src/com/android/settings/notification')
3 files changed, 11 insertions, 0 deletions
diff --git a/src/com/android/settings/notification/ZenModeAutomationSettings.java b/src/com/android/settings/notification/ZenModeAutomationSettings.java index 09af07a..2063e96 100644 --- a/src/com/android/settings/notification/ZenModeAutomationSettings.java +++ b/src/com/android/settings/notification/ZenModeAutomationSettings.java @@ -96,6 +96,7 @@ public class ZenModeAutomationSettings extends ZenModeSettingsBase { new ZenRuleNameDialog(mContext, mServiceListing, null, mConfig.getAutomaticRuleNames()) { @Override public void onOk(String ruleName, RuleInfo ri) { + MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ADD_RULE_OK); final ZenRule rule = new ZenRule(); rule.name = ruleName; rule.enabled = true; @@ -168,6 +169,7 @@ public class ZenModeAutomationSettings extends ZenModeSettingsBase { p.setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { + MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ADD_RULE); showAddRuleDialog(); return true; } diff --git a/src/com/android/settings/notification/ZenModePrioritySettings.java b/src/com/android/settings/notification/ZenModePrioritySettings.java index 4907cf0..6e34bf7 100644 --- a/src/com/android/settings/notification/ZenModePrioritySettings.java +++ b/src/com/android/settings/notification/ZenModePrioritySettings.java @@ -57,6 +57,7 @@ public class ZenModePrioritySettings extends ZenModeSettingsBase implements Inde public boolean onPreferenceChange(Preference preference, Object newValue) { if (mDisableListeners) return true; final boolean val = (Boolean) newValue; + MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ALLOW_REMINDERS, val); if (val == mConfig.allowReminders) return true; if (DEBUG) Log.d(TAG, "onPrefChange allowReminders=" + val); final ZenModeConfig newConfig = mConfig.copy(); @@ -71,6 +72,7 @@ public class ZenModePrioritySettings extends ZenModeSettingsBase implements Inde public boolean onPreferenceChange(Preference preference, Object newValue) { if (mDisableListeners) return true; final boolean val = (Boolean) newValue; + MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ALLOW_EVENTS, val); if (val == mConfig.allowEvents) return true; if (DEBUG) Log.d(TAG, "onPrefChange allowEvents=" + val); final ZenModeConfig newConfig = mConfig.copy(); @@ -86,6 +88,7 @@ public class ZenModePrioritySettings extends ZenModeSettingsBase implements Inde public boolean onItemSelected(int pos, Object newValue) { if (mDisableListeners) return true; final int val = (Integer) newValue; + MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ALLOW_MESSAGES, val); final boolean allowMessages = val != SOURCE_NONE; final int allowMessagesFrom = val == SOURCE_NONE ? mConfig.allowMessagesFrom : val; if (allowMessages == mConfig.allowMessages @@ -108,6 +111,7 @@ public class ZenModePrioritySettings extends ZenModeSettingsBase implements Inde public boolean onItemSelected(int pos, Object newValue) { if (mDisableListeners) return true; final int val = (Integer) newValue; + MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ALLOW_CALLS, val); final boolean allowCalls = val != SOURCE_NONE; final int allowCallsFrom = val == SOURCE_NONE ? mConfig.allowCallsFrom : val; if (allowCalls == mConfig.allowCalls @@ -132,6 +136,7 @@ public class ZenModePrioritySettings extends ZenModeSettingsBase implements Inde public boolean onPreferenceChange(Preference preference, Object newValue) { if (mDisableListeners) return true; final boolean val = (Boolean) newValue; + MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ALLOW_REPEAT_CALLS, val); if (val == mConfig.allowRepeatCallers) return true; if (DEBUG) Log.d(TAG, "onPrefChange allowRepeatCallers=" + val); final ZenModeConfig newConfig = mConfig.copy(); diff --git a/src/com/android/settings/notification/ZenModeRuleSettingsBase.java b/src/com/android/settings/notification/ZenModeRuleSettingsBase.java index cf66da8..9ba7e92 100644 --- a/src/com/android/settings/notification/ZenModeRuleSettingsBase.java +++ b/src/com/android/settings/notification/ZenModeRuleSettingsBase.java @@ -36,6 +36,7 @@ import android.view.MenuItem; import android.widget.Switch; import android.widget.Toast; +import com.android.internal.logging.MetricsLogger; import com.android.settings.DropDownPreference; import com.android.settings.R; import com.android.settings.SettingsActivity; @@ -152,6 +153,7 @@ public abstract class ZenModeRuleSettingsBase extends ZenModeSettingsBase if (mDisableListeners) return; final boolean enabled = isChecked; if (enabled == mRule.enabled) return; + MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ENABLE_RULE, enabled); if (DEBUG) Log.d(TAG, "onSwitchChanged enabled=" + enabled); mRule.enabled = enabled; mRule.snoozing = false; @@ -198,6 +200,7 @@ public abstract class ZenModeRuleSettingsBase extends ZenModeSettingsBase public boolean onOptionsItemSelected(MenuItem item) { if (DEBUG) Log.d(TAG, "onOptionsItemSelected " + item.getItemId()); if (item.getItemId() == R.id.delete) { + MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_DELETE_RULE); showDeleteRuleDialog(); return true; } @@ -234,6 +237,7 @@ public abstract class ZenModeRuleSettingsBase extends ZenModeSettingsBase .setPositiveButton(R.string.zen_mode_delete_rule_button, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { + MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_DELETE_RULE_OK); mDeleting = true; mConfig.automaticRules.remove(mRuleId); setZenModeConfig(mConfig); |