Log rotation suggestion events in SystemUI
Also use non-static MetricsLogger calls
Test: manual
Change-Id: Ib32b1320934698b98103d7fa5f4929d8247a43f6
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
index dc51b1c..6063151 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
@@ -124,6 +124,7 @@
private AccessibilityManager mAccessibilityManager;
private MagnificationContentObserver mMagnificationObserver;
private ContentResolver mContentResolver;
+ private final MetricsLogger mMetricsLogger = Dependency.get(MetricsLogger.class);
private int mDisabledFlags1;
private StatusBar mStatusBar;
@@ -355,6 +356,7 @@
mLastRotationSuggestion = rotation; // Remember rotation for click
setRotateSuggestionButtonState(true);
rescheduleRotationTimeout(false);
+ mMetricsLogger.visible(MetricsEvent.ROTATION_SUGGESTION_SHOWN);
}
}
@@ -612,7 +614,7 @@
if (shouldDisableNavbarGestures()) {
return false;
}
- MetricsLogger.action(getContext(), MetricsEvent.ACTION_ASSIST_LONG_PRESS);
+ mMetricsLogger.action(MetricsEvent.ACTION_ASSIST_LONG_PRESS);
mAssistManager.startAssist(new Bundle() /* args */);
mStatusBar.awakenDreams();
@@ -768,6 +770,7 @@
}
private void onRotateSuggestionClick(View v) {
+ mMetricsLogger.action(MetricsEvent.ACTION_ROTATION_SUGGESTION_ACCEPTED);
mRotationLockController.setRotationLockedAtAngle(true, mLastRotationSuggestion);
}
diff --git a/proto/src/metrics_constants.proto b/proto/src/metrics_constants.proto
index bfec88c..6af07db 100644
--- a/proto/src/metrics_constants.proto
+++ b/proto/src/metrics_constants.proto
@@ -5158,6 +5158,16 @@
// OS: P
NOTIFICATION_ZEN_MODE_ENABLE_DIALOG = 1286;
+ // ACTION: Rotate suggestion accepted in rotation locked mode
+ // CATEGORY: GLOBAL_SYSTEM_UI
+ // OS: P
+ ACTION_ROTATION_SUGGESTION_ACCEPTED = 1287;
+
+ // OPEN: Rotation suggestion shown in rotation locked mode
+ // CATEGORY: GLOBAL_SYSTEM_UI
+ // OS: P
+ ROTATION_SUGGESTION_SHOWN = 1288;
+
// ---- End P Constants, all P constants go above this line ----
// Add new aosp constants above this line.
// END OF AOSP CONSTANTS