diff options
27 files changed, 114 insertions, 739 deletions
diff --git a/apct-tests/perftests/windowmanager/src/android/wm/RelayoutPerfTest.java b/apct-tests/perftests/windowmanager/src/android/wm/RelayoutPerfTest.java index a701f8631969..ecd149989ce6 100644 --- a/apct-tests/perftests/windowmanager/src/android/wm/RelayoutPerfTest.java +++ b/apct-tests/perftests/windowmanager/src/android/wm/RelayoutPerfTest.java @@ -139,7 +139,6 @@ public class RelayoutPerfTest extends WindowManagerPerfTestBase final IntSupplier mViewVisibility; - int mSeq; int mFrameNumber; int mFlags; @@ -156,7 +155,7 @@ public class RelayoutPerfTest extends WindowManagerPerfTestBase void runBenchmark(BenchmarkState state) throws RemoteException { final IWindowSession session = WindowManagerGlobal.getWindowSession(); while (state.keepRunning()) { - session.relayout(mWindow, mSeq, mParams, mWidth, mHeight, + session.relayout(mWindow, mParams, mWidth, mHeight, mViewVisibility.getAsInt(), mFlags, mFrameNumber, mOutFrames, mOutMergedConfiguration, mOutSurfaceControl, mOutInsetsState, mOutControls, mOutSurfaceSize, mOutBlastSurfaceControl); diff --git a/apct-tests/perftests/windowmanager/src/android/wm/WindowAddRemovePerfTest.java b/apct-tests/perftests/windowmanager/src/android/wm/WindowAddRemovePerfTest.java index c52b1300aedc..b11d74646d67 100644 --- a/apct-tests/perftests/windowmanager/src/android/wm/WindowAddRemovePerfTest.java +++ b/apct-tests/perftests/windowmanager/src/android/wm/WindowAddRemovePerfTest.java @@ -107,7 +107,7 @@ public class WindowAddRemovePerfTest extends WindowManagerPerfTestBase final InputChannel inputChannel = new InputChannel(); long startTime = SystemClock.elapsedRealtimeNanos(); - session.addToDisplay(this, mSeq, mLayoutParams, View.VISIBLE, + session.addToDisplay(this, mLayoutParams, View.VISIBLE, Display.DEFAULT_DISPLAY, mOutFrame, mOutContentInsets, mOutStableInsets, mOutDisplayCutout, inputChannel, mOutInsetsState, mOutControls); final long elapsedTimeNsOfAdd = SystemClock.elapsedRealtimeNanos() - startTime; diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java index 19860eb45fbf..0f46ffcb2d7f 100644 --- a/core/java/android/service/wallpaper/WallpaperService.java +++ b/core/java/android/service/wallpaper/WallpaperService.java @@ -879,7 +879,7 @@ public abstract class WallpaperService extends Service { com.android.internal.R.style.Animation_Wallpaper; InputChannel inputChannel = new InputChannel(); - if (mSession.addToDisplay(mWindow, mWindow.mSeq, mLayout, View.VISIBLE, + if (mSession.addToDisplay(mWindow, mLayout, View.VISIBLE, mDisplay.getDisplayId(), mWinFrames.frame, mWinFrames.contentInsets, mWinFrames.stableInsets, mWinFrames.displayCutout, inputChannel, mInsetsState, mTempControls) < 0) { @@ -903,7 +903,7 @@ public abstract class WallpaperService extends Service { } final int relayoutResult = mSession.relayout( - mWindow, mWindow.mSeq, mLayout, mWidth, mHeight, + mWindow, mLayout, mWidth, mHeight, View.VISIBLE, 0, -1, mWinFrames, mMergedConfiguration, mSurfaceControl, mInsetsState, mTempControls, mSurfaceSize, mTmpSurfaceControl); if (mSurfaceControl.isValid()) { diff --git a/core/java/android/view/IWindow.aidl b/core/java/android/view/IWindow.aidl index 94e641c62b25..193e674dd1b0 100644 --- a/core/java/android/view/IWindow.aidl +++ b/core/java/android/view/IWindow.aidl @@ -120,12 +120,6 @@ oneway interface IWindow { void updatePointerIcon(float x, float y); /** - * System chrome visibility changes - */ - void dispatchSystemUiVisibilityChanged(int seq, int globalVisibility, - int localValue, int localChanges); - - /** * Called for non-application windows when the enter animation has completed. */ void dispatchWindowShown(); diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl index 8e875d7a889d..5836538bde99 100644 --- a/core/java/android/view/IWindowManager.aidl +++ b/core/java/android/view/IWindowManager.aidl @@ -378,11 +378,6 @@ interface IWindowManager boolean requestAssistScreenshot(IAssistDataReceiver receiver); /** - * Called by the status bar to notify Views of changes to System UI visiblity. - */ - oneway void statusBarVisibilityChanged(int displayId, int visibility); - - /** * Called by System UI to notify Window Manager to hide transient bars. */ oneway void hideTransientBars(int displayId); diff --git a/core/java/android/view/IWindowSession.aidl b/core/java/android/view/IWindowSession.aidl index 609f80253ce6..68ac70df8d32 100644 --- a/core/java/android/view/IWindowSession.aidl +++ b/core/java/android/view/IWindowSession.aidl @@ -44,17 +44,17 @@ import java.util.List; * {@hide} */ interface IWindowSession { - int addToDisplay(IWindow window, int seq, in WindowManager.LayoutParams attrs, + int addToDisplay(IWindow window, in WindowManager.LayoutParams attrs, in int viewVisibility, in int layerStackId, out Rect outFrame, out Rect outContentInsets, out Rect outStableInsets, out DisplayCutout.ParcelableWrapper displayCutout, out InputChannel outInputChannel, out InsetsState insetsState, out InsetsSourceControl[] activeControls); - int addToDisplayAsUser(IWindow window, int seq, in WindowManager.LayoutParams attrs, + int addToDisplayAsUser(IWindow window, in WindowManager.LayoutParams attrs, in int viewVisibility, in int layerStackId, in int userId, out Rect outFrame, out Rect outContentInsets, out Rect outStableInsets, out DisplayCutout.ParcelableWrapper displayCutout, out InputChannel outInputChannel, out InsetsState insetsState, out InsetsSourceControl[] activeControls); - int addToDisplayWithoutInputChannel(IWindow window, int seq, in WindowManager.LayoutParams attrs, + int addToDisplayWithoutInputChannel(IWindow window, in WindowManager.LayoutParams attrs, in int viewVisibility, in int layerStackId, out Rect outContentInsets, out Rect outStableInsets, out InsetsState insetsState); @UnsupportedAppUsage @@ -68,7 +68,6 @@ interface IWindowSession { * to draw the window's contents. * * @param window The window being modified. - * @param seq Ordering sequence number. * @param attrs If non-null, new attributes to apply to the window. * @param requestedWidth The width the window wants to be. * @param requestedHeight The height the window wants to be. @@ -106,7 +105,7 @@ interface IWindowSession { * @return int Result flags: {@link WindowManagerGlobal#RELAYOUT_SHOW_FOCUS}, * {@link WindowManagerGlobal#RELAYOUT_FIRST_TIME}. */ - int relayout(IWindow window, int seq, in WindowManager.LayoutParams attrs, + int relayout(IWindow window, in WindowManager.LayoutParams attrs, int requestedWidth, int requestedHeight, int viewVisibility, int flags, long frameNumber, out ClientWindowFrames outFrames, out MergedConfiguration outMergedConfiguration, out SurfaceControl outSurfaceControl, diff --git a/core/java/android/view/InsetsController.java b/core/java/android/view/InsetsController.java index 92eade3affaa..b438f8f0b1dd 100644 --- a/core/java/android/view/InsetsController.java +++ b/core/java/android/view/InsetsController.java @@ -1388,7 +1388,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation } @Override - public @Appearance int getSystemBarsBehavior() { + public @Behavior int getSystemBarsBehavior() { return mHost.getSystemBarsBehavior(); } diff --git a/core/java/android/view/InsetsFlags.java b/core/java/android/view/InsetsFlags.java index 385b0bf960ef..5a64a5d5b3a6 100644 --- a/core/java/android/view/InsetsFlags.java +++ b/core/java/android/view/InsetsFlags.java @@ -16,13 +16,6 @@ package android.view; -import static android.view.View.NAVIGATION_BAR_TRANSLUCENT; -import static android.view.View.NAVIGATION_BAR_TRANSPARENT; -import static android.view.View.STATUS_BAR_TRANSLUCENT; -import static android.view.View.STATUS_BAR_TRANSPARENT; -import static android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR; -import static android.view.View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; -import static android.view.View.SYSTEM_UI_FLAG_LOW_PROFILE; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS; import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS; @@ -76,44 +69,4 @@ public class InsetsFlags { name = "SHOW_TRANSIENT_BARS_BY_SWIPE") }) public @Behavior int behavior; - - /** - * Converts system UI visibility to appearance. - * - * @param systemUiVisibility the system UI visibility to be converted. - * @return the outcome {@link Appearance} - */ - public static @Appearance int getAppearance(int systemUiVisibility) { - int appearance = 0; - appearance |= convertFlag(systemUiVisibility, SYSTEM_UI_FLAG_LOW_PROFILE, - APPEARANCE_LOW_PROFILE_BARS); - appearance |= convertFlag(systemUiVisibility, SYSTEM_UI_FLAG_LIGHT_STATUS_BAR, - APPEARANCE_LIGHT_STATUS_BARS); - appearance |= convertFlag(systemUiVisibility, SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR, - APPEARANCE_LIGHT_NAVIGATION_BARS); - appearance |= convertNoFlag(systemUiVisibility, - STATUS_BAR_TRANSLUCENT | STATUS_BAR_TRANSPARENT, APPEARANCE_OPAQUE_STATUS_BARS); - appearance |= convertNoFlag(systemUiVisibility, - NAVIGATION_BAR_TRANSLUCENT | NAVIGATION_BAR_TRANSPARENT, - APPEARANCE_OPAQUE_NAVIGATION_BARS); - return appearance; - } - - /** - * Converts the system UI visibility into an appearance flag if the given visibility contains - * the given system UI flag. - */ - private static @Appearance int convertFlag(int systemUiVisibility, int systemUiFlag, - @Appearance int appearance) { - return (systemUiVisibility & systemUiFlag) != 0 ? appearance : 0; - } - - /** - * Converts the system UI visibility into an appearance flag if the given visibility doesn't - * contains the given system UI flag. - */ - private static @Appearance int convertNoFlag(int systemUiVisibility, int systemUiFlag, - @Appearance int appearance) { - return (systemUiVisibility & systemUiFlag) == 0 ? appearance : 0; - } } diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index e7e28ac98234..44fde52f7186 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -3995,89 +3995,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /** * @hide - * - * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked - * out of the public fields to keep the undefined bits out of the developer's way. - * - * Flag to specify that the status bar is displayed in transient mode. - */ - public static final int STATUS_BAR_TRANSIENT = 0x04000000; - - /** - * @hide - * - * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked - * out of the public fields to keep the undefined bits out of the developer's way. - * - * Flag to specify that the navigation bar is displayed in transient mode. - */ - @UnsupportedAppUsage - public static final int NAVIGATION_BAR_TRANSIENT = 0x08000000; - - /** - * @hide - * - * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked - * out of the public fields to keep the undefined bits out of the developer's way. - * - * Flag to specify that the hidden status bar would like to be shown. - */ - public static final int STATUS_BAR_UNHIDE = 0x10000000; - - /** - * @hide - * - * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked - * out of the public fields to keep the undefined bits out of the developer's way. - * - * Flag to specify that the hidden navigation bar would like to be shown. - */ - public static final int NAVIGATION_BAR_UNHIDE = 0x20000000; - - /** - * @hide - * - * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked - * out of the public fields to keep the undefined bits out of the developer's way. - * - * Flag to specify that the status bar is displayed in translucent mode. - */ - public static final int STATUS_BAR_TRANSLUCENT = 0x40000000; - - /** - * @hide - * - * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked - * out of the public fields to keep the undefined bits out of the developer's way. - * - * Flag to specify that the navigation bar is displayed in translucent mode. - */ - public static final int NAVIGATION_BAR_TRANSLUCENT = 0x80000000; - - /** - * @hide - * - * Makes navigation bar transparent (but not the status bar). - */ - public static final int NAVIGATION_BAR_TRANSPARENT = 0x00008000; - - /** - * @hide - * - * Makes status bar transparent (but not the navigation bar). - */ - public static final int STATUS_BAR_TRANSPARENT = 0x00000008; - - /** - * @hide - * - * Makes both status bar and navigation bar transparent. - */ - public static final int SYSTEM_UI_TRANSPARENT = NAVIGATION_BAR_TRANSPARENT - | STATUS_BAR_TRANSPARENT; - - /** - * @hide */ public static final int PUBLIC_STATUS_BAR_VISIBILITY_MASK = 0x00003FF7; @@ -4302,31 +4219,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, name = "STATUS_BAR_DISABLE_RECENT"), @ViewDebug.FlagToString(mask = STATUS_BAR_DISABLE_SEARCH, equals = STATUS_BAR_DISABLE_SEARCH, - name = "STATUS_BAR_DISABLE_SEARCH"), - @ViewDebug.FlagToString(mask = STATUS_BAR_TRANSIENT, - equals = STATUS_BAR_TRANSIENT, - name = "STATUS_BAR_TRANSIENT"), - @ViewDebug.FlagToString(mask = NAVIGATION_BAR_TRANSIENT, - equals = NAVIGATION_BAR_TRANSIENT, - name = "NAVIGATION_BAR_TRANSIENT"), - @ViewDebug.FlagToString(mask = STATUS_BAR_UNHIDE, - equals = STATUS_BAR_UNHIDE, - name = "STATUS_BAR_UNHIDE"), - @ViewDebug.FlagToString(mask = NAVIGATION_BAR_UNHIDE, - equals = NAVIGATION_BAR_UNHIDE, - name = "NAVIGATION_BAR_UNHIDE"), - @ViewDebug.FlagToString(mask = STATUS_BAR_TRANSLUCENT, - equals = STATUS_BAR_TRANSLUCENT, - name = "STATUS_BAR_TRANSLUCENT"), - @ViewDebug.FlagToString(mask = NAVIGATION_BAR_TRANSLUCENT, - equals = NAVIGATION_BAR_TRANSLUCENT, - name = "NAVIGATION_BAR_TRANSLUCENT"), - @ViewDebug.FlagToString(mask = NAVIGATION_BAR_TRANSPARENT, - equals = NAVIGATION_BAR_TRANSPARENT, - name = "NAVIGATION_BAR_TRANSPARENT"), - @ViewDebug.FlagToString(mask = STATUS_BAR_TRANSPARENT, - equals = STATUS_BAR_TRANSPARENT, - name = "STATUS_BAR_TRANSPARENT") + name = "STATUS_BAR_DISABLE_SEARCH") }, formatToHexString = true) @SystemUiVisibility int mSystemUiVisibility; @@ -4355,14 +4248,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, STATUS_BAR_DISABLE_CLOCK, STATUS_BAR_DISABLE_RECENT, STATUS_BAR_DISABLE_SEARCH, - STATUS_BAR_TRANSIENT, - NAVIGATION_BAR_TRANSIENT, - STATUS_BAR_UNHIDE, - NAVIGATION_BAR_UNHIDE, - STATUS_BAR_TRANSLUCENT, - NAVIGATION_BAR_TRANSLUCENT, - NAVIGATION_BAR_TRANSPARENT, - STATUS_BAR_TRANSPARENT, }) @Retention(RetentionPolicy.SOURCE) public @interface SystemUiVisibility {} diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 0bbd8992bc1a..211531cba7a1 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -339,8 +339,6 @@ public final class ViewRootImpl implements ViewParent, final int mTargetSdkVersion; - int mSeq; - @UnsupportedAppUsage View mView; @@ -648,7 +646,6 @@ public final class ViewRootImpl implements ViewParent, private IAccessibilityEmbeddedConnection mAccessibilityEmbeddedConnection; static final class SystemUiVisibilityInfo { - int seq; int globalVisibility; int localValue; int localChanges; @@ -996,7 +993,7 @@ public final class ViewRootImpl implements ViewParent, mAttachInfo.mRecomputeGlobalAttributes = true; collectViewAttributes(); adjustLayoutParamsForCompatibility(mWindowAttributes); - res = mWindowSession.addToDisplayAsUser(mWindow, mSeq, mWindowAttributes, + res = mWindowSession.addToDisplayAsUser(mWindow, mWindowAttributes, getHostVisibility(), mDisplay.getDisplayId(), userId, mTmpFrames.frame, mAttachInfo.mContentInsets, mAttachInfo.mStableInsets, mAttachInfo.mDisplayCutout, inputChannel, @@ -7370,7 +7367,7 @@ public final class ViewRootImpl implements ViewParent, frameNumber = mSurface.getNextFrameNumber(); } - int relayoutResult = mWindowSession.relayout(mWindow, mSeq, params, + int relayoutResult = mWindowSession.relayout(mWindow, params, (int) (mView.getMeasuredWidth() * appScale + 0.5f), (int) (mView.getMeasuredHeight() * appScale + 0.5f), viewVisibility, insetsPending ? WindowManagerGlobal.RELAYOUT_INSETS_PENDING : 0, frameNumber, @@ -8440,17 +8437,6 @@ public final class ViewRootImpl implements ViewParent, mHandler.sendMessage(msg); } - // TODO(118118435): Remove this after migration - public void dispatchSystemUiVisibilityChanged(int seq, int globalVisibility, - int localValue, int localChanges) { - SystemUiVisibilityInfo args = new SystemUiVisibilityInfo(); - args.seq = seq; - args.globalVisibility = globalVisibility; - args.localValue = localValue; - args.localChanges = localChanges; - mHandler.sendMessage(mHandler.obtainMessage(MSG_DISPATCH_SYSTEM_UI_VISIBILITY, args)); - } - public void dispatchCheckFocus() { if (!mHandler.hasMessages(MSG_CHECK_FOCUS)) { // This will result in a call to checkFocus() below. @@ -9209,16 +9195,6 @@ public final class ViewRootImpl implements ViewParent, } @Override - public void dispatchSystemUiVisibilityChanged(int seq, int globalVisibility, - int localValue, int localChanges) { - final ViewRootImpl viewAncestor = mViewAncestor.get(); - if (viewAncestor != null) { - viewAncestor.dispatchSystemUiVisibilityChanged(seq, globalVisibility, - localValue, localChanges); - } - } - - @Override public void dispatchWindowShown() { final ViewRootImpl viewAncestor = mViewAncestor.get(); if (viewAncestor != null) { diff --git a/core/java/android/view/WindowlessWindowManager.java b/core/java/android/view/WindowlessWindowManager.java index b70cb015a275..dbd8184e57bb 100644 --- a/core/java/android/view/WindowlessWindowManager.java +++ b/core/java/android/view/WindowlessWindowManager.java @@ -129,7 +129,7 @@ public class WindowlessWindowManager implements IWindowSession { * IWindowSession implementation. */ @Override - public int addToDisplay(IWindow window, int seq, WindowManager.LayoutParams attrs, + public int addToDisplay(IWindow window, WindowManager.LayoutParams attrs, int viewVisibility, int displayId, Rect outFrame, Rect outContentInsets, Rect outStableInsets, DisplayCutout.ParcelableWrapper outDisplayCutout, InputChannel outInputChannel, @@ -165,18 +165,18 @@ public class WindowlessWindowManager implements IWindowSession { * IWindowSession implementation. Currently this class doesn't need to support for multi-user. */ @Override - public int addToDisplayAsUser(IWindow window, int seq, WindowManager.LayoutParams attrs, + public int addToDisplayAsUser(IWindow window, WindowManager.LayoutParams attrs, int viewVisibility, int displayId, int userId, Rect outFrame, Rect outContentInsets, Rect outStableInsets, DisplayCutout.ParcelableWrapper outDisplayCutout, InputChannel outInputChannel, InsetsState outInsetsState, InsetsSourceControl[] outActiveControls) { - return addToDisplay(window, seq, attrs, viewVisibility, displayId, + return addToDisplay(window, attrs, viewVisibility, displayId, outFrame, outContentInsets, outStableInsets, outDisplayCutout, outInputChannel, outInsetsState, outActiveControls); } @Override - public int addToDisplayWithoutInputChannel(android.view.IWindow window, int seq, + public int addToDisplayWithoutInputChannel(android.view.IWindow window, android.view.WindowManager.LayoutParams attrs, int viewVisibility, int layerStackId, android.graphics.Rect outContentInsets, android.graphics.Rect outStableInsets, android.view.InsetsState insetsState) { @@ -223,7 +223,7 @@ public class WindowlessWindowManager implements IWindowSession { } @Override - public int relayout(IWindow window, int seq, WindowManager.LayoutParams inAttrs, + public int relayout(IWindow window, WindowManager.LayoutParams inAttrs, int requestedWidth, int requestedHeight, int viewFlags, int flags, long frameNumber, ClientWindowFrames outFrames, MergedConfiguration mergedConfiguration, SurfaceControl outSurfaceControl, InsetsState outInsetsState, diff --git a/core/java/com/android/internal/view/BaseIWindow.java b/core/java/com/android/internal/view/BaseIWindow.java index d5f54a199828..fff9ac9e49b7 100644 --- a/core/java/com/android/internal/view/BaseIWindow.java +++ b/core/java/com/android/internal/view/BaseIWindow.java @@ -43,7 +43,6 @@ public class BaseIWindow extends IWindow.Stub { public BaseIWindow() {} private IWindowSession mSession; - public int mSeq; public void setSession(IWindowSession session) { mSession = session; @@ -140,12 +139,6 @@ public class BaseIWindow extends IWindow.Stub { } @Override - public void dispatchSystemUiVisibilityChanged(int seq, int globalUi, - int localValue, int localChanges) { - mSeq = seq; - } - - @Override public void dispatchWallpaperCommand(String action, int x, int y, int z, Bundle extras, boolean sync) { if (sync) { diff --git a/core/tests/coretests/src/android/view/InsetsFlagsTest.java b/core/tests/coretests/src/android/view/InsetsFlagsTest.java deleted file mode 100644 index b4302e79ed6a..000000000000 --- a/core/tests/coretests/src/android/view/InsetsFlagsTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2019 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.view; - - -import static android.view.InsetsFlags.getAppearance; -import static android.view.View.NAVIGATION_BAR_TRANSLUCENT; -import static android.view.View.NAVIGATION_BAR_TRANSPARENT; -import static android.view.View.STATUS_BAR_TRANSLUCENT; -import static android.view.View.STATUS_BAR_TRANSPARENT; -import static android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR; -import static android.view.View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; -import static android.view.View.SYSTEM_UI_FLAG_LOW_PROFILE; -import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS; -import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS; -import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS; -import static android.view.WindowInsetsController.APPEARANCE_OPAQUE_NAVIGATION_BARS; -import static android.view.WindowInsetsController.APPEARANCE_OPAQUE_STATUS_BARS; - -import static org.junit.Assert.assertTrue; - -import android.platform.test.annotations.Presubmit; -import android.view.WindowInsetsController.Appearance; - -import androidx.test.runner.AndroidJUnit4; - -import org.junit.Test; -import org.junit.runner.RunWith; - -/** - * Tests for {@link InsetsFlags}. - * - * <p>Build/Install/Run: - * atest FrameworksCoreTests:InsetsFlagsTest - * - * <p>This test class is a part of Window Manager Service tests and specified in - * {@link com.android.server.wm.test.filters.FrameworksTestsFilter}. - */ -@Presubmit -@RunWith(AndroidJUnit4.class) -public class InsetsFlagsTest { - - @Test - public void testGetAppearance() { - assertContainsAppearance(APPEARANCE_LOW_PROFILE_BARS, SYSTEM_UI_FLAG_LOW_PROFILE); - assertContainsAppearance(APPEARANCE_LIGHT_STATUS_BARS, SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); - assertContainsAppearance(APPEARANCE_LIGHT_NAVIGATION_BARS, - SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR); - assertContainsAppearance(APPEARANCE_OPAQUE_STATUS_BARS, - 0xffffffff & ~(STATUS_BAR_TRANSLUCENT | STATUS_BAR_TRANSPARENT)); - assertContainsAppearance(APPEARANCE_OPAQUE_NAVIGATION_BARS, - 0xffffffff & ~(NAVIGATION_BAR_TRANSLUCENT | NAVIGATION_BAR_TRANSPARENT)); - } - - void assertContainsAppearance(@Appearance int appearance, int systemUiVisibility) { - assertTrue((getAppearance(systemUiVisibility) & appearance) == appearance); - } -} diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/SystemWindows.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/SystemWindows.java index b4620e27e68c..84b98f9e8047 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/SystemWindows.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/SystemWindows.java @@ -271,14 +271,14 @@ public class SystemWindows { } @Override - public int relayout(IWindow window, int seq, WindowManager.LayoutParams attrs, + public int relayout(IWindow window, WindowManager.LayoutParams attrs, int requestedWidth, int requestedHeight, int viewVisibility, int flags, long frameNumber, ClientWindowFrames outFrames, MergedConfiguration mergedConfiguration, SurfaceControl outSurfaceControl, InsetsState outInsetsState, InsetsSourceControl[] outActiveControls, Point outSurfaceSize, SurfaceControl outBLASTSurfaceControl) { - int res = super.relayout(window, seq, attrs, requestedWidth, requestedHeight, + int res = super.relayout(window, attrs, requestedWidth, requestedHeight, viewVisibility, flags, frameNumber, outFrames, mergedConfiguration, outSurfaceControl, outInsetsState, outActiveControls, outSurfaceSize, outBLASTSurfaceControl); @@ -365,10 +365,6 @@ public class SystemWindows { public void updatePointerIcon(float x, float y) {} @Override - public void dispatchSystemUiVisibilityChanged(int seq, int globalVisibility, - int localValue, int localChanges) {} - - @Override public void dispatchWindowShown() {} @Override diff --git a/services/core/java/com/android/server/input/InputManagerService.java b/services/core/java/com/android/server/input/InputManagerService.java index 6c14b2cbed09..c6e6a94a17a7 100644 --- a/services/core/java/com/android/server/input/InputManagerService.java +++ b/services/core/java/com/android/server/input/InputManagerService.java @@ -233,7 +233,7 @@ public class InputManagerService extends IInputManager.Stub private static native void nativeToggleCapsLock(long ptr, int deviceId); private static native void nativeDisplayRemoved(long ptr, int displayId); private static native void nativeSetInputDispatchMode(long ptr, boolean enabled, boolean frozen); - private static native void nativeSetSystemUiVisibility(long ptr, int visibility); + private static native void nativeSetSystemUiLightsOut(long ptr, boolean lightsOut); private static native void nativeSetFocusedApplication(long ptr, int displayId, InputApplicationHandle application); private static native void nativeSetFocusedDisplay(long ptr, int displayId); @@ -1568,8 +1568,8 @@ public class InputManagerService extends IInputManager.Stub nativeSetInputDispatchMode(mPtr, enabled, frozen); } - public void setSystemUiVisibility(int visibility) { - nativeSetSystemUiVisibility(mPtr, visibility); + public void setSystemUiLightsOut(boolean lightsOut) { + nativeSetSystemUiLightsOut(mPtr, lightsOut); } /** diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 0044d7498614..18354caf80a5 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -191,7 +191,6 @@ import android.view.Surface; import android.view.SurfaceControl; import android.view.SurfaceControl.Transaction; import android.view.SurfaceSession; -import android.view.View; import android.view.WindowInsets; import android.view.WindowManager; import android.view.WindowManagerPolicyConstants.PointerEventListener; @@ -547,11 +546,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp private SurfaceControl mParentSurfaceControl; private InputWindowHandle mPortalWindowHandle; - // Last systemUiVisibility we received from status bar. - private int mLastStatusBarVisibility = 0; - // Last systemUiVisibility we dispatched to windows. - private int mLastDispatchedSystemUiVisibility = 0; - /** Corner radius that windows should have in order to match the display. */ private final float mWindowCornerRadius; @@ -2887,10 +2881,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp pw.print(" mLastFocus="); pw.println(mLastFocus); } pw.print(" mFocusedApp="); pw.println(mFocusedApp); - if (mLastStatusBarVisibility != 0) { - pw.print(" mLastStatusBarVisibility=0x"); - pw.println(Integer.toHexString(mLastStatusBarVisibility)); - } if (mFixedRotationLaunchingApp != null) { pw.println(" mFixedRotationLaunchingApp=" + mFixedRotationLaunchingApp); } @@ -3733,50 +3723,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp return win != null; } - void hideTransientBars() { - // TODO(b/118118435): Remove this after migration - final int transientFlags = View.STATUS_BAR_TRANSIENT | View.NAVIGATION_BAR_TRANSIENT; - statusBarVisibilityChanged(mLastStatusBarVisibility & ~transientFlags); - - getInsetsPolicy().hideTransient(); - } - - void statusBarVisibilityChanged(int visibility) { - mLastStatusBarVisibility = visibility; - updateStatusBarVisibilityLocked(visibility); - } - - private boolean updateStatusBarVisibilityLocked(int visibility) { - if (mLastDispatchedSystemUiVisibility == visibility) { - return false; - } - final int globalDiff = (visibility ^ mLastDispatchedSystemUiVisibility) - // We are only interested in differences of one of the - // clearable flags... - & View.SYSTEM_UI_CLEARABLE_FLAGS - // ...if it has actually been cleared. - & ~visibility; - - mLastDispatchedSystemUiVisibility = visibility; - if (isDefaultDisplay) { - mWmService.mInputManager.setSystemUiVisibility(visibility); - } - updateSystemUiVisibility(visibility, globalDiff); - return true; - } - - void updateSystemUiVisibility(int visibility, int globalDiff) { - forAllWindows(w -> { - final int curValue = w.mSystemUiVisibility; - final int diff = (curValue ^ visibility) & globalDiff; - final int newValue = (curValue & ~diff) | (visibility & diff); - if (newValue != curValue) { - w.mSeq++; - w.mSystemUiVisibility = newValue; - } - }, true /* traverseTopToBottom */); - } - void onWindowFreezeTimeout() { Slog.w(TAG_WM, "Window freeze timeout expired."); mWmService.mWindowsFreezingScreen = WINDOWS_FREEZING_SCREENS_TIMEOUT; diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java index 572c9b306047..fbaa7829e66b 100644 --- a/services/core/java/com/android/server/wm/DisplayPolicy.java +++ b/services/core/java/com/android/server/wm/DisplayPolicy.java @@ -41,6 +41,7 @@ import static android.view.InsetsState.ITYPE_TOP_GESTURES; import static android.view.InsetsState.ITYPE_TOP_TAPPABLE_ELEMENT; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS; +import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS; import static android.view.WindowInsetsController.APPEARANCE_OPAQUE_NAVIGATION_BARS; import static android.view.WindowInsetsController.APPEARANCE_OPAQUE_STATUS_BARS; import static android.view.WindowInsetsController.BEHAVIOR_SHOW_BARS_BY_SWIPE; @@ -154,6 +155,7 @@ import android.view.MotionEvent; import android.view.PointerIcon; import android.view.Surface; import android.view.View; +import android.view.ViewDebug; import android.view.WindowInsets.Side; import android.view.WindowInsets.Side.InsetsSide; import android.view.WindowInsets.Type; @@ -1393,9 +1395,9 @@ public class DisplayPolicy { boolean getLayoutHint(LayoutParams attrs, WindowToken windowToken, Rect outFrame, Rect outContentInsets, Rect outStableInsets, DisplayCutout.ParcelableWrapper outDisplayCutout) { - final int fl = PolicyControl.getWindowFlags(null, attrs); + final int fl = attrs.flags; final int pfl = attrs.privateFlags; - final int sysUiVis = PolicyControl.getSystemUiVisibility(null, attrs); + final int sysUiVis = attrs.systemUiVisibility | attrs.subtreeSystemUiVisibility; final boolean layoutInScreen = (fl & FLAG_LAYOUT_IN_SCREEN) != 0; final boolean layoutInScreenAndInsetDecor = layoutInScreen @@ -1949,7 +1951,7 @@ public class DisplayPolicy { final WindowManager.LayoutParams attrs = win.getAttrs(); final int type = attrs.type; - final int fl = PolicyControl.getWindowFlags(win, attrs); + final int fl = attrs.flags; final int pfl = attrs.privateFlags; final int sim = attrs.softInputMode; @@ -2191,7 +2193,7 @@ public class DisplayPolicy { final boolean affectsSystemUi = win.canAffectSystemUiFlags(); if (DEBUG_LAYOUT) Slog.i(TAG, "Win " + win + ": affectsSystemUi=" + affectsSystemUi); mService.mPolicy.applyKeyguardPolicyLw(win, imeTarget); - final int fl = PolicyControl.getWindowFlags(win, attrs); + final int fl = attrs.flags; if (mTopFullscreenOpaqueWindowState == null && affectsSystemUi && attrs.type == TYPE_INPUT_METHOD) { mForcingShowNavBar = true; @@ -2366,8 +2368,7 @@ public class DisplayPolicy { return false; } final LayoutParams attrs = mTopFullscreenOpaqueWindowState.getAttrs(); - final int fl = PolicyControl.getWindowFlags(null, attrs); - final int sysui = PolicyControl.getSystemUiVisibility(null, attrs); + final int fl = attrs.flags; final InsetsSource request = mTopFullscreenOpaqueWindowState.getRequestedInsetsState() .peekSource(ITYPE_STATUS_BAR); if (WindowManagerDebugConfig.DEBUG) { @@ -2891,9 +2892,9 @@ public class DisplayPolicy { mDisplayContent.getInsetsPolicy().updateBarControlTarget(win); - final int fullscreenAppearance = updateLightStatusBarLw(0 /* vis */, + final int fullscreenAppearance = updateLightStatusBarLw(0 /* appearance */, mTopFullscreenOpaqueWindowState, mTopFullscreenOpaqueOrDimmingWindowState); - final int dockedAppearance = updateLightStatusBarLw(0 /* vis */, + final int dockedAppearance = updateLightStatusBarLw(0 /* appearance */, mTopDockedOpaqueWindowState, mTopDockedOpaqueOrDimmingWindowState); final boolean inSplitScreen = mService.mRoot.getDefaultTaskDisplayArea().isSplitScreenModeActivated(); @@ -2964,6 +2965,10 @@ public class DisplayPolicy { } }); + if (mDisplayContent.isDefaultDisplay) { + mService.mInputManager.setSystemUiLightsOut( + isFullscreen || (appearance & APPEARANCE_LOW_PROFILE_BARS) != 0); + } return true; } @@ -2976,9 +2981,7 @@ public class DisplayPolicy { // If the top fullscreen-or-dimming window is also the top fullscreen, respect // its light flag. appearance &= ~APPEARANCE_LIGHT_STATUS_BARS; - final int legacyAppearance = InsetsFlags.getAppearance( - PolicyControl.getSystemUiVisibility(statusColorWin, null)); - appearance |= (statusColorWin.mAttrs.insetsFlags.appearance | legacyAppearance) + appearance |= statusColorWin.mAttrs.insetsFlags.appearance & APPEARANCE_LIGHT_STATUS_BARS; } else if (statusColorWin.isDimming()) { // Otherwise if it's dimming, clear the light flag. @@ -3001,8 +3004,8 @@ public class DisplayPolicy { final boolean imeWindowCanNavColorWindow = imeWindow != null && imeWindow.isVisibleLw() && navBarPosition == NAV_BAR_BOTTOM - && (PolicyControl.getWindowFlags(imeWindow, null) - & WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0; + && (imeWindow.mAttrs.flags + & WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0; if (opaque != null && opaqueOrDimming == opaque) { // If the top fullscreen-or-dimming window is also the top fullscreen, respect it @@ -3024,7 +3027,7 @@ public class DisplayPolicy { // The IME window and the dimming window are competing. Check if the dimming window can be // IME target or not. - if (LayoutParams.mayUseInputMethod(PolicyControl.getWindowFlags(opaqueOrDimming, null))) { + if (LayoutParams.mayUseInputMethod(opaqueOrDimming.mAttrs.flags)) { // The IME window is above the dimming window. return imeWindow; } else { @@ -3298,22 +3301,30 @@ public class DisplayPolicy { pw.print(prefix); pw.print("mHdmiPlugged="); pw.println(mHdmiPlugged); if (mLastDisableFlags != 0) { pw.print(prefix); pw.print("mLastDisableFlags=0x"); - pw.print(Integer.toHexString(mLastDisableFlags)); + pw.println(Integer.toHexString(mLastDisableFlags)); + } + if (mLastAppearance != 0) { + pw.print(prefix); pw.print("mLastAppearance="); + pw.println(ViewDebug.flagsToString(InsetsFlags.class, "appearance", mLastAppearance)); + } + if (mLastBehavior != 0) { + pw.print(prefix); pw.print("mLastBehavior="); + pw.println(ViewDebug.flagsToString(InsetsFlags.class, "behavior", mLastBehavior)); } pw.print(prefix); pw.print("mShowingDream="); pw.print(mShowingDream); - pw.print(" mDreamingLockscreen="); pw.print(mDreamingLockscreen); + pw.print(" mDreamingLockscreen="); pw.println(mDreamingLockscreen); if (mStatusBar != null) { - pw.print(prefix); pw.print("mStatusBar="); pw.print(mStatusBar); + pw.print(prefix); pw.print("mStatusBar="); pw.println(mStatusBar); } if (mStatusBarAlt != null) { - pw.print(prefix); pw.print("mStatusBarAlt="); pw.print(mStatusBarAlt); + pw.print(prefix); pw.print("mStatusBarAlt="); pw.println(mStatusBarAlt); pw.print(prefix); pw.print("mStatusBarAltPosition="); pw.println(mStatusBarAltPosition); } if (mNotificationShade != null) { - pw.print(prefix); pw.print("mExpandedPanel="); pw.print(mNotificationShade); + pw.print(prefix); pw.print("mExpandedPanel="); pw.println(mNotificationShade); } - pw.print(" isKeyguardShowing="); pw.println(isKeyguardShowing()); + pw.print(prefix); pw.print("isKeyguardShowing="); pw.println(isKeyguardShowing()); if (mNavigationBar != null) { pw.print(prefix); pw.print("mNavigationBar="); pw.println(mNavigationBar); pw.print(prefix); pw.print("mNavBarOpacityMode="); pw.println(mNavBarOpacityMode); @@ -3344,9 +3355,9 @@ public class DisplayPolicy { } pw.print(prefix); pw.print("mTopIsFullscreen="); pw.println(mTopIsFullscreen); pw.print(prefix); pw.print("mForceStatusBar="); pw.print(mForceStatusBar); - pw.print(prefix); pw.print("mRemoteInsetsControllerControlsSystemBars"); - pw.print(mDisplayContent.getInsetsPolicy().getRemoteInsetsControllerControlsSystemBars()); pw.print(" mAllowLockscreenWhenOn="); pw.println(mAllowLockscreenWhenOn); + pw.print(prefix); pw.print("mRemoteInsetsControllerControlsSystemBars="); + pw.println(mDisplayContent.getInsetsPolicy().getRemoteInsetsControllerControlsSystemBars()); pw.print(prefix); pw.println("Looper state:"); mHandler.getLooper().dump(new PrintWriterPrinter(pw), prefix + " "); diff --git a/services/core/java/com/android/server/wm/ImmersiveModeConfirmation.java b/services/core/java/com/android/server/wm/ImmersiveModeConfirmation.java index 8b1a0c93cfa3..02dad3978d42 100644 --- a/services/core/java/com/android/server/wm/ImmersiveModeConfirmation.java +++ b/services/core/java/com/android/server/wm/ImmersiveModeConfirmation.java @@ -28,6 +28,7 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; +import android.graphics.Insets; import android.graphics.PixelFormat; import android.graphics.drawable.ColorDrawable; import android.os.Binder; @@ -46,6 +47,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; +import android.view.WindowInsets; import android.view.WindowInsets.Type; import android.view.WindowManager; import android.view.animation.Animation; @@ -134,11 +136,8 @@ public class ImmersiveModeConfirmation { boolean userSetupComplete, boolean navBarEmpty) { mHandler.removeMessages(H.SHOW); if (isImmersiveMode) { - final boolean disabled = PolicyControl.disableImmersiveConfirmation(pkg); - if (DEBUG) Slog.d(TAG, String.format("immersiveModeChanged() disabled=%s sConfirmed=%s", - disabled, sConfirmed)); - if (!disabled - && (DEBUG_SHOW_EVERY_TIME || !sConfirmed) + if (DEBUG) Slog.d(TAG, "immersiveModeChanged() sConfirmed=" + sConfirmed); + if ((DEBUG_SHOW_EVERY_TIME || !sConfirmed) && userSetupComplete && !mVrModeEnabled && !navBarEmpty @@ -339,6 +338,13 @@ public class ImmersiveModeConfirmation { public boolean onTouchEvent(MotionEvent motion) { return true; } + + @Override + public WindowInsets onApplyWindowInsets(WindowInsets insets) { + // we will be hiding the nav bar, so layout as if it's already hidden + return new WindowInsets.Builder(insets).setInsets( + Type.systemBars(), Insets.NONE).build(); + } } /** @@ -359,10 +365,6 @@ public class ImmersiveModeConfirmation { mClingWindow = new ClingWindowView(mContext, mConfirm); - // we will be hiding the nav bar, so layout as if it's already hidden - mClingWindow.setSystemUiVisibility( - View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); - // show the confirmation WindowManager.LayoutParams lp = getClingWindowLayoutParams(); getWindowManager().addView(mClingWindow, lp); diff --git a/services/core/java/com/android/server/wm/PolicyControl.java b/services/core/java/com/android/server/wm/PolicyControl.java deleted file mode 100644 index 61b6e0b25961..000000000000 --- a/services/core/java/com/android/server/wm/PolicyControl.java +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Copyright (C) 2018 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.server.wm; - -import android.app.ActivityManager; -import android.content.Context; -import android.os.UserHandle; -import android.provider.Settings; -import android.util.ArraySet; -import android.util.Slog; -import android.view.View; -import android.view.WindowManager; -import android.view.WindowManager.LayoutParams; - -import com.android.internal.annotations.VisibleForTesting; - -import java.io.PrintWriter; -import java.io.StringWriter; - -/** - * Runtime adjustments applied to the global window policy. - * - * This includes forcing immersive mode behavior for one or both system bars (based on a package - * list) and permanently disabling immersive mode confirmations for specific packages. - * - * Control by setting {@link Settings.Global#POLICY_CONTROL} to one or more name-value pairs. - * e.g. - * to force immersive mode everywhere: - * "immersive.full=*" - * to force transient status for all apps except a specific package: - * "immersive.status=apps,-com.package" - * to disable the immersive mode confirmations for specific packages: - * "immersive.preconfirms=com.package.one,com.package.two" - * - * Separate multiple name-value pairs with ':' - * e.g. "immersive.status=apps:immersive.preconfirms=*" - */ -class PolicyControl { - private static final String TAG = "PolicyControl"; - private static final boolean DEBUG = false; - - @VisibleForTesting - static final String NAME_IMMERSIVE_FULL = "immersive.full"; - private static final String NAME_IMMERSIVE_STATUS = "immersive.status"; - private static final String NAME_IMMERSIVE_NAVIGATION = "immersive.navigation"; - private static final String NAME_IMMERSIVE_PRECONFIRMATIONS = "immersive.preconfirms"; - - private static String sSettingValue; - private static Filter sImmersivePreconfirmationsFilter; - private static Filter sImmersiveStatusFilter; - private static Filter sImmersiveNavigationFilter; - - static int getSystemUiVisibility(WindowState win, LayoutParams attrs) { - attrs = attrs != null ? attrs : win.getAttrs(); - int vis = win != null ? win.getSystemUiVisibility() - : (attrs.systemUiVisibility | attrs.subtreeSystemUiVisibility); - if (sImmersiveStatusFilter != null && sImmersiveStatusFilter.matches(attrs)) { - vis |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY - | View.SYSTEM_UI_FLAG_FULLSCREEN; - if (attrs.isFullscreen()) { - vis |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; - } - vis &= ~(View.SYSTEM_UI_FLAG_LAYOUT_STABLE - | View.STATUS_BAR_TRANSLUCENT); - } - if (sImmersiveNavigationFilter != null && sImmersiveNavigationFilter.matches(attrs)) { - vis |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY - | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; - if (attrs.isFullscreen()) { - vis |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION; - } - vis &= ~(View.SYSTEM_UI_FLAG_LAYOUT_STABLE - | View.NAVIGATION_BAR_TRANSLUCENT); - } - return vis; - } - - static int getWindowFlags(WindowState win, LayoutParams attrs) { - attrs = attrs != null ? attrs : win.getAttrs(); - int flags = attrs.flags; - if (sImmersiveStatusFilter != null && sImmersiveStatusFilter.matches(attrs)) { - flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN; - flags &= ~(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS - | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); - } - if (sImmersiveNavigationFilter != null && sImmersiveNavigationFilter.matches(attrs)) { - flags &= ~WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION; - } - return flags; - } - - static int adjustClearableFlags(WindowState win, int clearableFlags) { - final LayoutParams attrs = win != null ? win.getAttrs() : null; - if (sImmersiveStatusFilter != null && sImmersiveStatusFilter.matches(attrs)) { - clearableFlags &= ~View.SYSTEM_UI_FLAG_FULLSCREEN; - } - return clearableFlags; - } - - static boolean disableImmersiveConfirmation(String pkg) { - return (sImmersivePreconfirmationsFilter != null - && sImmersivePreconfirmationsFilter.matches(pkg)) - || ActivityManager.isRunningInTestHarness(); - } - - static boolean reloadFromSetting(Context context) { - if (DEBUG) Slog.d(TAG, "reloadFromSetting()"); - String value = null; - try { - value = Settings.Global.getStringForUser(context.getContentResolver(), - Settings.Global.POLICY_CONTROL, - UserHandle.USER_CURRENT); - if (sSettingValue == value || sSettingValue != null && sSettingValue.equals(value)) { - return false; - } - setFilters(value); - sSettingValue = value; - } catch (Throwable t) { - Slog.w(TAG, "Error loading policy control, value=" + value, t); - return false; - } - return true; - } - - static void dump(String prefix, PrintWriter pw) { - dump("sImmersiveStatusFilter", sImmersiveStatusFilter, prefix, pw); - dump("sImmersiveNavigationFilter", sImmersiveNavigationFilter, prefix, pw); - dump("sImmersivePreconfirmationsFilter", sImmersivePreconfirmationsFilter, prefix, pw); - } - - private static void dump(String name, Filter filter, String prefix, PrintWriter pw) { - pw.print(prefix); pw.print("PolicyControl."); pw.print(name); pw.print('='); - if (filter == null) { - pw.println("null"); - } else { - filter.dump(pw); pw.println(); - } - } - - @VisibleForTesting - static void setFilters(String value) { - if (DEBUG) Slog.d(TAG, "setFilters: " + value); - sImmersiveStatusFilter = null; - sImmersiveNavigationFilter = null; - sImmersivePreconfirmationsFilter = null; - if (value != null) { - String[] nvps = value.split(":"); - for (String nvp : nvps) { - int i = nvp.indexOf('='); - if (i == -1) continue; - String n = nvp.substring(0, i); - String v = nvp.substring(i + 1); - if (n.equals(NAME_IMMERSIVE_FULL)) { - Filter f = Filter.parse(v); - sImmersiveStatusFilter = sImmersiveNavigationFilter = f; - if (sImmersivePreconfirmationsFilter == null) { - sImmersivePreconfirmationsFilter = f; - } - } else if (n.equals(NAME_IMMERSIVE_STATUS)) { - Filter f = Filter.parse(v); - sImmersiveStatusFilter = f; - } else if (n.equals(NAME_IMMERSIVE_NAVIGATION)) { - Filter f = Filter.parse(v); - sImmersiveNavigationFilter = f; - if (sImmersivePreconfirmationsFilter == null) { - sImmersivePreconfirmationsFilter = f; - } - } else if (n.equals(NAME_IMMERSIVE_PRECONFIRMATIONS)) { - Filter f = Filter.parse(v); - sImmersivePreconfirmationsFilter = f; - } - } - } - if (DEBUG) { - Slog.d(TAG, "immersiveStatusFilter: " + sImmersiveStatusFilter); - Slog.d(TAG, "immersiveNavigationFilter: " + sImmersiveNavigationFilter); - Slog.d(TAG, "immersivePreconfirmationsFilter: " + sImmersivePreconfirmationsFilter); - } - } - - private static class Filter { - private static final String ALL = "*"; - private static final String APPS = "apps"; - - private final ArraySet<String> mAllowlist; - private final ArraySet<String> mDenylist; - - private Filter(ArraySet<String> allowlist, ArraySet<String> denylist) { - mAllowlist = allowlist; - mDenylist = denylist; - } - - boolean matches(LayoutParams attrs) { - if (attrs == null) return false; - boolean isApp = attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW - && attrs.type <= WindowManager.LayoutParams.LAST_APPLICATION_WINDOW; - if (isApp && mDenylist.contains(APPS)) return false; - if (onDenylist(attrs.packageName)) return false; - if (isApp && mAllowlist.contains(APPS)) return true; - return onAllowlist(attrs.packageName); - } - - boolean matches(String packageName) { - return !onDenylist(packageName) && onAllowlist(packageName); - } - - private boolean onDenylist(String packageName) { - return mDenylist.contains(packageName) || mDenylist.contains(ALL); - } - - private boolean onAllowlist(String packageName) { - return mAllowlist.contains(ALL) || mAllowlist.contains(packageName); - } - - void dump(PrintWriter pw) { - pw.print("Filter["); - dump("allowlist", mAllowlist, pw); pw.print(','); - dump("denylist", mDenylist, pw); pw.print(']'); - } - - private void dump(String name, ArraySet<String> set, PrintWriter pw) { - pw.print(name); pw.print("=("); - final int n = set.size(); - for (int i = 0; i < n; i++) { - if (i > 0) pw.print(','); - pw.print(set.valueAt(i)); - } - pw.print(')'); - } - - @Override - public String toString() { - StringWriter sw = new StringWriter(); - dump(new PrintWriter(sw, true)); - return sw.toString(); - } - - // value = comma-delimited list of tokens, where token = (package name|apps|*) - // e.g. "com.package1", or "apps, com.android.keyguard" or "*" - static Filter parse(String value) { - if (value == null) return null; - ArraySet<String> allowlist = new ArraySet<String>(); - ArraySet<String> denylist = new ArraySet<String>(); - for (String token : value.split(",")) { - token = token.trim(); - if (token.startsWith("-") && token.length() > 1) { - token = token.substring(1); - denylist.add(token); - } else { - allowlist.add(token); - } - } - return new Filter(allowlist, denylist); - } - } -} diff --git a/services/core/java/com/android/server/wm/Session.java b/services/core/java/com/android/server/wm/Session.java index 5f2113afa5b2..9ff99f5093d6 100644 --- a/services/core/java/com/android/server/wm/Session.java +++ b/services/core/java/com/android/server/wm/Session.java @@ -157,33 +157,33 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient { } @Override - public int addToDisplay(IWindow window, int seq, WindowManager.LayoutParams attrs, + public int addToDisplay(IWindow window, WindowManager.LayoutParams attrs, int viewVisibility, int displayId, Rect outFrame, Rect outContentInsets, Rect outStableInsets, DisplayCutout.ParcelableWrapper outDisplayCutout, InputChannel outInputChannel, InsetsState outInsetsState, InsetsSourceControl[] outActiveControls) { - return mService.addWindow(this, window, seq, attrs, viewVisibility, displayId, outFrame, + return mService.addWindow(this, window, attrs, viewVisibility, displayId, outFrame, outContentInsets, outStableInsets, outDisplayCutout, outInputChannel, outInsetsState, outActiveControls, UserHandle.getUserId(mUid)); } @Override - public int addToDisplayAsUser(IWindow window, int seq, WindowManager.LayoutParams attrs, + public int addToDisplayAsUser(IWindow window, WindowManager.LayoutParams attrs, int viewVisibility, int displayId, int userId, Rect outFrame, Rect outContentInsets, Rect outStableInsets, DisplayCutout.ParcelableWrapper outDisplayCutout, InputChannel outInputChannel, InsetsState outInsetsState, InsetsSourceControl[] outActiveControls) { - return mService.addWindow(this, window, seq, attrs, viewVisibility, displayId, outFrame, + return mService.addWindow(this, window, attrs, viewVisibility, displayId, outFrame, outContentInsets, outStableInsets, outDisplayCutout, outInputChannel, outInsetsState, outActiveControls, userId); } @Override - public int addToDisplayWithoutInputChannel(IWindow window, int seq, WindowManager.LayoutParams attrs, + public int addToDisplayWithoutInputChannel(IWindow window, WindowManager.LayoutParams attrs, int viewVisibility, int displayId, Rect outContentInsets, Rect outStableInsets, InsetsState outInsetsState) { - return mService.addWindow(this, window, seq, attrs, viewVisibility, displayId, + return mService.addWindow(this, window, attrs, viewVisibility, displayId, new Rect() /* outFrame */, outContentInsets, outStableInsets, new DisplayCutout.ParcelableWrapper() /* cutout */, null /* outInputChannel */, outInsetsState, mDummyControls, UserHandle.getUserId(mUid)); @@ -200,7 +200,7 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient { } @Override - public int relayout(IWindow window, int seq, WindowManager.LayoutParams attrs, + public int relayout(IWindow window, WindowManager.LayoutParams attrs, int requestedWidth, int requestedHeight, int viewFlags, int flags, long frameNumber, ClientWindowFrames outFrames, MergedConfiguration mergedConfiguration, SurfaceControl outSurfaceControl, InsetsState outInsetsState, @@ -209,7 +209,7 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient { if (false) Slog.d(TAG_WM, ">>>>>> ENTERED relayout from " + Binder.getCallingPid()); Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, mRelayoutTag); - int res = mService.relayoutWindow(this, window, seq, attrs, + int res = mService.relayoutWindow(this, window, attrs, requestedWidth, requestedHeight, viewFlags, flags, frameNumber, outFrames, mergedConfiguration, outSurfaceControl, outInsetsState, outActiveControls, outSurfaceSize, outBLASTSurfaceControl); diff --git a/services/core/java/com/android/server/wm/TaskSnapshotSurface.java b/services/core/java/com/android/server/wm/TaskSnapshotSurface.java index c4ca989e9d6b..20e2b28990a1 100644 --- a/services/core/java/com/android/server/wm/TaskSnapshotSurface.java +++ b/services/core/java/com/android/server/wm/TaskSnapshotSurface.java @@ -245,7 +245,7 @@ class TaskSnapshotSurface implements StartingSurface { mergeInsetsSources(insetsState, topFullscreenOpaqueWindow.getRequestedInsetsState()); } try { - final int res = session.addToDisplay(window, window.mSeq, layoutParams, + final int res = session.addToDisplay(window, layoutParams, View.GONE, activity.getDisplayContent().getDisplayId(), tmpFrames.frame, tmpFrames.contentInsets, tmpFrames.stableInsets, tmpFrames.displayCutout, null /* outInputChannel */, mTmpInsetsState, mTempControls); @@ -262,7 +262,7 @@ class TaskSnapshotSurface implements StartingSurface { insetsState); window.setOuter(snapshotSurface); try { - session.relayout(window, window.mSeq, layoutParams, -1, -1, View.VISIBLE, 0, -1, + session.relayout(window, layoutParams, -1, -1, View.VISIBLE, 0, -1, tmpFrames, tmpMergedConfiguration, surfaceControl, mTmpInsetsState, mTempControls, sTmpSurfaceSize, sTmpSurfaceControl); } catch (RemoteException e) { diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 8c2619d75201..0b970d3ccc91 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -864,8 +864,7 @@ public class WindowManagerService extends IWindowManager.Stub void updateSystemUiSettings() { boolean changed; synchronized (mGlobalLock) { - changed = ImmersiveModeConfirmation.loadSetting(mCurrentUserId, mContext) - || PolicyControl.reloadFromSetting(mContext); + changed = ImmersiveModeConfirmation.loadSetting(mCurrentUserId, mContext); } if (changed) { updateRotation(false /* alwaysSendConfiguration */, false /* forceRelayout */); @@ -1374,9 +1373,8 @@ public class WindowManagerService extends IWindowManager.Stub return false; } - public int addWindow(Session session, IWindow client, int seq, - LayoutParams attrs, int viewVisibility, int displayId, Rect outFrame, - Rect outContentInsets, Rect outStableInsets, + public int addWindow(Session session, IWindow client, LayoutParams attrs, int viewVisibility, + int displayId, Rect outFrame, Rect outContentInsets, Rect outStableInsets, DisplayCutout.ParcelableWrapper outDisplayCutout, InputChannel outInputChannel, InsetsState outInsetsState, InsetsSourceControl[] outActiveControls, int requestUserId) { @@ -1557,7 +1555,7 @@ public class WindowManagerService extends IWindowManager.Stub } final WindowState win = new WindowState(this, session, client, token, parentWindow, - appOp[0], seq, attrs, viewVisibility, session.mUid, userId, + appOp[0], attrs, viewVisibility, session.mUid, userId, session.mCanAddInternalSystemWindow); if (win.mDeathRecipient == null) { // Client has apparently died, so there is no reason to @@ -2099,7 +2097,7 @@ public class WindowManagerService extends IWindowManager.Stub == PackageManager.PERMISSION_GRANTED; } - public int relayoutWindow(Session session, IWindow client, int seq, LayoutParams attrs, + public int relayoutWindow(Session session, IWindow client, LayoutParams attrs, int requestedWidth, int requestedHeight, int viewVisibility, int flags, long frameNumber, ClientWindowFrames outFrames, MergedConfiguration mergedConfiguration, SurfaceControl outSurfaceControl, InsetsState outInsetsState, @@ -2141,17 +2139,15 @@ public class WindowManagerService extends IWindowManager.Stub if (attrs != null) { displayPolicy.adjustWindowParamsLw(win, attrs, pid, uid); win.mToken.adjustWindowParams(win, attrs); - // if they don't have the permission, mask out the status bar bits - if (seq == win.mSeq) { - int systemUiVisibility = attrs.systemUiVisibility - | attrs.subtreeSystemUiVisibility; - if ((systemUiVisibility & DISABLE_MASK) != 0) { - if (!hasStatusBarPermission(pid, uid)) { - systemUiVisibility &= ~DISABLE_MASK; - } + int systemUiVisibility = attrs.systemUiVisibility + | attrs.subtreeSystemUiVisibility; + if ((systemUiVisibility & DISABLE_MASK) != 0) { + // if they don't have the permission, mask out the status bar bits + if (!hasStatusBarPermission(pid, uid)) { + systemUiVisibility &= ~DISABLE_MASK; } - win.mSystemUiVisibility = systemUiVisibility; } + win.mSystemUiVisibility = systemUiVisibility; if (win.mAttrs.type != attrs.type) { throw new IllegalArgumentException( "Window type can not be changed after the window is added."); @@ -5731,31 +5727,13 @@ public class WindowManagerService extends IWindowManager.Stub } @Override - public void statusBarVisibilityChanged(int displayId, int visibility) { - if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR) - != PackageManager.PERMISSION_GRANTED) { - throw new SecurityException("Caller does not hold permission " - + android.Manifest.permission.STATUS_BAR); - } - - synchronized (mGlobalLock) { - final DisplayContent displayContent = mRoot.getDisplayContent(displayId); - if (displayContent != null) { - displayContent.statusBarVisibilityChanged(visibility); - } else { - Slog.w(TAG, "statusBarVisibilityChanged with invalid displayId=" + displayId); - } - } - } - - @Override public void hideTransientBars(int displayId) { mAtmInternal.enforceCallerIsRecentsOrHasPermission(android.Manifest.permission.STATUS_BAR, "hideTransientBars()"); synchronized (mGlobalLock) { final DisplayContent displayContent = mRoot.getDisplayContent(displayId); if (displayContent != null) { - displayContent.hideTransientBars(); + displayContent.getInsetsPolicy().hideTransient(); } else { Slog.w(TAG, "hideTransientBars with invalid displayId=" + displayId); } @@ -6164,7 +6142,6 @@ public class WindowManagerService extends IWindowManager.Stub pw.print(" mRecentsAnimationController="); pw.println(mRecentsAnimationController); mRecentsAnimationController.dump(pw, " "); } - PolicyControl.dump(" ", pw); } } diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index f2f3cefae8a5..83811e6809a5 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -302,7 +302,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP final boolean mIsImWindow; final boolean mIsWallpaper; private final boolean mIsFloatingLayer; - int mSeq; int mViewVisibility; int mSystemUiVisibility; @@ -835,10 +834,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP } WindowState(WindowManagerService service, Session s, IWindow c, WindowToken token, - WindowState parentWindow, int appOp, int seq, WindowManager.LayoutParams a, - int viewVisibility, int ownerId, int showUserId, - boolean ownerCanAddInternalSystemWindow) { - this(service, s, c, token, parentWindow, appOp, seq, a, viewVisibility, ownerId, showUserId, + WindowState parentWindow, int appOp, WindowManager.LayoutParams a, int viewVisibility, + int ownerId, int showUserId, boolean ownerCanAddInternalSystemWindow) { + this(service, s, c, token, parentWindow, appOp, a, viewVisibility, ownerId, showUserId, ownerCanAddInternalSystemWindow, new PowerManagerWrapper() { @Override public void wakeUp(long time, @WakeReason int reason, String details) { @@ -853,9 +851,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP } WindowState(WindowManagerService service, Session s, IWindow c, WindowToken token, - WindowState parentWindow, int appOp, int seq, WindowManager.LayoutParams a, - int viewVisibility, int ownerId, int showUserId, - boolean ownerCanAddInternalSystemWindow, PowerManagerWrapper powerManagerWrapper) { + WindowState parentWindow, int appOp, WindowManager.LayoutParams a, int viewVisibility, + int ownerId, int showUserId, boolean ownerCanAddInternalSystemWindow, + PowerManagerWrapper powerManagerWrapper) { super(service); mSession = s; mClient = c; @@ -872,7 +870,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP mPolicy = mWmService.mPolicy; mContext = mWmService.mContext; DeathRecipient deathRecipient = new DeathRecipient(); - mSeq = seq; mPowerManagerWrapper = powerManagerWrapper; mForceSeamlesslyRotate = token.mRoundedCornerOverlay; if (DEBUG) { @@ -4037,7 +4034,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP pw.println(prefix + "mViewVisibility=0x" + Integer.toHexString(mViewVisibility) + " mHaveFrame=" + mHaveFrame + " mObscured=" + mObscured); - pw.println(prefix + "mSeq=" + mSeq + pw.println(prefix + " mSystemUiVisibility=0x" + Integer.toHexString(mSystemUiVisibility)); } if (!isVisibleByPolicy() || !mLegacyPolicyVisibilityAfterAnim || !mAppOpVisibility diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp index 46136ca0647d..06fc9af46b5a 100644 --- a/services/core/jni/com_android_server_input_InputManagerService.cpp +++ b/services/core/jni/com_android_server_input_InputManagerService.cpp @@ -216,7 +216,7 @@ public: void setFocusedApplication(JNIEnv* env, int32_t displayId, jobject applicationHandleObj); void setFocusedDisplay(JNIEnv* env, int32_t displayId); void setInputDispatchMode(bool enabled, bool frozen); - void setSystemUiVisibility(int32_t visibility); + void setSystemUiLightsOut(bool lightsOut); void setPointerSpeed(int32_t speed); void setInputDeviceEnabled(uint32_t deviceId, bool enabled); void setShowTouches(bool enabled); @@ -284,8 +284,8 @@ private: // Display size information. std::vector<DisplayViewport> viewports; - // System UI visibility. - int32_t systemUiVisibility; + // True if System UI is less noticeable. + bool systemUiLightsOut; // Pointer speed. int32_t pointerSpeed; @@ -337,7 +337,7 @@ NativeInputManager::NativeInputManager(jobject contextObj, { AutoMutex _l(mLock); - mLocked.systemUiVisibility = ASYSTEM_UI_VISIBILITY_STATUS_BAR_VISIBLE; + mLocked.systemUiLightsOut = false; mLocked.pointerSpeed = 0; mLocked.pointerGesturesEnabled = true; mLocked.showTouches = false; @@ -364,8 +364,8 @@ void NativeInputManager::dump(std::string& dump) { } { AutoMutex _l(mLock); - dump += StringPrintf(INDENT "System UI Visibility: 0x%0" PRIx32 "\n", - mLocked.systemUiVisibility); + dump += StringPrintf(INDENT "System UI Lights Out: %s\n", + toString(mLocked.systemUiLightsOut)); dump += StringPrintf(INDENT "Pointer Speed: %" PRId32 "\n", mLocked.pointerSpeed); dump += StringPrintf(INDENT "Pointer Gestures Enabled: %s\n", toString(mLocked.pointerGesturesEnabled)); @@ -811,11 +811,11 @@ void NativeInputManager::setInputDispatchMode(bool enabled, bool frozen) { mInputManager->getDispatcher()->setInputDispatchMode(enabled, frozen); } -void NativeInputManager::setSystemUiVisibility(int32_t visibility) { +void NativeInputManager::setSystemUiLightsOut(bool lightsOut) { AutoMutex _l(mLock); - if (mLocked.systemUiVisibility != visibility) { - mLocked.systemUiVisibility = visibility; + if (mLocked.systemUiLightsOut != lightsOut) { + mLocked.systemUiLightsOut = lightsOut; updateInactivityTimeoutLocked(); } } @@ -826,9 +826,8 @@ void NativeInputManager::updateInactivityTimeoutLocked() REQUIRES(mLock) { return; } - bool lightsOut = mLocked.systemUiVisibility & ASYSTEM_UI_VISIBILITY_STATUS_BAR_HIDDEN; - controller->setInactivityTimeout(lightsOut ? InactivityTimeout::SHORT - : InactivityTimeout::NORMAL); + controller->setInactivityTimeout(mLocked.systemUiLightsOut ? InactivityTimeout::SHORT + : InactivityTimeout::NORMAL); } void NativeInputManager::setPointerSpeed(int32_t speed) { @@ -1575,11 +1574,11 @@ static void nativeSetInputDispatchMode(JNIEnv* /* env */, im->setInputDispatchMode(enabled, frozen); } -static void nativeSetSystemUiVisibility(JNIEnv* /* env */, - jclass /* clazz */, jlong ptr, jint visibility) { +static void nativeSetSystemUiLightsOut(JNIEnv* /* env */, jclass /* clazz */, jlong ptr, + jboolean lightsOut) { NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr); - im->setSystemUiVisibility(visibility); + im->setSystemUiLightsOut(lightsOut); } static jboolean nativeTransferTouchFocus(JNIEnv* env, @@ -1800,7 +1799,7 @@ static const JNINativeMethod gInputManagerMethods[] = { {"nativeSetFocusedDisplay", "(JI)V", (void*)nativeSetFocusedDisplay}, {"nativeSetPointerCapture", "(JZ)V", (void*)nativeSetPointerCapture}, {"nativeSetInputDispatchMode", "(JZZ)V", (void*)nativeSetInputDispatchMode}, - {"nativeSetSystemUiVisibility", "(JI)V", (void*)nativeSetSystemUiVisibility}, + {"nativeSetSystemUiLightsOut", "(JZ)V", (void*)nativeSetSystemUiLightsOut}, {"nativeTransferTouchFocus", "(JLandroid/os/IBinder;Landroid/os/IBinder;)Z", (void*)nativeTransferTouchFocus}, {"nativeSetPointerSpeed", "(JI)V", (void*)nativeSetPointerSpeed}, diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java index 89a0c7c4885e..f96aa2efc952 100644 --- a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java @@ -1522,7 +1522,7 @@ public class ActivityRecordTests extends WindowTestsBase { try { // Return error to skip unnecessary operation. doReturn(WindowManagerGlobal.ADD_STARTING_NOT_NEEDED).when(session).addToDisplay( - any() /* window */, anyInt() /* seq */, any() /* attrs */, + any() /* window */, any() /* attrs */, anyInt() /* viewVisibility */, anyInt() /* displayId */, any() /* outFrame */, any() /* outContentInsets */, any() /* outStableInsets */, any() /* outDisplayCutout */, any() /* outInputChannel */, diff --git a/services/tests/wmtests/src/com/android/server/wm/TestIWindow.java b/services/tests/wmtests/src/com/android/server/wm/TestIWindow.java index d37f3f402c30..ea1223312cb2 100644 --- a/services/tests/wmtests/src/com/android/server/wm/TestIWindow.java +++ b/services/tests/wmtests/src/com/android/server/wm/TestIWindow.java @@ -94,11 +94,6 @@ public class TestIWindow extends IWindow.Stub { } @Override - public void dispatchSystemUiVisibilityChanged(int seq, int globalVisibility, int localValue, - int localChanges) throws RemoteException { - } - - @Override public void dispatchWindowShown() throws RemoteException { } diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java b/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java index 7daddd8720ab..986807e661f1 100644 --- a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java +++ b/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java @@ -360,7 +360,7 @@ class WindowTestsBase extends SystemServiceTestsBase { attrs.setTitle(name); final WindowState w = new WindowState(service, session, iWindow, token, parent, - OP_NONE, 0, attrs, VISIBLE, ownerId, userId, + OP_NONE, attrs, VISIBLE, ownerId, userId, ownerCanAddInternalSystemWindow, powerManagerWrapper); // TODO: Probably better to make this call in the WindowState ctor to avoid errors with @@ -1088,7 +1088,7 @@ class WindowTestsBase extends SystemServiceTestsBase { TestWindowState(WindowManagerService service, Session session, IWindow window, WindowManager.LayoutParams attrs, WindowToken token) { - super(service, session, window, token, null, OP_NONE, 0, attrs, 0, 0, 0, + super(service, session, window, token, null, OP_NONE, attrs, 0, 0, 0, false /* ownerCanAddInternalSystemWindow */); } |