Loading core/java/android/view/IWindowManager.aidl +6 −1 Original line number Diff line number Diff line Loading @@ -342,6 +342,11 @@ interface IWindowManager */ void setFixedToUserRotation(int displayId, int fixedToUserRotation); /** * Sets if all requested fixed orientation should be ignored for given displayId. */ void setIgnoreOrientationRequest(int displayId, boolean ignoreOrientationRequest); /** * Screenshot the current wallpaper layer, including the whole screen. */ Loading packages/SystemUI/shared/src/com/android/systemui/shared/system/WindowManagerWrapper.java +12 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,18 @@ public class WindowManagerWrapper { params.providesInsetsTypes = providesInsetsTypes; } /** * Sets if app requested fixed orientation should be ignored for given displayId. */ public void setIgnoreOrientationRequest(int displayId, boolean ignoreOrientationRequest) { try { WindowManagerGlobal.getWindowManagerService().setIgnoreOrientationRequest( displayId, ignoreOrientationRequest); } catch (RemoteException e) { Log.e(TAG, "Failed to setIgnoreOrientationRequest()", e); } } /** * @return the stable insets for the primary display. */ Loading services/core/java/com/android/server/wm/DisplayArea.java +4 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,10 @@ public class DisplayArea<T extends WindowContainer> extends WindowContainer<T> { return false; } boolean getIgnoreOrientationRequest() { return mIgnoreOrientationRequest; } /** * When a {@link DisplayArea} is repositioned, it should only be moved among its siblings of the * same {@link Type}. Loading services/core/java/com/android/server/wm/DisplayContent.java +7 −2 Original line number Diff line number Diff line Loading @@ -5356,8 +5356,13 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp return mDisplayPolicy.getSystemUiContext(); } Point getDisplayPosition() { return mWmService.mDisplayManagerInternal.getDisplayPosition(getDisplayId()); @Override boolean setIgnoreOrientationRequest(boolean ignoreOrientationRequest) { if (mIgnoreOrientationRequest == ignoreOrientationRequest) return false; final boolean rotationChanged = super.setIgnoreOrientationRequest(ignoreOrientationRequest); mWmService.mDisplayWindowSettings.setIgnoreOrientationRequest( this, mIgnoreOrientationRequest); return rotationChanged; } /** Loading services/core/java/com/android/server/wm/DisplayWindowSettings.java +20 −1 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ class DisplayWindowSettings { private boolean mShouldShowSystemDecors = false; private boolean mShouldShowIme = false; private int mFixedToUserRotation = IWindowManager.FIXED_TO_USER_ROTATION_DEFAULT; private boolean mIgnoreOrientationRequest = false; private Entry(String name) { mName = name; Loading @@ -131,6 +132,7 @@ class DisplayWindowSettings { mShouldShowSystemDecors = copyFrom.mShouldShowSystemDecors; mShouldShowIme = copyFrom.mShouldShowIme; mFixedToUserRotation = copyFrom.mFixedToUserRotation; mIgnoreOrientationRequest = copyFrom.mIgnoreOrientationRequest; } /** @return {@code true} if all values are default. */ Loading @@ -144,7 +146,8 @@ class DisplayWindowSettings { && !mShouldShowWithInsecureKeyguard && !mShouldShowSystemDecors && !mShouldShowIme && mFixedToUserRotation == IWindowManager.FIXED_TO_USER_ROTATION_DEFAULT; && mFixedToUserRotation == IWindowManager.FIXED_TO_USER_ROTATION_DEFAULT && !mIgnoreOrientationRequest; } } Loading Loading @@ -248,6 +251,15 @@ class DisplayWindowSettings { writeSettingsIfNeeded(entry, displayInfo); } void setIgnoreOrientationRequest( DisplayContent displayContent, boolean ignoreOrientationRequest) { final DisplayInfo displayInfo = displayContent.getDisplayInfo(); final Entry entry = getOrCreateEntry(displayInfo); if (entry.mIgnoreOrientationRequest == ignoreOrientationRequest) return; entry.mIgnoreOrientationRequest = ignoreOrientationRequest; writeSettingsIfNeeded(entry, displayInfo); } private int getWindowingModeLocked(Entry entry, DisplayContent dc) { int windowingMode = entry != null ? entry.mWindowingMode : WindowConfiguration.WINDOWING_MODE_UNDEFINED; Loading Loading @@ -389,6 +401,7 @@ class DisplayWindowSettings { final boolean hasSizeOverride = entry.mForcedWidth != 0 && entry.mForcedHeight != 0; dc.mIsDensityForced = hasDensityOverride; dc.mIsSizeForced = hasSizeOverride; dc.setIgnoreOrientationRequest(entry.mIgnoreOrientationRequest); final int width = hasSizeOverride ? entry.mForcedWidth : dc.mBaseDisplayWidth; final int height = hasSizeOverride ? entry.mForcedHeight : dc.mBaseDisplayHeight; Loading Loading @@ -529,6 +542,8 @@ class DisplayWindowSettings { entry.mShouldShowSystemDecors = getBooleanAttribute(parser, "shouldShowSystemDecors"); entry.mShouldShowIme = getBooleanAttribute(parser, "shouldShowIme"); entry.mFixedToUserRotation = getIntAttribute(parser, "fixedToUserRotation"); entry.mIgnoreOrientationRequest = getBooleanAttribute(parser, "ignoreOrientationRequest"); mEntries.put(name, entry); } XmlUtils.skipCurrentTag(parser); Loading Loading @@ -613,6 +628,10 @@ class DisplayWindowSettings { out.attribute(null, "fixedToUserRotation", Integer.toString(entry.mFixedToUserRotation)); } if (entry.mIgnoreOrientationRequest) { out.attribute(null, "ignoreOrientationRequest", Boolean.toString(entry.mIgnoreOrientationRequest)); } out.endTag(null, "display"); } Loading Loading
core/java/android/view/IWindowManager.aidl +6 −1 Original line number Diff line number Diff line Loading @@ -342,6 +342,11 @@ interface IWindowManager */ void setFixedToUserRotation(int displayId, int fixedToUserRotation); /** * Sets if all requested fixed orientation should be ignored for given displayId. */ void setIgnoreOrientationRequest(int displayId, boolean ignoreOrientationRequest); /** * Screenshot the current wallpaper layer, including the whole screen. */ Loading
packages/SystemUI/shared/src/com/android/systemui/shared/system/WindowManagerWrapper.java +12 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,18 @@ public class WindowManagerWrapper { params.providesInsetsTypes = providesInsetsTypes; } /** * Sets if app requested fixed orientation should be ignored for given displayId. */ public void setIgnoreOrientationRequest(int displayId, boolean ignoreOrientationRequest) { try { WindowManagerGlobal.getWindowManagerService().setIgnoreOrientationRequest( displayId, ignoreOrientationRequest); } catch (RemoteException e) { Log.e(TAG, "Failed to setIgnoreOrientationRequest()", e); } } /** * @return the stable insets for the primary display. */ Loading
services/core/java/com/android/server/wm/DisplayArea.java +4 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,10 @@ public class DisplayArea<T extends WindowContainer> extends WindowContainer<T> { return false; } boolean getIgnoreOrientationRequest() { return mIgnoreOrientationRequest; } /** * When a {@link DisplayArea} is repositioned, it should only be moved among its siblings of the * same {@link Type}. Loading
services/core/java/com/android/server/wm/DisplayContent.java +7 −2 Original line number Diff line number Diff line Loading @@ -5356,8 +5356,13 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp return mDisplayPolicy.getSystemUiContext(); } Point getDisplayPosition() { return mWmService.mDisplayManagerInternal.getDisplayPosition(getDisplayId()); @Override boolean setIgnoreOrientationRequest(boolean ignoreOrientationRequest) { if (mIgnoreOrientationRequest == ignoreOrientationRequest) return false; final boolean rotationChanged = super.setIgnoreOrientationRequest(ignoreOrientationRequest); mWmService.mDisplayWindowSettings.setIgnoreOrientationRequest( this, mIgnoreOrientationRequest); return rotationChanged; } /** Loading
services/core/java/com/android/server/wm/DisplayWindowSettings.java +20 −1 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ class DisplayWindowSettings { private boolean mShouldShowSystemDecors = false; private boolean mShouldShowIme = false; private int mFixedToUserRotation = IWindowManager.FIXED_TO_USER_ROTATION_DEFAULT; private boolean mIgnoreOrientationRequest = false; private Entry(String name) { mName = name; Loading @@ -131,6 +132,7 @@ class DisplayWindowSettings { mShouldShowSystemDecors = copyFrom.mShouldShowSystemDecors; mShouldShowIme = copyFrom.mShouldShowIme; mFixedToUserRotation = copyFrom.mFixedToUserRotation; mIgnoreOrientationRequest = copyFrom.mIgnoreOrientationRequest; } /** @return {@code true} if all values are default. */ Loading @@ -144,7 +146,8 @@ class DisplayWindowSettings { && !mShouldShowWithInsecureKeyguard && !mShouldShowSystemDecors && !mShouldShowIme && mFixedToUserRotation == IWindowManager.FIXED_TO_USER_ROTATION_DEFAULT; && mFixedToUserRotation == IWindowManager.FIXED_TO_USER_ROTATION_DEFAULT && !mIgnoreOrientationRequest; } } Loading Loading @@ -248,6 +251,15 @@ class DisplayWindowSettings { writeSettingsIfNeeded(entry, displayInfo); } void setIgnoreOrientationRequest( DisplayContent displayContent, boolean ignoreOrientationRequest) { final DisplayInfo displayInfo = displayContent.getDisplayInfo(); final Entry entry = getOrCreateEntry(displayInfo); if (entry.mIgnoreOrientationRequest == ignoreOrientationRequest) return; entry.mIgnoreOrientationRequest = ignoreOrientationRequest; writeSettingsIfNeeded(entry, displayInfo); } private int getWindowingModeLocked(Entry entry, DisplayContent dc) { int windowingMode = entry != null ? entry.mWindowingMode : WindowConfiguration.WINDOWING_MODE_UNDEFINED; Loading Loading @@ -389,6 +401,7 @@ class DisplayWindowSettings { final boolean hasSizeOverride = entry.mForcedWidth != 0 && entry.mForcedHeight != 0; dc.mIsDensityForced = hasDensityOverride; dc.mIsSizeForced = hasSizeOverride; dc.setIgnoreOrientationRequest(entry.mIgnoreOrientationRequest); final int width = hasSizeOverride ? entry.mForcedWidth : dc.mBaseDisplayWidth; final int height = hasSizeOverride ? entry.mForcedHeight : dc.mBaseDisplayHeight; Loading Loading @@ -529,6 +542,8 @@ class DisplayWindowSettings { entry.mShouldShowSystemDecors = getBooleanAttribute(parser, "shouldShowSystemDecors"); entry.mShouldShowIme = getBooleanAttribute(parser, "shouldShowIme"); entry.mFixedToUserRotation = getIntAttribute(parser, "fixedToUserRotation"); entry.mIgnoreOrientationRequest = getBooleanAttribute(parser, "ignoreOrientationRequest"); mEntries.put(name, entry); } XmlUtils.skipCurrentTag(parser); Loading Loading @@ -613,6 +628,10 @@ class DisplayWindowSettings { out.attribute(null, "fixedToUserRotation", Integer.toString(entry.mFixedToUserRotation)); } if (entry.mIgnoreOrientationRequest) { out.attribute(null, "ignoreOrientationRequest", Boolean.toString(entry.mIgnoreOrientationRequest)); } out.endTag(null, "display"); } Loading