Loading core/java/android/provider/Settings.java +7 −0 Original line number Diff line number Diff line Loading @@ -12386,6 +12386,13 @@ public final class Settings { */ public static final String HIDE_PRIVATESPACE_ENTRY_POINT = "hide_privatespace_entry_point"; /** * Whether or not secure windows should be disabled. This only works on debuggable builds. * * @hide */ public static final String DISABLE_SECURE_WINDOWS = "disable_secure_windows"; /** @hide */ public static final int PRIVATE_SPACE_AUTO_LOCK_ON_DEVICE_LOCK = 0; /** @hide */ Loading packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -688,6 +688,7 @@ public class SettingsBackupTest { Settings.Secure.DEVICE_PAIRED, Settings.Secure.DIALER_DEFAULT_APPLICATION, Settings.Secure.DISABLED_PRINT_SERVICES, Settings.Secure.DISABLE_SECURE_WINDOWS, Settings.Secure.DISABLED_SYSTEM_INPUT_METHODS, Settings.Secure.DOCKED_CLOCK_FACE, Settings.Secure.DOZE_PULSE_ON_LONG_PRESS, Loading services/core/java/com/android/server/wm/WindowManagerService.java +39 −0 Original line number Diff line number Diff line Loading @@ -795,6 +795,8 @@ public class WindowManagerService extends IWindowManager.Stub Settings.Global.getUriFor(Settings.Global.ANIMATOR_DURATION_SCALE); private final Uri mImmersiveModeConfirmationsUri = Settings.Secure.getUriFor(Settings.Secure.IMMERSIVE_MODE_CONFIRMATIONS); private final Uri mDisableSecureWindowsUri = Settings.Secure.getUriFor(Settings.Secure.DISABLE_SECURE_WINDOWS); private final Uri mPolicyControlUri = Settings.Global.getUriFor(Settings.Global.POLICY_CONTROL); private final Uri mForceDesktopModeOnExternalDisplaysUri = Settings.Global.getUriFor( Loading Loading @@ -823,6 +825,8 @@ public class WindowManagerService extends IWindowManager.Stub UserHandle.USER_ALL); resolver.registerContentObserver(mImmersiveModeConfirmationsUri, false, this, UserHandle.USER_ALL); resolver.registerContentObserver(mDisableSecureWindowsUri, false, this, UserHandle.USER_ALL); resolver.registerContentObserver(mPolicyControlUri, false, this, UserHandle.USER_ALL); resolver.registerContentObserver(mForceDesktopModeOnExternalDisplaysUri, false, this, UserHandle.USER_ALL); Loading Loading @@ -877,6 +881,11 @@ public class WindowManagerService extends IWindowManager.Stub return; } if (mDisableSecureWindowsUri.equals(uri)) { updateDisableSecureWindows(); return; } @UpdateAnimationScaleMode final int mode; if (mWindowAnimationScaleUri.equals(uri)) { Loading @@ -896,6 +905,7 @@ public class WindowManagerService extends IWindowManager.Stub void loadSettings() { updateSystemUiSettings(false /* handleChange */); updateMaximumObscuringOpacityForTouch(); updateDisableSecureWindows(); } void updateMaximumObscuringOpacityForTouch() { Loading Loading @@ -978,6 +988,28 @@ public class WindowManagerService extends IWindowManager.Stub }); } } void updateDisableSecureWindows() { if (!SystemProperties.getBoolean(SYSTEM_DEBUGGABLE, false)) { return; } final boolean disableSecureWindows; try { disableSecureWindows = Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.DISABLE_SECURE_WINDOWS, 0) != 0; } catch (Settings.SettingNotFoundException e) { return; } if (mDisableSecureWindows == disableSecureWindows) { return; } synchronized (mGlobalLock) { mDisableSecureWindows = disableSecureWindows; mRoot.refreshSecureSurfaceState(); } } } PowerManager mPowerManager; Loading Loading @@ -1116,6 +1148,8 @@ public class WindowManagerService extends IWindowManager.Stub private final ScreenRecordingCallbackController mScreenRecordingCallbackController; private volatile boolean mDisableSecureWindows = false; public static WindowManagerService main(final Context context, final InputManagerService im, final boolean showBootMsgs, WindowManagerPolicy policy, ActivityTaskManagerService atm) { Loading Loading @@ -6905,6 +6939,7 @@ public class WindowManagerService extends IWindowManager.Stub pw.print(mLastFinishedFreezeSource); } pw.println(); pw.print(" mDisableSecureWindows="); pw.println(mDisableSecureWindows); mInputManagerCallback.dump(pw, " "); mSnapshotController.dump(pw, " "); Loading Loading @@ -10076,4 +10111,8 @@ public class WindowManagerService extends IWindowManager.Stub mDragDropController.setGlobalDragListener(listener); } } boolean getDisableSecureWindows() { return mDisableSecureWindows; } } services/core/java/com/android/server/wm/WindowState.java +4 −0 Original line number Diff line number Diff line Loading @@ -1898,6 +1898,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP } boolean isSecureLocked() { if (mWmService.getDisableSecureWindows()) { return false; } if ((mAttrs.flags & WindowManager.LayoutParams.FLAG_SECURE) != 0) { return true; } Loading Loading
core/java/android/provider/Settings.java +7 −0 Original line number Diff line number Diff line Loading @@ -12386,6 +12386,13 @@ public final class Settings { */ public static final String HIDE_PRIVATESPACE_ENTRY_POINT = "hide_privatespace_entry_point"; /** * Whether or not secure windows should be disabled. This only works on debuggable builds. * * @hide */ public static final String DISABLE_SECURE_WINDOWS = "disable_secure_windows"; /** @hide */ public static final int PRIVATE_SPACE_AUTO_LOCK_ON_DEVICE_LOCK = 0; /** @hide */ Loading
packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -688,6 +688,7 @@ public class SettingsBackupTest { Settings.Secure.DEVICE_PAIRED, Settings.Secure.DIALER_DEFAULT_APPLICATION, Settings.Secure.DISABLED_PRINT_SERVICES, Settings.Secure.DISABLE_SECURE_WINDOWS, Settings.Secure.DISABLED_SYSTEM_INPUT_METHODS, Settings.Secure.DOCKED_CLOCK_FACE, Settings.Secure.DOZE_PULSE_ON_LONG_PRESS, Loading
services/core/java/com/android/server/wm/WindowManagerService.java +39 −0 Original line number Diff line number Diff line Loading @@ -795,6 +795,8 @@ public class WindowManagerService extends IWindowManager.Stub Settings.Global.getUriFor(Settings.Global.ANIMATOR_DURATION_SCALE); private final Uri mImmersiveModeConfirmationsUri = Settings.Secure.getUriFor(Settings.Secure.IMMERSIVE_MODE_CONFIRMATIONS); private final Uri mDisableSecureWindowsUri = Settings.Secure.getUriFor(Settings.Secure.DISABLE_SECURE_WINDOWS); private final Uri mPolicyControlUri = Settings.Global.getUriFor(Settings.Global.POLICY_CONTROL); private final Uri mForceDesktopModeOnExternalDisplaysUri = Settings.Global.getUriFor( Loading Loading @@ -823,6 +825,8 @@ public class WindowManagerService extends IWindowManager.Stub UserHandle.USER_ALL); resolver.registerContentObserver(mImmersiveModeConfirmationsUri, false, this, UserHandle.USER_ALL); resolver.registerContentObserver(mDisableSecureWindowsUri, false, this, UserHandle.USER_ALL); resolver.registerContentObserver(mPolicyControlUri, false, this, UserHandle.USER_ALL); resolver.registerContentObserver(mForceDesktopModeOnExternalDisplaysUri, false, this, UserHandle.USER_ALL); Loading Loading @@ -877,6 +881,11 @@ public class WindowManagerService extends IWindowManager.Stub return; } if (mDisableSecureWindowsUri.equals(uri)) { updateDisableSecureWindows(); return; } @UpdateAnimationScaleMode final int mode; if (mWindowAnimationScaleUri.equals(uri)) { Loading @@ -896,6 +905,7 @@ public class WindowManagerService extends IWindowManager.Stub void loadSettings() { updateSystemUiSettings(false /* handleChange */); updateMaximumObscuringOpacityForTouch(); updateDisableSecureWindows(); } void updateMaximumObscuringOpacityForTouch() { Loading Loading @@ -978,6 +988,28 @@ public class WindowManagerService extends IWindowManager.Stub }); } } void updateDisableSecureWindows() { if (!SystemProperties.getBoolean(SYSTEM_DEBUGGABLE, false)) { return; } final boolean disableSecureWindows; try { disableSecureWindows = Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.DISABLE_SECURE_WINDOWS, 0) != 0; } catch (Settings.SettingNotFoundException e) { return; } if (mDisableSecureWindows == disableSecureWindows) { return; } synchronized (mGlobalLock) { mDisableSecureWindows = disableSecureWindows; mRoot.refreshSecureSurfaceState(); } } } PowerManager mPowerManager; Loading Loading @@ -1116,6 +1148,8 @@ public class WindowManagerService extends IWindowManager.Stub private final ScreenRecordingCallbackController mScreenRecordingCallbackController; private volatile boolean mDisableSecureWindows = false; public static WindowManagerService main(final Context context, final InputManagerService im, final boolean showBootMsgs, WindowManagerPolicy policy, ActivityTaskManagerService atm) { Loading Loading @@ -6905,6 +6939,7 @@ public class WindowManagerService extends IWindowManager.Stub pw.print(mLastFinishedFreezeSource); } pw.println(); pw.print(" mDisableSecureWindows="); pw.println(mDisableSecureWindows); mInputManagerCallback.dump(pw, " "); mSnapshotController.dump(pw, " "); Loading Loading @@ -10076,4 +10111,8 @@ public class WindowManagerService extends IWindowManager.Stub mDragDropController.setGlobalDragListener(listener); } } boolean getDisableSecureWindows() { return mDisableSecureWindows; } }
services/core/java/com/android/server/wm/WindowState.java +4 −0 Original line number Diff line number Diff line Loading @@ -1898,6 +1898,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP } boolean isSecureLocked() { if (mWmService.getDisableSecureWindows()) { return false; } if ((mAttrs.flags & WindowManager.LayoutParams.FLAG_SECURE) != 0) { return true; } Loading