Loading quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java +14 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCH import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_BACK_BUTTON_TAP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_HOME_BUTTON_LONGPRESS; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_HOME_BUTTON_TAP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_LONGPRESS; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_TAP; Loading @@ -37,6 +38,7 @@ import android.os.Handler; import android.util.Log; import android.view.HapticFeedbackConstants; import android.view.View; import android.view.inputmethod.Flags; import androidx.annotation.IntDef; import androidx.annotation.Nullable; Loading Loading @@ -147,7 +149,7 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa break; case BUTTON_IME_SWITCH: logEvent(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP); showIMESwitcher(); onImeSwitcherPress(); break; case BUTTON_A11Y: logEvent(LAUNCHER_TASKBAR_A11Y_BUTTON_TAP); Loading Loading @@ -190,6 +192,12 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa backRecentsLongpress(buttonType); return true; case BUTTON_IME_SWITCH: if (Flags.imeSwitcherRevamp()) { logEvent(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS); onImeSwitcherLongPress(); return true; } return false; default: return false; } Loading Loading @@ -305,10 +313,14 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa mSystemUiProxy.onBackPressed(); } private void showIMESwitcher() { private void onImeSwitcherPress() { mSystemUiProxy.onImeSwitcherPressed(); } private void onImeSwitcherLongPress() { mSystemUiProxy.onImeSwitcherLongPress(); } private void notifyA11yClick(boolean longClick) { if (longClick) { mSystemUiProxy.notifyAccessibilityButtonLongClicked(); Loading quickstep/src/com/android/quickstep/SystemUiProxy.java +11 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,17 @@ public class SystemUiProxy implements ISystemUiProxy, NavHandle, SafeCloseable { } } @Override public void onImeSwitcherLongPress() { if (mSystemUiProxy != null) { try { mSystemUiProxy.onImeSwitcherLongPress(); } catch (RemoteException e) { Log.w(TAG, "Failed call onImeSwitcherLongPress"); } } } @Override public void setHomeRotationEnabled(boolean enabled) { if (mSystemUiProxy != null) { Loading quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarNavButtonControllerTest.java +22 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,8 @@ import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCH import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_BACK_BUTTON_TAP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_HOME_BUTTON_LONGPRESS; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_HOME_BUTTON_TAP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_LONGPRESS; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_TAP; import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_A11Y; Loading @@ -26,6 +28,7 @@ import static org.mockito.Mockito.when; import android.os.Handler; import android.view.View; import android.view.inputmethod.Flags; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; Loading Loading @@ -109,8 +112,27 @@ public class TaskbarNavButtonControllerTest { @Test public void testPressImeSwitcher() { mNavButtonController.init(mockTaskbarControllers); mNavButtonController.onButtonClick(BUTTON_IME_SWITCH, mockView); verify(mockStatsLogger, times(1)).log(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP); verify(mockStatsLogger, never()).log(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS); verify(mockSystemUiProxy, times(1)).onImeSwitcherPressed(); verify(mockSystemUiProxy, never()).onImeSwitcherLongPress(); } @Test public void testLongPressImeSwitcher() { mNavButtonController.init(mockTaskbarControllers); mNavButtonController.onButtonLongClick(BUTTON_IME_SWITCH, mockView); verify(mockStatsLogger, never()).log(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP); verify(mockSystemUiProxy, never()).onImeSwitcherPressed(); if (Flags.imeSwitcherRevamp()) { verify(mockStatsLogger, times(1)).log(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS); verify(mockSystemUiProxy, times(1)).onImeSwitcherLongPress(); } else { verify(mockStatsLogger, never()).log(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS); verify(mockSystemUiProxy, never()).onImeSwitcherLongPress(); } } @Test Loading src/com/android/launcher3/logging/StatsLogManager.java +3 −0 Original line number Diff line number Diff line Loading @@ -795,6 +795,9 @@ public class StatsLogManager implements ResourceBasedOverride { @UiEvent(doc = "User launches Overview from meta+tab keyboard shortcut") LAUNCHER_OVERVIEW_SHOW_OVERVIEW_FROM_KEYBOARD_SHORTCUT(1765), @UiEvent(doc = "User long pressed on the taskbar IME switcher button") LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS(1798), // ADD MORE ; Loading Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java +14 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCH import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_BACK_BUTTON_TAP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_HOME_BUTTON_LONGPRESS; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_HOME_BUTTON_TAP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_LONGPRESS; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_TAP; Loading @@ -37,6 +38,7 @@ import android.os.Handler; import android.util.Log; import android.view.HapticFeedbackConstants; import android.view.View; import android.view.inputmethod.Flags; import androidx.annotation.IntDef; import androidx.annotation.Nullable; Loading Loading @@ -147,7 +149,7 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa break; case BUTTON_IME_SWITCH: logEvent(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP); showIMESwitcher(); onImeSwitcherPress(); break; case BUTTON_A11Y: logEvent(LAUNCHER_TASKBAR_A11Y_BUTTON_TAP); Loading Loading @@ -190,6 +192,12 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa backRecentsLongpress(buttonType); return true; case BUTTON_IME_SWITCH: if (Flags.imeSwitcherRevamp()) { logEvent(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS); onImeSwitcherLongPress(); return true; } return false; default: return false; } Loading Loading @@ -305,10 +313,14 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa mSystemUiProxy.onBackPressed(); } private void showIMESwitcher() { private void onImeSwitcherPress() { mSystemUiProxy.onImeSwitcherPressed(); } private void onImeSwitcherLongPress() { mSystemUiProxy.onImeSwitcherLongPress(); } private void notifyA11yClick(boolean longClick) { if (longClick) { mSystemUiProxy.notifyAccessibilityButtonLongClicked(); Loading
quickstep/src/com/android/quickstep/SystemUiProxy.java +11 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,17 @@ public class SystemUiProxy implements ISystemUiProxy, NavHandle, SafeCloseable { } } @Override public void onImeSwitcherLongPress() { if (mSystemUiProxy != null) { try { mSystemUiProxy.onImeSwitcherLongPress(); } catch (RemoteException e) { Log.w(TAG, "Failed call onImeSwitcherLongPress"); } } } @Override public void setHomeRotationEnabled(boolean enabled) { if (mSystemUiProxy != null) { Loading
quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarNavButtonControllerTest.java +22 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,8 @@ import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCH import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_BACK_BUTTON_TAP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_HOME_BUTTON_LONGPRESS; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_HOME_BUTTON_TAP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_LONGPRESS; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_TAP; import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_A11Y; Loading @@ -26,6 +28,7 @@ import static org.mockito.Mockito.when; import android.os.Handler; import android.view.View; import android.view.inputmethod.Flags; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; Loading Loading @@ -109,8 +112,27 @@ public class TaskbarNavButtonControllerTest { @Test public void testPressImeSwitcher() { mNavButtonController.init(mockTaskbarControllers); mNavButtonController.onButtonClick(BUTTON_IME_SWITCH, mockView); verify(mockStatsLogger, times(1)).log(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP); verify(mockStatsLogger, never()).log(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS); verify(mockSystemUiProxy, times(1)).onImeSwitcherPressed(); verify(mockSystemUiProxy, never()).onImeSwitcherLongPress(); } @Test public void testLongPressImeSwitcher() { mNavButtonController.init(mockTaskbarControllers); mNavButtonController.onButtonLongClick(BUTTON_IME_SWITCH, mockView); verify(mockStatsLogger, never()).log(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP); verify(mockSystemUiProxy, never()).onImeSwitcherPressed(); if (Flags.imeSwitcherRevamp()) { verify(mockStatsLogger, times(1)).log(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS); verify(mockSystemUiProxy, times(1)).onImeSwitcherLongPress(); } else { verify(mockStatsLogger, never()).log(LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS); verify(mockSystemUiProxy, never()).onImeSwitcherLongPress(); } } @Test Loading
src/com/android/launcher3/logging/StatsLogManager.java +3 −0 Original line number Diff line number Diff line Loading @@ -795,6 +795,9 @@ public class StatsLogManager implements ResourceBasedOverride { @UiEvent(doc = "User launches Overview from meta+tab keyboard shortcut") LAUNCHER_OVERVIEW_SHOW_OVERVIEW_FROM_KEYBOARD_SHORTCUT(1765), @UiEvent(doc = "User long pressed on the taskbar IME switcher button") LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_LONGPRESS(1798), // ADD MORE ; Loading