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

Commit af0114f4 authored by Riddle Hsu's avatar Riddle Hsu Committed by Automerger Merge Worker
Browse files

Merge "Do not unregister CONSTRAIN_DISPLAY_APIS for WmTests" into tm-dev am: c46b5540

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17292203

Change-Id: Ic7b1fac224b7defa3a30e57631685153cf0ee8d1
parents ddaec756 c46b5540
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.server.wm;

import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.provider.DeviceConfig.NAMESPACE_CONSTRAIN_DISPLAY_APIS;
import static android.testing.DexmakerShareClassLoaderRule.runWithDexmakerShareClassLoader;
import static android.view.Display.DEFAULT_DISPLAY;

@@ -190,7 +191,11 @@ public class SystemServicesTestRule implements TestRule {
    private void setUpSystemCore() {
        doReturn(mock(Watchdog.class)).when(Watchdog::getInstance);
        doAnswer(invocation -> {
            // Exclude CONSTRAIN_DISPLAY_APIS because ActivityRecord#sConstrainDisplayApisConfig
            // only registers once and it doesn't reference to outside.
            if (!NAMESPACE_CONSTRAIN_DISPLAY_APIS.equals(invocation.getArgument(0))) {
                mDeviceConfigListeners.add(invocation.getArgument(2));
            }
            // SizeCompatTests uses setNeverConstrainDisplayApisFlag, and ActivityRecordTests
            // uses splash_screen_exception_list. So still execute real registration.
            return invocation.callRealMethod();