Fix issue #2133206: dialogs/menus should auto-dismiss when screen turns off
Lot of infrastructure for more things to go away when "clear system dialogs"
happens, and now do this when we turn on the lock screen.
Change-Id: I567130296fe47ce82df065ed58ef21b37416ceaf
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index f742f9f..2c39c2a 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -3913,6 +3913,20 @@
return mPolicy.inKeyguardRestrictedKeyInputMode();
}
+ public void closeSystemDialogs(String reason) {
+ synchronized(mWindowMap) {
+ for (int i=mWindows.size()-1; i>=0; i--) {
+ WindowState w = (WindowState)mWindows.get(i);
+ if (w.mSurface != null) {
+ try {
+ w.mClient.closeSystemDialogs(reason);
+ } catch (RemoteException e) {
+ }
+ }
+ }
+ }
+ }
+
static float fixScale(float scale) {
if (scale < 0) scale = 0;
else if (scale > 20) scale = 20;