Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d0989ec authored by Jagrut Desai's avatar Jagrut Desai
Browse files

Fix Navigation Bar System UI tests

Test: Presubmit
Bug: 410908369
Flag: EXEMPT bugfix

Change-Id: Id9a67f9cb8fa127640216cd6406075d93cc65f2f
parent 01bc9deb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -150,6 +150,7 @@ public class NavBarHelperTest extends SysuiTestCase {
        when(mUserTracker.getUserId()).thenReturn(1);
        when(mDisplayTracker.getDefaultDisplayId()).thenReturn(0);
        when(mEdgeBackGestureHandlerFactory.create(any())).thenReturn(mEdgeBackGestureHandler);
        when(mLauncherProxyService.isSystemOrVisibleBgUser()).thenReturn(true);

        doAnswer((invocation) -> mAccessibilityServicesStateChangeListener =
                invocation.getArgument(0)).when(
+1 −0
Original line number Diff line number Diff line
@@ -275,6 +275,7 @@ public class NavigationBarTest extends SysuiTestCase {
        when(mNavigationBarView.getResources()).thenReturn(mResources);
        when(mNavigationBarView.getViewRootImpl()).thenReturn(mViewRootImpl);
        when(mEdgeBackGestureHandlerFactory.create(any())).thenReturn(mEdgeBackGestureHandler);
        when(mLauncherProxyService.isSystemOrVisibleBgUser()).thenReturn(true);
        setupSysuiDependency();
        // This class inflates views that call Dependency.get, thus these injections are still
        // necessary.
+4 −0
Original line number Diff line number Diff line
@@ -853,6 +853,10 @@ public class LauncherProxyService implements CallbackController<LauncherProxyLis
        assistUtils.registerVoiceInteractionSessionListener(mVoiceInteractionSessionListener);
    }

    public boolean isSystemOrVisibleBgUser() {
        return mIsSystemOrVisibleBgUser;
    }

    public void onVoiceSessionWindowVisibilityChanged(boolean visible) {
        mDefaultDisplaySysUIState.setFlag(SYSUI_STATE_VOICE_INTERACTION_WINDOW_SHOWING, visible)
                .commitUpdate(mContext.getDisplayId());
+1 −2
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@ import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Process;
import android.os.RemoteException;
import android.os.UserHandle;
import android.provider.Settings;
@@ -214,7 +213,7 @@ public final class NavBarHelper implements
            @Main Executor mainExecutor,
            @Background Handler bgHandler) {
        // b/319489709: This component shouldn't be running for a non-primary user
        if (!Process.myUserHandle().equals(UserHandle.SYSTEM)) {
        if (!launcherProxyService.isSystemOrVisibleBgUser()) {
            Log.wtf(TAG, "Unexpected initialization for non-primary user", new Throwable());
        }
        mContext = context;