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

Commit b6ac14b3 authored by Jagrut Desai's avatar Jagrut Desai Committed by Android (Google) Code Review
Browse files

Merge "Fix Navigation Bar System UI tests" into main

parents 260412b0 2d0989ec
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -150,6 +150,7 @@ public class NavBarHelperTest extends SysuiTestCase {
        when(mUserTracker.getUserId()).thenReturn(1);
        when(mUserTracker.getUserId()).thenReturn(1);
        when(mDisplayTracker.getDefaultDisplayId()).thenReturn(0);
        when(mDisplayTracker.getDefaultDisplayId()).thenReturn(0);
        when(mEdgeBackGestureHandlerFactory.create(any())).thenReturn(mEdgeBackGestureHandler);
        when(mEdgeBackGestureHandlerFactory.create(any())).thenReturn(mEdgeBackGestureHandler);
        when(mLauncherProxyService.isSystemOrVisibleBgUser()).thenReturn(true);


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


    public boolean isSystemOrVisibleBgUser() {
        return mIsSystemOrVisibleBgUser;
    }

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