port settings over to new metrics enum
Change-Id: I0b3efd2f4db773ccbc52bfe59ee8eb0dab9584fb
This commit is contained in:
@@ -32,6 +32,7 @@ import android.util.ArrayMap;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.AppHeader;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.Utils;
|
||||
@@ -66,7 +67,7 @@ public class AppNotificationSettings extends NotificationSettingsBase {
|
||||
|
||||
@Override
|
||||
protected int getMetricsCategory() {
|
||||
return MetricsLogger.NOTIFICATION_APP_NOTIFICATION;
|
||||
return MetricsEvent.NOTIFICATION_APP_NOTIFICATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -150,7 +151,7 @@ public class AppNotificationSettings extends NotificationSettingsBase {
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
final boolean banned = (Boolean) newValue;
|
||||
if (banned) {
|
||||
MetricsLogger.action(getActivity(), MetricsLogger.ACTION_BAN_APP_NOTES, mPkg);
|
||||
MetricsLogger.action(getActivity(), MetricsEvent.ACTION_BAN_APP_NOTES, mPkg);
|
||||
}
|
||||
final boolean success = mBackend.setNotificationsBanned(mPkg, mUid, banned);
|
||||
if (success) {
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.content.pm.PackageManager;
|
||||
import android.provider.Settings;
|
||||
import android.service.notification.NotificationListenerService;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
|
||||
public class NotificationAccessSettings extends ManagedServiceSettings {
|
||||
@@ -43,7 +43,7 @@ public class NotificationAccessSettings extends ManagedServiceSettings {
|
||||
|
||||
@Override
|
||||
protected int getMetricsCategory() {
|
||||
return MetricsLogger.NOTIFICATION_ACCESS;
|
||||
return MetricsEvent.NOTIFICATION_ACCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -44,7 +44,7 @@ import android.widget.DateTimeView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.Utils;
|
||||
@@ -137,7 +137,7 @@ public class NotificationStation extends SettingsPreferenceFragment {
|
||||
|
||||
@Override
|
||||
protected int getMetricsCategory() {
|
||||
return MetricsLogger.NOTIFICATION_STATION;
|
||||
return MetricsEvent.NOTIFICATION_STATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,7 +31,7 @@ import android.provider.Settings.Global;
|
||||
import android.provider.Settings.System;
|
||||
import android.telephony.TelephonyManager;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.Utils;
|
||||
@@ -180,7 +180,7 @@ public class OtherSoundSettings extends SettingsPreferenceFragment implements In
|
||||
|
||||
@Override
|
||||
protected int getMetricsCategory() {
|
||||
return MetricsLogger.NOTIFICATION_OTHER_SOUND;
|
||||
return MetricsEvent.NOTIFICATION_OTHER_SOUND;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,7 +26,7 @@ import android.view.ViewGroup;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.RestrictedRadioButton;
|
||||
import com.android.settings.SettingsActivity;
|
||||
@@ -76,7 +76,7 @@ public class RedactionInterstitial extends SettingsActivity {
|
||||
|
||||
@Override
|
||||
protected int getMetricsCategory() {
|
||||
return MetricsLogger.NOTIFICATION_REDACTION;
|
||||
return MetricsEvent.NOTIFICATION_REDACTION;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package com.android.settings.notification;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.internal.widget.LockPatternUtils;
|
||||
import com.android.settings.AppHeader;
|
||||
import com.android.settings.R;
|
||||
@@ -60,7 +60,7 @@ public class TopicNotificationSettings extends NotificationSettingsBase {
|
||||
|
||||
@Override
|
||||
protected int getMetricsCategory() {
|
||||
return MetricsLogger.NOTIFICATION_TOPIC_NOTIFICATION;
|
||||
return MetricsEvent.NOTIFICATION_TOPIC_NOTIFICATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,7 +40,7 @@ import android.support.v7.preference.PreferenceScreen;
|
||||
import android.text.TextUtils;
|
||||
import android.util.ArraySet;
|
||||
import android.view.View;
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -57,7 +57,7 @@ public class ZenAccessSettings extends EmptyTextSettings {
|
||||
|
||||
@Override
|
||||
protected int getMetricsCategory() {
|
||||
return MetricsLogger.NOTIFICATION_ZEN_MODE_ACCESS;
|
||||
return MetricsEvent.NOTIFICATION_ZEN_MODE_ACCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,6 +40,7 @@ import android.support.v7.preference.PreferenceViewHolder;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.notification.ManagedServiceSettings.Config;
|
||||
|
||||
@@ -106,7 +107,7 @@ public class ZenModeAutomationSettings extends ZenModeSettingsBase {
|
||||
new ZenRuleNameDialog(mContext, null) {
|
||||
@Override
|
||||
public void onOk(String ruleName) {
|
||||
MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ADD_RULE_OK);
|
||||
MetricsLogger.action(mContext, MetricsEvent.ACTION_ZEN_ADD_RULE_OK);
|
||||
AutomaticZenRule rule = new AutomaticZenRule(ruleName, ri.serviceComponent,
|
||||
ri.defaultConditionId, NotificationManager.INTERRUPTION_FILTER_PRIORITY,
|
||||
true);
|
||||
@@ -126,7 +127,7 @@ public class ZenModeAutomationSettings extends ZenModeSettingsBase {
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_DELETE_RULE_OK);
|
||||
MetricsLogger.action(mContext, MetricsEvent.ACTION_ZEN_DELETE_RULE_OK);
|
||||
removeZenRule(ruleId);
|
||||
}
|
||||
})
|
||||
@@ -169,7 +170,7 @@ public class ZenModeAutomationSettings extends ZenModeSettingsBase {
|
||||
p.setOnPreferenceClickListener(new OnPreferenceClickListener() {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ADD_RULE);
|
||||
MetricsLogger.action(mContext, MetricsEvent.ACTION_ZEN_ADD_RULE);
|
||||
showAddRuleDialog();
|
||||
return true;
|
||||
}
|
||||
@@ -179,7 +180,7 @@ public class ZenModeAutomationSettings extends ZenModeSettingsBase {
|
||||
|
||||
@Override
|
||||
protected int getMetricsCategory() {
|
||||
return MetricsLogger.NOTIFICATION_ZEN_MODE_AUTOMATION;
|
||||
return MetricsEvent.NOTIFICATION_ZEN_MODE_AUTOMATION;
|
||||
}
|
||||
|
||||
private String computeRuleSummary(AutomaticZenRule rule, boolean isSystemRule,
|
||||
|
||||
@@ -31,7 +31,7 @@ import android.support.v7.preference.Preference;
|
||||
import android.support.v7.preference.Preference.OnPreferenceChangeListener;
|
||||
import android.support.v7.preference.PreferenceScreen;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -161,7 +161,7 @@ public class ZenModeEventRuleSettings extends ZenModeRuleSettingsBase {
|
||||
|
||||
@Override
|
||||
protected int getMetricsCategory() {
|
||||
return MetricsLogger.NOTIFICATION_ZEN_MODE_EVENT_RULE;
|
||||
return MetricsEvent.NOTIFICATION_ZEN_MODE_EVENT_RULE;
|
||||
}
|
||||
|
||||
public static CalendarInfo findCalendar(Context context, EventInfo event) {
|
||||
|
||||
@@ -28,6 +28,7 @@ import android.support.v7.preference.PreferenceScreen;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.search.Indexable;
|
||||
|
||||
@@ -63,7 +64,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);
|
||||
MetricsLogger.action(mContext, MetricsEvent.ACTION_ZEN_ALLOW_REMINDERS, val);
|
||||
if (DEBUG) Log.d(TAG, "onPrefChange allowReminders=" + val);
|
||||
savePolicy(getNewPriorityCategories(val, Policy.PRIORITY_CATEGORY_REMINDERS),
|
||||
mPolicy.priorityCallSenders, mPolicy.priorityMessageSenders,
|
||||
@@ -78,7 +79,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);
|
||||
MetricsLogger.action(mContext, MetricsEvent.ACTION_ZEN_ALLOW_EVENTS, val);
|
||||
if (DEBUG) Log.d(TAG, "onPrefChange allowEvents=" + val);
|
||||
savePolicy(getNewPriorityCategories(val, Policy.PRIORITY_CATEGORY_EVENTS),
|
||||
mPolicy.priorityCallSenders, mPolicy.priorityMessageSenders,
|
||||
@@ -97,7 +98,7 @@ public class ZenModePrioritySettings extends ZenModeSettingsBase implements Inde
|
||||
final boolean allowMessages = val != SOURCE_NONE;
|
||||
final int allowMessagesFrom =
|
||||
val == SOURCE_NONE ? mPolicy.priorityMessageSenders : val;
|
||||
MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ALLOW_MESSAGES, val);
|
||||
MetricsLogger.action(mContext, MetricsEvent.ACTION_ZEN_ALLOW_MESSAGES, val);
|
||||
if (DEBUG) Log.d(TAG, "onPrefChange allowMessages=" + allowMessages
|
||||
+ " allowMessagesFrom=" + ZenModeConfig.sourceToString(allowMessagesFrom));
|
||||
savePolicy(
|
||||
@@ -117,7 +118,7 @@ public class ZenModePrioritySettings extends ZenModeSettingsBase implements Inde
|
||||
final int val = Integer.parseInt((String) newValue);
|
||||
final boolean allowCalls = val != SOURCE_NONE;
|
||||
final int allowCallsFrom = val == SOURCE_NONE ? mPolicy.priorityCallSenders : val;
|
||||
MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ALLOW_CALLS, val);
|
||||
MetricsLogger.action(mContext, MetricsEvent.ACTION_ZEN_ALLOW_CALLS, val);
|
||||
if (DEBUG) Log.d(TAG, "onPrefChange allowCalls=" + allowCalls
|
||||
+ " allowCallsFrom=" + ZenModeConfig.sourceToString(allowCallsFrom));
|
||||
savePolicy(getNewPriorityCategories(allowCalls, Policy.PRIORITY_CATEGORY_CALLS),
|
||||
@@ -136,7 +137,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);
|
||||
MetricsLogger.action(mContext, MetricsEvent.ACTION_ZEN_ALLOW_REPEAT_CALLS, val);
|
||||
if (DEBUG) Log.d(TAG, "onPrefChange allowRepeatCallers=" + val);
|
||||
int priorityCategories = getNewPriorityCategories(val,
|
||||
NotificationManager.Policy.PRIORITY_CATEGORY_REPEAT_CALLERS);
|
||||
@@ -181,7 +182,7 @@ public class ZenModePrioritySettings extends ZenModeSettingsBase implements Inde
|
||||
|
||||
@Override
|
||||
protected int getMetricsCategory() {
|
||||
return MetricsLogger.NOTIFICATION_ZEN_MODE_PRIORITY;
|
||||
return MetricsEvent.NOTIFICATION_ZEN_MODE_PRIORITY;
|
||||
}
|
||||
|
||||
private static void addSources(DropDownPreference pref) {
|
||||
|
||||
@@ -40,6 +40,7 @@ import android.widget.Switch;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsActivity;
|
||||
import com.android.settings.widget.SwitchBar;
|
||||
@@ -162,7 +163,7 @@ public abstract class ZenModeRuleSettingsBase extends ZenModeSettingsBase
|
||||
if (mDisableListeners) return;
|
||||
final boolean enabled = isChecked;
|
||||
if (enabled == mRule.isEnabled()) return;
|
||||
MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ENABLE_RULE, enabled);
|
||||
MetricsLogger.action(mContext, MetricsEvent.ACTION_ZEN_ENABLE_RULE, enabled);
|
||||
if (DEBUG) Log.d(TAG, "onSwitchChanged enabled=" + enabled);
|
||||
mRule.setEnabled(enabled);
|
||||
setZenRule(mRule);
|
||||
@@ -206,7 +207,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);
|
||||
MetricsLogger.action(mContext, MetricsEvent.ACTION_ZEN_DELETE_RULE);
|
||||
showDeleteRuleDialog();
|
||||
return true;
|
||||
}
|
||||
@@ -240,7 +241,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);
|
||||
MetricsLogger.action(mContext, MetricsEvent.ACTION_ZEN_DELETE_RULE_OK);
|
||||
mDeleting = true;
|
||||
removeZenRule(mRule.getId());
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ import android.text.format.DateFormat;
|
||||
import android.util.Log;
|
||||
import android.widget.TimePicker;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -186,7 +186,7 @@ public class ZenModeScheduleRuleSettings extends ZenModeRuleSettingsBase {
|
||||
|
||||
@Override
|
||||
protected int getMetricsCategory() {
|
||||
return MetricsLogger.NOTIFICATION_ZEN_MODE_SCHEDULE_RULE;
|
||||
return MetricsEvent.NOTIFICATION_ZEN_MODE_SCHEDULE_RULE;
|
||||
}
|
||||
|
||||
private void showDaysDialog() {
|
||||
|
||||
@@ -25,7 +25,7 @@ import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsActivity;
|
||||
|
||||
@@ -55,7 +55,7 @@ public class ZenModeSettings extends ZenModeSettingsBase {
|
||||
|
||||
@Override
|
||||
protected int getMetricsCategory() {
|
||||
return MetricsLogger.NOTIFICATION_ZEN_MODE;
|
||||
return MetricsEvent.NOTIFICATION_ZEN_MODE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,6 +27,7 @@ import android.support.v7.preference.PreferenceScreen;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settings.search.Indexable;
|
||||
import com.android.settings.R;
|
||||
@@ -61,7 +62,7 @@ public class ZenModeVisualInterruptionSettings extends ZenModeSettingsBase {
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
if (mDisableListeners) return true;
|
||||
final boolean val = (Boolean) newValue;
|
||||
MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ALLOW_PEEK, val);
|
||||
MetricsLogger.action(mContext, MetricsEvent.ACTION_ZEN_ALLOW_PEEK, val);
|
||||
if (DEBUG) Log.d(TAG, "onPrefChange suppressPeek=" + val);
|
||||
savePolicy(getNewSuppressedEffects(val, Policy.SUPPRESSED_EFFECT_PEEK));
|
||||
return true;
|
||||
@@ -74,7 +75,7 @@ public class ZenModeVisualInterruptionSettings extends ZenModeSettingsBase {
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
if (mDisableListeners) return true;
|
||||
final boolean val = (Boolean) newValue;
|
||||
MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ALLOW_LIGHTS, val);
|
||||
MetricsLogger.action(mContext, MetricsEvent.ACTION_ZEN_ALLOW_LIGHTS, val);
|
||||
if (DEBUG) Log.d(TAG, "onPrefChange suppressLights=" + val);
|
||||
savePolicy(getNewSuppressedEffects(val, Policy.SUPPRESSED_EFFECT_LIGHTS));
|
||||
return true;
|
||||
@@ -87,7 +88,7 @@ public class ZenModeVisualInterruptionSettings extends ZenModeSettingsBase {
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
if (mDisableListeners) return true;
|
||||
final boolean val = (Boolean) newValue;
|
||||
MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ALLOW_SCREEN_ON, val);
|
||||
MetricsLogger.action(mContext, MetricsEvent.ACTION_ZEN_ALLOW_SCREEN_ON, val);
|
||||
if (DEBUG) Log.d(TAG, "onPrefChange suppressScreenOn=" + val);
|
||||
savePolicy(getNewSuppressedEffects(val, Policy.SUPPRESSED_EFFECT_SCREEN_ON));
|
||||
return true;
|
||||
@@ -97,7 +98,7 @@ public class ZenModeVisualInterruptionSettings extends ZenModeSettingsBase {
|
||||
|
||||
@Override
|
||||
protected int getMetricsCategory() {
|
||||
return MetricsLogger.NOTIFICATION_ZEN_MODE_VISUAL_INTERRUPTIONS;
|
||||
return MetricsEvent.NOTIFICATION_ZEN_MODE_VISUAL_INTERRUPTIONS;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user