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

Commit f7eecb9c authored by Justin Weir's avatar Justin Weir Committed by Automerger Merge Worker
Browse files

Remove calls to CentralSurfacesImpl.getNotificationShadeWindowView am: d4403fde am: 057abb78

parents 9e22a2a4 057abb78
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ import android.view.IWallpaperVisibilityListener;
import android.view.IWindowManager;
import android.view.View;
import android.view.WindowInsets;
import android.view.WindowManagerGlobal;
import android.view.accessibility.AccessibilityManager;

import androidx.annotation.NonNull;
@@ -69,10 +68,13 @@ import com.android.systemui.settings.DisplayTracker;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.phone.BarTransitions.TransitionMode;
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.policy.KeyguardStateController;

import dagger.Lazy;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
@@ -80,8 +82,6 @@ import java.util.Optional;

import javax.inject.Inject;

import dagger.Lazy;

/**
 * Extracts shared elements between navbar and taskbar delegate to de-dupe logic and help them
 * experience the joys of friendship.
@@ -111,6 +111,7 @@ public final class NavBarHelper implements
    private final AccessibilityButtonTargetsObserver mAccessibilityButtonTargetsObserver;
    private final List<NavbarTaskbarStateUpdater> mStateListeners = new ArrayList<>();
    private final Context mContext;
    private final NotificationShadeWindowController mNotificationShadeWindowController;
    private final CommandQueue mCommandQueue;
    private final ContentResolver mContentResolver;
    private final EdgeBackGestureHandler mEdgeBackGestureHandler;
@@ -182,9 +183,11 @@ public final class NavBarHelper implements
            IWindowManager wm,
            UserTracker userTracker,
            DisplayTracker displayTracker,
            NotificationShadeWindowController notificationShadeWindowController,
            DumpManager dumpManager,
            CommandQueue commandQueue) {
        mContext = context;
        mNotificationShadeWindowController = notificationShadeWindowController;
        mCommandQueue = commandQueue;
        mContentResolver = mContext.getContentResolver();
        mAccessibilityManager = accessibilityManager;
@@ -460,11 +463,7 @@ public final class NavBarHelper implements
     * {@link InputMethodService} and the keyguard states.
     */
    public boolean isImeShown(int vis) {
        View shadeWindowView = null;
        if (mCentralSurfacesOptionalLazy.get().isPresent()) {
            shadeWindowView =
                    mCentralSurfacesOptionalLazy.get().get().getNotificationShadeWindowView();
        }
        View shadeWindowView =  mNotificationShadeWindowController.getWindowRootView();
        boolean isKeyguardShowing = mKeyguardStateController.isShowing();
        boolean imeVisibleOnShade = shadeWindowView != null && shadeWindowView.isAttachedToWindow()
                && shadeWindowView.getRootWindowInsets().isVisible(WindowInsets.Type.ime());
+5 −1
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ import com.android.systemui.recents.OverviewProxyService;
import com.android.systemui.settings.DisplayTracker;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.policy.KeyguardStateController;

@@ -112,6 +113,9 @@ public class NavBarHelperTest extends SysuiTestCase {
    EdgeBackGestureHandler mEdgeBackGestureHandler;
    @Mock
    EdgeBackGestureHandler.Factory mEdgeBackGestureHandlerFactory;
    @Mock
    NotificationShadeWindowController mNotificationShadeWindowController;

    private AccessibilityManager.AccessibilityServicesStateChangeListener
            mAccessibilityServicesStateChangeListener;

@@ -136,7 +140,7 @@ public class NavBarHelperTest extends SysuiTestCase {
                mSystemActions, mOverviewProxyService, mAssistManagerLazy,
                () -> Optional.of(mock(CentralSurfaces.class)), mock(KeyguardStateController.class),
                mNavigationModeController, mEdgeBackGestureHandlerFactory, mWm, mUserTracker,
                mDisplayTracker, mDumpManager, mCommandQueue);
                mDisplayTracker, mNotificationShadeWindowController, mDumpManager, mCommandQueue);

    }

+6 −3
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@ import com.android.systemui.shared.system.TaskStackChangeListeners;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.NotificationShadeDepthController;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.phone.AutoHideController;
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.phone.LightBarController;
@@ -209,6 +210,8 @@ public class NavigationBarTest extends SysuiTestCase {
    private EdgeBackGestureHandler.Factory mEdgeBackGestureHandlerFactory;
    @Mock
    private EdgeBackGestureHandler mEdgeBackGestureHandler;
    @Mock
    private NotificationShadeWindowController mNotificationShadeWindowController;
    private FakeExecutor mFakeExecutor = new FakeExecutor(new FakeSystemClock());
    private DeviceConfigProxyFake mDeviceConfigProxyFake = new DeviceConfigProxyFake();
    private TaskStackChangeListeners mTaskStackChangeListeners =
@@ -256,7 +259,8 @@ public class NavigationBarTest extends SysuiTestCase {
                    () -> mock(AssistManager.class), () -> Optional.of(mCentralSurfaces),
                    mKeyguardStateController, mock(NavigationModeController.class),
                    mEdgeBackGestureHandlerFactory, mock(IWindowManager.class),
                    mock(UserTracker.class), mock(DisplayTracker.class), mock(DumpManager.class),
                    mock(UserTracker.class), mock(DisplayTracker.class),
                    mNotificationShadeWindowController, mock(DumpManager.class),
                    mock(CommandQueue.class)));
            mNavigationBar = createNavBar(mContext);
            mExternalDisplayNavigationBar = createNavBar(mSysuiTestableContextExternal);
@@ -339,7 +343,6 @@ public class NavigationBarTest extends SysuiTestCase {
        NotificationShadeWindowView mockShadeWindowView = mock(NotificationShadeWindowView.class);
        WindowInsets windowInsets = new WindowInsets.Builder().setVisible(ime(), false).build();
        doReturn(windowInsets).when(mockShadeWindowView).getRootWindowInsets();
        doReturn(mockShadeWindowView).when(mCentralSurfaces).getNotificationShadeWindowView();
        doReturn(true).when(mockShadeWindowView).isAttachedToWindow();
        doNothing().when(defaultNavBar).checkNavBarModes();
        doNothing().when(externalNavBar).checkNavBarModes();
@@ -375,7 +378,7 @@ public class NavigationBarTest extends SysuiTestCase {
    @Test
    public void testSetImeWindowStatusWhenKeyguardLockingAndImeInsetsChange() {
        NotificationShadeWindowView mockShadeWindowView = mock(NotificationShadeWindowView.class);
        doReturn(mockShadeWindowView).when(mCentralSurfaces).getNotificationShadeWindowView();
        doReturn(mockShadeWindowView).when(mNotificationShadeWindowController).getWindowRootView();
        doReturn(true).when(mockShadeWindowView).isAttachedToWindow();
        doNothing().when(mNavigationBar).checkNavBarModes();
        mNavigationBar.init();