Loading core/java/android/app/admin/DevicePolicyCache.java +5 −3 Original line number Diff line number Diff line Loading @@ -41,7 +41,8 @@ public abstract class DevicePolicyCache { /** * See {@link DevicePolicyManager#getScreenCaptureDisabled} */ public abstract boolean getScreenCaptureDisabled(@UserIdInt int userHandle); public abstract boolean isScreenCaptureAllowed(@UserIdInt int userHandle, boolean ownerCanAddInternalSystemWindow); /** * Caches {@link DevicePolicyManager#getPasswordQuality(android.content.ComponentName)} of the Loading @@ -56,8 +57,9 @@ public abstract class DevicePolicyCache { private static final EmptyDevicePolicyCache INSTANCE = new EmptyDevicePolicyCache(); @Override public boolean getScreenCaptureDisabled(int userHandle) { return false; public boolean isScreenCaptureAllowed(int userHandle, boolean ownerCanAddInternalSystemWindow) { return true; } @Override Loading services/core/java/com/android/server/wm/ActivityRecord.java +2 −3 Original line number Diff line number Diff line Loading @@ -4343,9 +4343,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A * screenshot. */ boolean shouldUseAppThemeSnapshot() { return mDisablePreviewScreenshots || forAllWindows(w -> { return mWmService.isSecureLocked(w); }, true /* topToBottom */); return mDisablePreviewScreenshots || forAllWindows(WindowState::isSecureLocked, true /* topToBottom */); } /** Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -3824,7 +3824,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } userId = activity.mUserId; } return !DevicePolicyCache.getInstance().getScreenCaptureDisabled(userId); return DevicePolicyCache.getInstance().isScreenCaptureAllowed(userId, false); } @Override Loading services/core/java/com/android/server/wm/DisplayContent.java +1 −1 Original line number Diff line number Diff line Loading @@ -3782,7 +3782,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo } boolean hasSecureWindowOnScreen() { final WindowState win = getWindow(w -> w.isOnScreen() && mWmService.isSecureLocked(w)); final WindowState win = getWindow(w -> w.isOnScreen() && w.isSecureLocked()); return win != null; } Loading services/core/java/com/android/server/wm/RootWindowContainer.java +2 −2 Original line number Diff line number Diff line Loading @@ -662,10 +662,10 @@ class RootWindowContainer extends WindowContainer<DisplayContent> } } void setSecureSurfaceState(int userId, boolean disabled) { void setSecureSurfaceState(int userId) { forAllWindows((w) -> { if (w.mHasSurface && userId == w.mShowUserId) { w.mWinAnimator.setSecureLocked(disabled); w.mWinAnimator.setSecureLocked(w.isSecureLocked()); } }, true /* traverseTopToBottom */); } Loading Loading
core/java/android/app/admin/DevicePolicyCache.java +5 −3 Original line number Diff line number Diff line Loading @@ -41,7 +41,8 @@ public abstract class DevicePolicyCache { /** * See {@link DevicePolicyManager#getScreenCaptureDisabled} */ public abstract boolean getScreenCaptureDisabled(@UserIdInt int userHandle); public abstract boolean isScreenCaptureAllowed(@UserIdInt int userHandle, boolean ownerCanAddInternalSystemWindow); /** * Caches {@link DevicePolicyManager#getPasswordQuality(android.content.ComponentName)} of the Loading @@ -56,8 +57,9 @@ public abstract class DevicePolicyCache { private static final EmptyDevicePolicyCache INSTANCE = new EmptyDevicePolicyCache(); @Override public boolean getScreenCaptureDisabled(int userHandle) { return false; public boolean isScreenCaptureAllowed(int userHandle, boolean ownerCanAddInternalSystemWindow) { return true; } @Override Loading
services/core/java/com/android/server/wm/ActivityRecord.java +2 −3 Original line number Diff line number Diff line Loading @@ -4343,9 +4343,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A * screenshot. */ boolean shouldUseAppThemeSnapshot() { return mDisablePreviewScreenshots || forAllWindows(w -> { return mWmService.isSecureLocked(w); }, true /* topToBottom */); return mDisablePreviewScreenshots || forAllWindows(WindowState::isSecureLocked, true /* topToBottom */); } /** Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -3824,7 +3824,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } userId = activity.mUserId; } return !DevicePolicyCache.getInstance().getScreenCaptureDisabled(userId); return DevicePolicyCache.getInstance().isScreenCaptureAllowed(userId, false); } @Override Loading
services/core/java/com/android/server/wm/DisplayContent.java +1 −1 Original line number Diff line number Diff line Loading @@ -3782,7 +3782,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo } boolean hasSecureWindowOnScreen() { final WindowState win = getWindow(w -> w.isOnScreen() && mWmService.isSecureLocked(w)); final WindowState win = getWindow(w -> w.isOnScreen() && w.isSecureLocked()); return win != null; } Loading
services/core/java/com/android/server/wm/RootWindowContainer.java +2 −2 Original line number Diff line number Diff line Loading @@ -662,10 +662,10 @@ class RootWindowContainer extends WindowContainer<DisplayContent> } } void setSecureSurfaceState(int userId, boolean disabled) { void setSecureSurfaceState(int userId) { forAllWindows((w) -> { if (w.mHasSurface && userId == w.mShowUserId) { w.mWinAnimator.setSecureLocked(disabled); w.mWinAnimator.setSecureLocked(w.isSecureLocked()); } }, true /* traverseTopToBottom */); } Loading