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

Commit 3e4bbf4a authored by Lucas Dupin's avatar Lucas Dupin Committed by Android (Google) Code Review
Browse files

Merge "Move setHasTopUi to the background" into udc-qpr-dev

parents a2cb2231 a1a04f47
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_M
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_BEHAVIOR_CONTROLLED;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_OPTIMIZE_MEASURE;

import static com.android.systemui.DejankUtils.whitelistIpcs;
import static com.android.systemui.statusbar.NotificationRemoteInputManager.ENABLE_REMOTE_INPUT;

import android.app.IActivityManager;
@@ -52,6 +51,7 @@ import com.android.systemui.R;
import com.android.systemui.biometrics.AuthController;
import com.android.systemui.colorextraction.SysuiColorExtractor;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.dump.DumpsysTableLogger;
import com.android.systemui.keyguard.KeyguardViewMediator;
@@ -75,6 +75,7 @@ import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
import java.util.stream.Collectors;

@@ -102,6 +103,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
    private final float mKeyguardMaxRefreshRate;
    private final KeyguardViewMediator mKeyguardViewMediator;
    private final KeyguardBypassController mKeyguardBypassController;
    private final Executor mBackgroundExecutor;
    private final AuthController mAuthController;
    private ViewGroup mWindowRootView;
    private LayoutParams mLp;
@@ -135,6 +137,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
            ConfigurationController configurationController,
            KeyguardViewMediator keyguardViewMediator,
            KeyguardBypassController keyguardBypassController,
            @Background Executor backgroundExecutor,
            SysuiColorExtractor colorExtractor,
            DumpManager dumpManager,
            KeyguardStateController keyguardStateController,
@@ -152,6 +155,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
        mLpChanged = new LayoutParams();
        mKeyguardViewMediator = keyguardViewMediator;
        mKeyguardBypassController = keyguardBypassController;
        mBackgroundExecutor = backgroundExecutor;
        mColorExtractor = colorExtractor;
        mScreenOffAnimationController = screenOffAnimationController;
        dumpManager.registerDumpable(getClass().getName(), this);
@@ -512,13 +516,14 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
        applyWindowLayoutParams();

        if (mHasTopUi != mHasTopUiChanged) {
            whitelistIpcs(() -> {
            mHasTopUi = mHasTopUiChanged;
            mBackgroundExecutor.execute(() -> {
                try {
                    mActivityManager.setHasTopUi(mHasTopUiChanged);
                } catch (RemoteException e) {
                    Log.e(TAG, "Failed to call setHasTopUi", e);
                }
                mHasTopUi = mHasTopUiChanged;

            });
        }
        notifyStateChangedCallbacks();
+1 −1
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
        mNotificationShadeWindowController = new NotificationShadeWindowControllerImpl(mContext,
                mWindowManager, mActivityManager, mDozeParameters, mStatusBarStateController,
                mConfigurationController, mViewMediator, mKeyguardBypassController,
                mColorExtractor, mDumpManager, mKeyguardStateController,
                mUiBgExecutor, mColorExtractor, mDumpManager, mKeyguardStateController,
                mScreenOffAnimationController, mAuthController, mShadeExpansionStateManager,
                mShadeWindowLogger);
        mFeatureFlags = new FakeFeatureFlags();
+5 −1
Original line number Diff line number Diff line
@@ -62,6 +62,8 @@ import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.KeyguardStateController;

import com.google.common.util.concurrent.MoreExecutors;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -72,6 +74,7 @@ import org.mockito.MockitoAnnotations;
import org.mockito.Spy;

import java.util.List;
import java.util.concurrent.Executor;

@RunWith(AndroidTestingRunner.class)
@RunWithLooper
@@ -97,6 +100,7 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase {
    @Mock private ShadeWindowLogger mShadeWindowLogger;
    @Captor private ArgumentCaptor<WindowManager.LayoutParams> mLayoutParameters;
    @Captor private ArgumentCaptor<StatusBarStateController.StateListener> mStateListener;
    private final Executor mBackgroundExecutor = MoreExecutors.directExecutor();

    private NotificationShadeWindowControllerImpl mNotificationShadeWindowController;
    private float mPreferredRefreshRate = -1;
@@ -117,7 +121,7 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase {
        mNotificationShadeWindowController = new NotificationShadeWindowControllerImpl(mContext,
                mWindowManager, mActivityManager, mDozeParameters, mStatusBarStateController,
                mConfigurationController, mKeyguardViewMediator, mKeyguardBypassController,
                mColorExtractor, mDumpManager, mKeyguardStateController,
                mBackgroundExecutor, mColorExtractor, mDumpManager, mKeyguardStateController,
                mScreenOffAnimationController, mAuthController, mShadeExpansionStateManager,
                mShadeWindowLogger) {
                    @Override
+1 −1
Original line number Diff line number Diff line
@@ -333,7 +333,7 @@ public class BubblesTest extends SysuiTestCase {
        mNotificationShadeWindowController = new NotificationShadeWindowControllerImpl(mContext,
                mWindowManager, mActivityManager, mDozeParameters, mStatusBarStateController,
                mConfigurationController, mKeyguardViewMediator, mKeyguardBypassController,
                mColorExtractor, mDumpManager, mKeyguardStateController,
                syncExecutor, mColorExtractor, mDumpManager, mKeyguardStateController,
                mScreenOffAnimationController, mAuthController, mShadeExpansionStateManager,
                mShadeWindowLogger);
        mNotificationShadeWindowController.setWindowRootView(mNotificationShadeWindowView);