Loading services/core/java/com/android/server/wm/DisplayContent.java +11 −5 Original line number Diff line number Diff line Loading @@ -5735,8 +5735,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp } /** * This is the development option to force enable desktop mode on all secondary public displays * that are not owned by a virtual device. * This is the development option to force enable desktop mode on all secondary public displays. * When this is enabled, it also force enable system decorations on those displays. * * If we need a per-display config to enable desktop mode for production, that config should Loading @@ -5746,9 +5745,16 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp if (!mWmService.mForceDesktopModeOnExternalDisplays || isDefaultDisplay || isPrivate()) { return false; } // Desktop mode is not supported on virtual devices. int deviceId = mRootWindowContainer.mTaskSupervisor.getDeviceIdForDisplayId(mDisplayId); return deviceId == Context.DEVICE_ID_DEFAULT; if (mDwpcHelper != null && !mDwpcHelper.isWindowingModeSupported(WINDOWING_MODE_FREEFORM)) { return false; } // Virtual displays need to explicitly opt in via the system decorations. if (mDisplay.getType() == Display.TYPE_VIRTUAL && !mWmService.mDisplayWindowSettings.shouldShowSystemDecorsLocked(this) && (mDisplay.getFlags() & FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS) == 0) { return false; } return true; } /** Loading services/core/java/com/android/server/wm/DisplayRotation.java +1 −3 Original line number Diff line number Diff line Loading @@ -429,9 +429,7 @@ public class DisplayRotation { final boolean isTv = mContext.getPackageManager().hasSystemFeature( PackageManager.FEATURE_LEANBACK); mDefaultFixedToUserRotation = (isCar || isTv || mService.mIsPc || mDisplayContent.isPublicSecondaryDisplayWithDesktopModeForceEnabled() || !mDisplayContent.shouldRotateWithContent()) (isCar || isTv || mService.mIsPc || !mDisplayContent.shouldRotateWithContent()) // For debug purposes the next line turns this feature off with: // $ adb shell setprop config.override_forced_orient true // $ adb shell wm size reset Loading services/tests/wmtests/src/com/android/server/wm/DisplayWindowSettingsTests.java +3 −1 Original line number Diff line number Diff line Loading @@ -508,7 +508,9 @@ public class DisplayWindowSettingsTests extends WindowTestsBase { public void testShouldShowImeOnDisplayWithinForceDesktopMode() { try { // Presume display enabled force desktop mode from developer options. final DisplayContent dc = createMockSimulatedDisplay(); final SettingsEntry settingsEntry = new SettingsEntry(); settingsEntry.mShouldShowSystemDecors = true; final DisplayContent dc = createMockSimulatedDisplay(settingsEntry); mWm.setForceDesktopModeOnExternalDisplays(true); final WindowManagerInternal wmInternal = LocalServices.getService( WindowManagerInternal.class); Loading Loading
services/core/java/com/android/server/wm/DisplayContent.java +11 −5 Original line number Diff line number Diff line Loading @@ -5735,8 +5735,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp } /** * This is the development option to force enable desktop mode on all secondary public displays * that are not owned by a virtual device. * This is the development option to force enable desktop mode on all secondary public displays. * When this is enabled, it also force enable system decorations on those displays. * * If we need a per-display config to enable desktop mode for production, that config should Loading @@ -5746,9 +5745,16 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp if (!mWmService.mForceDesktopModeOnExternalDisplays || isDefaultDisplay || isPrivate()) { return false; } // Desktop mode is not supported on virtual devices. int deviceId = mRootWindowContainer.mTaskSupervisor.getDeviceIdForDisplayId(mDisplayId); return deviceId == Context.DEVICE_ID_DEFAULT; if (mDwpcHelper != null && !mDwpcHelper.isWindowingModeSupported(WINDOWING_MODE_FREEFORM)) { return false; } // Virtual displays need to explicitly opt in via the system decorations. if (mDisplay.getType() == Display.TYPE_VIRTUAL && !mWmService.mDisplayWindowSettings.shouldShowSystemDecorsLocked(this) && (mDisplay.getFlags() & FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS) == 0) { return false; } return true; } /** Loading
services/core/java/com/android/server/wm/DisplayRotation.java +1 −3 Original line number Diff line number Diff line Loading @@ -429,9 +429,7 @@ public class DisplayRotation { final boolean isTv = mContext.getPackageManager().hasSystemFeature( PackageManager.FEATURE_LEANBACK); mDefaultFixedToUserRotation = (isCar || isTv || mService.mIsPc || mDisplayContent.isPublicSecondaryDisplayWithDesktopModeForceEnabled() || !mDisplayContent.shouldRotateWithContent()) (isCar || isTv || mService.mIsPc || !mDisplayContent.shouldRotateWithContent()) // For debug purposes the next line turns this feature off with: // $ adb shell setprop config.override_forced_orient true // $ adb shell wm size reset Loading
services/tests/wmtests/src/com/android/server/wm/DisplayWindowSettingsTests.java +3 −1 Original line number Diff line number Diff line Loading @@ -508,7 +508,9 @@ public class DisplayWindowSettingsTests extends WindowTestsBase { public void testShouldShowImeOnDisplayWithinForceDesktopMode() { try { // Presume display enabled force desktop mode from developer options. final DisplayContent dc = createMockSimulatedDisplay(); final SettingsEntry settingsEntry = new SettingsEntry(); settingsEntry.mShouldShowSystemDecors = true; final DisplayContent dc = createMockSimulatedDisplay(settingsEntry); mWm.setForceDesktopModeOnExternalDisplays(true); final WindowManagerInternal wmInternal = LocalServices.getService( WindowManagerInternal.class); Loading