diff options
| author | 2017-02-10 04:02:31 +0000 | |
|---|---|---|
| committer | 2017-02-10 04:02:34 +0000 | |
| commit | 081a9a75935ff2a91284f768e204f75f23c5da26 (patch) | |
| tree | 85367590067864c4717639ac081edd866d7d6d33 | |
| parent | 6bfdfe67b30f3bf5d3f669bf807b8ad00256da9d (diff) | |
| parent | f24a170ab23edf84ecee508bb620db43dc11c0e1 (diff) | |
Merge "Remove user-specific data in WMS when the user is removed."
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowManagerService.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 597e8b6ac8fc..be0771ae97b5 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -22,8 +22,11 @@ import static android.Manifest.permission.REGISTER_WINDOW_MANAGER_LISTENERS; import static android.app.ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT; import static android.app.ActivityManager.StackId.PINNED_STACK_ID; import static android.app.StatusBarManager.DISABLE_MASK; +import static android.content.Intent.ACTION_USER_REMOVED; +import static android.content.Intent.EXTRA_USER_HANDLE; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; import static android.content.pm.PackageManager.PERMISSION_GRANTED; +import static android.os.UserHandle.USER_NULL; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.WindowManager.DOCKED_INVALID; import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW; @@ -346,6 +349,13 @@ public class WindowManagerService extends IWindowManager.Stub if (DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED.equals(action)) { mKeyguardDisableHandler.sendEmptyMessage( KeyguardDisableHandler.KEYGUARD_POLICY_CHANGED); + } else if (ACTION_USER_REMOVED.equals(action)) { + final int userId = intent.getIntExtra(EXTRA_USER_HANDLE, USER_NULL); + if (userId != USER_NULL) { + synchronized (mWindowMap) { + mScreenCaptureDisabled.remove(userId); + } + } } } }; @@ -1021,9 +1031,11 @@ public class WindowManagerService extends IWindowManager.Stub setAnimatorDurationScale(Settings.Global.getFloat(context.getContentResolver(), Settings.Global.ANIMATOR_DURATION_SCALE, mAnimatorDurationScaleSetting)); - // Track changes to DevicePolicyManager state so we can enable/disable keyguard. IntentFilter filter = new IntentFilter(); + // Track changes to DevicePolicyManager state so we can enable/disable keyguard. filter.addAction(DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED); + // Listen to user removal broadcasts so that we can remove the user-specific data. + filter.addAction(Intent.ACTION_USER_REMOVED); mContext.registerReceiver(mBroadcastReceiver, filter); mSettingsObserver = new SettingsObserver(); |