Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/RotationButtonController.java +21 −5 Original line number Diff line number Diff line Loading @@ -36,8 +36,9 @@ import android.view.View; import android.view.WindowManagerGlobal; import android.view.accessibility.AccessibilityManager; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.internal.logging.UiEvent; import com.android.internal.logging.UiEventLogger; import com.android.internal.logging.UiEventLoggerImpl; import com.android.systemui.Dependency; import com.android.systemui.Interpolators; import com.android.systemui.R; Loading @@ -58,7 +59,7 @@ public class RotationButtonController { private static final int NUM_ACCEPTED_ROTATION_SUGGESTIONS_FOR_INTRODUCTION = 3; private final MetricsLogger mMetricsLogger = Dependency.get(MetricsLogger.class); private final UiEventLogger mUiEventLogger = new UiEventLoggerImpl(); private final ViewRippler mViewRippler = new ViewRippler(); private @StyleRes int mStyleRes; Loading Loading @@ -318,7 +319,7 @@ public class RotationButtonController { } private void onRotateSuggestionClick(View v) { mMetricsLogger.action(MetricsEvent.ACTION_ROTATION_SUGGESTION_ACCEPTED); mUiEventLogger.log(RotationButtonEvent.ROTATION_SUGGESTION_ACCEPTED); incrementNumAcceptedRotationSuggestionsIfNeeded(); setRotationLockedAtAngle(mLastRotationSuggestion); } Loading @@ -340,7 +341,7 @@ public class RotationButtonController { private void showAndLogRotationSuggestion() { setRotateSuggestionButtonState(true /* visible */); rescheduleRotationTimeout(false /* reasonHover */); mMetricsLogger.visible(MetricsEvent.ROTATION_SUGGESTION_SHOWN); mUiEventLogger.log(RotationButtonEvent.ROTATION_SUGGESTION_SHOWN); } private boolean shouldOverrideUserLockPrefs(final int rotation) { Loading Loading @@ -469,4 +470,19 @@ public class RotationButtonController { } }; } enum RotationButtonEvent implements UiEventLogger.UiEventEnum { @UiEvent(doc = "The rotation button was shown") ROTATION_SUGGESTION_SHOWN(206), @UiEvent(doc = "The rotation button was clicked") ROTATION_SUGGESTION_ACCEPTED(207); private final int mId; RotationButtonEvent(int id) { mId = id; } @Override public int getId() { return mId; } } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/RotationButtonController.java +21 −5 Original line number Diff line number Diff line Loading @@ -36,8 +36,9 @@ import android.view.View; import android.view.WindowManagerGlobal; import android.view.accessibility.AccessibilityManager; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.internal.logging.UiEvent; import com.android.internal.logging.UiEventLogger; import com.android.internal.logging.UiEventLoggerImpl; import com.android.systemui.Dependency; import com.android.systemui.Interpolators; import com.android.systemui.R; Loading @@ -58,7 +59,7 @@ public class RotationButtonController { private static final int NUM_ACCEPTED_ROTATION_SUGGESTIONS_FOR_INTRODUCTION = 3; private final MetricsLogger mMetricsLogger = Dependency.get(MetricsLogger.class); private final UiEventLogger mUiEventLogger = new UiEventLoggerImpl(); private final ViewRippler mViewRippler = new ViewRippler(); private @StyleRes int mStyleRes; Loading Loading @@ -318,7 +319,7 @@ public class RotationButtonController { } private void onRotateSuggestionClick(View v) { mMetricsLogger.action(MetricsEvent.ACTION_ROTATION_SUGGESTION_ACCEPTED); mUiEventLogger.log(RotationButtonEvent.ROTATION_SUGGESTION_ACCEPTED); incrementNumAcceptedRotationSuggestionsIfNeeded(); setRotationLockedAtAngle(mLastRotationSuggestion); } Loading @@ -340,7 +341,7 @@ public class RotationButtonController { private void showAndLogRotationSuggestion() { setRotateSuggestionButtonState(true /* visible */); rescheduleRotationTimeout(false /* reasonHover */); mMetricsLogger.visible(MetricsEvent.ROTATION_SUGGESTION_SHOWN); mUiEventLogger.log(RotationButtonEvent.ROTATION_SUGGESTION_SHOWN); } private boolean shouldOverrideUserLockPrefs(final int rotation) { Loading Loading @@ -469,4 +470,19 @@ public class RotationButtonController { } }; } enum RotationButtonEvent implements UiEventLogger.UiEventEnum { @UiEvent(doc = "The rotation button was shown") ROTATION_SUGGESTION_SHOWN(206), @UiEvent(doc = "The rotation button was clicked") ROTATION_SUGGESTION_ACCEPTED(207); private final int mId; RotationButtonEvent(int id) { mId = id; } @Override public int getId() { return mId; } } }