public static final int EVENT_MUTE_CHANGED = 15; // (stream|int) (muted|bool)
public static final int EVENT_TOUCH_LEVEL_DONE = 16; // (stream|int) (level|bool)
public static final int EVENT_ZEN_CONFIG_CHANGED = 17; // (allow/disallow|string)
+ public static final int EVENT_RINGER_TOGGLE = 18; // (ringer_mode)
private static final String[] EVENT_TAGS = {
- "show_dialog",
- "dismiss_dialog",
- "active_stream_changed",
- "expand",
- "key",
- "collection_started",
- "collection_stopped",
- "icon_click",
- "settings_click",
- "touch_level_changed",
- "level_changed",
- "internal_ringer_mode_changed",
- "external_ringer_mode_changed",
- "zen_mode_changed",
- "suppressor_changed",
- "mute_changed",
- "touch_level_done",
- "zen_mode_config_changed",
+ "show_dialog",
+ "dismiss_dialog",
+ "active_stream_changed",
+ "expand",
+ "key",
+ "collection_started",
+ "collection_stopped",
+ "icon_click",
+ "settings_click",
+ "touch_level_changed",
+ "level_changed",
+ "internal_ringer_mode_changed",
+ "external_ringer_mode_changed",
+ "zen_mode_changed",
+ "suppressor_changed",
+ "mute_changed",
+ "touch_level_done",
+ "zen_mode_config_changed",
+ "ringer_toggle"
};
public static final int DISMISS_REASON_UNKNOWN = 0;
public static Callback sCallback;
public static void writeEvent(Context context, int tag, Object... list) {
+ MetricsLogger logger = new MetricsLogger();
final long time = System.currentTimeMillis();
final StringBuilder sb = new StringBuilder("writeEvent ").append(EVENT_TAGS[tag]);
if (list != null && list.length > 0) {
break;
case EVENT_ICON_CLICK:
MetricsLogger.action(context, MetricsEvent.ACTION_VOLUME_ICON,
- (Integer) list[1]);
+ (Integer) list[0]);
sb.append(AudioSystem.streamToString((Integer) list[0])).append(' ')
.append(iconStateToString((Integer) list[1]));
break;
break;
case EVENT_KEY:
MetricsLogger.action(context, MetricsEvent.ACTION_VOLUME_KEY,
- (Integer) list[1]);
+ (Integer) list[0]);
sb.append(AudioSystem.streamToString((Integer) list[0])).append(' ')
.append(list[1]);
break;
+ case EVENT_RINGER_TOGGLE:
+ logger.action(MetricsEvent.ACTION_VOLUME_RINGER_TOGGLE, (Integer) list[0]);
+ break;
+ case EVENT_SETTINGS_CLICK:
+ logger.action(MetricsEvent.ACTION_VOLUME_SETTINGS);
+ break;
case EVENT_EXTERNAL_RINGER_MODE_CHANGED:
MetricsLogger.action(context, MetricsEvent.ACTION_RINGER_MODE,
(Integer) list[0]);
mSettingsView.setVisibility(
mDeviceProvisionedController.isDeviceProvisioned() ? VISIBLE : GONE);
mSettingsIcon.setOnClickListener(v -> {
+ Events.writeEvent(mContext, Events.EVENT_SETTINGS_CLICK);
Intent intent = new Intent(Settings.ACTION_SOUND_SETTINGS);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
dismissH(DISMISS_REASON_SETTINGS_CLICKED);
public void initRingerH() {
mRingerIcon.setOnClickListener(v -> {
- Events.writeEvent(mContext, Events.EVENT_ICON_CLICK, AudioManager.STREAM_RING,
- mRingerIcon.getTag());
Prefs.putBoolean(mContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, true);
final StreamState ss = mState.states.get(AudioManager.STREAM_RING);
if (ss == null) {
mController.setStreamVolume(AudioManager.STREAM_RING, 1);
}
}
+ Events.writeEvent(mContext, Events.EVENT_RINGER_TOGGLE, newRingerMode);
updateRingerH();
provideTouchFeedbackH(newRingerMode);
mController.setRingerMode(newRingerMode, false);
// OS: P
NOTIFICATION_SMART_REPLY_COUNT = 1384;
+ // Volume dialog > ringer toggle
+ // OS: P
+ ACTION_VOLUME_RINGER_TOGGLE = 1385;
+
+ // Volume dialog > settings button
+ // OS: P
+ ACTION_VOLUME_SETTINGS = 1386;
+
+
// ---- End P Constants, all P constants go above this line ----
// Add new aosp constants above this line.
// END OF AOSP CONSTANTS