diff options
| author | 2015-10-16 13:50:35 +0000 | |
|---|---|---|
| committer | 2015-10-16 13:50:35 +0000 | |
| commit | 75693994f60bdec9a10db98ddb8addd2bc3f8bbb (patch) | |
| tree | f96ed1c3bbda76b3a971c8e7e3355c85f3aad3c8 | |
| parent | f916524f44c9955e7c747e5319d17c46a61a3c4c (diff) | |
| parent | ff58e30aca710252703e32bd7533abaa19a50487 (diff) | |
Merge "Disassociate system windows from apps"
| -rw-r--r-- | core/java/android/view/Window.java | 29 | 
1 files changed, 21 insertions, 8 deletions
diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java index 07984e9ddd98..c222a82b42ee 100644 --- a/core/java/android/view/Window.java +++ b/core/java/android/view/Window.java @@ -578,7 +578,7 @@ public abstract class Window {      void adjustLayoutParamsForSubWindow(WindowManager.LayoutParams wp) {          CharSequence curTitle = wp.getTitle();          if (wp.type >= WindowManager.LayoutParams.FIRST_SUB_WINDOW && -            wp.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW) { +                wp.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW) {              if (wp.token == null) {                  View decor = peekDecorView();                  if (decor != null) { @@ -588,25 +588,38 @@ public abstract class Window {              if (curTitle == null || curTitle.length() == 0) {                  String title;                  if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA) { -                    title="Media"; +                    title = "Media";                  } else if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA_OVERLAY) { -                    title="MediaOvr"; +                    title = "MediaOvr";                  } else if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_PANEL) { -                    title="Panel"; +                    title = "Panel";                  } else if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL) { -                    title="SubPanel"; +                    title = "SubPanel";                  } else if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_ABOVE_SUB_PANEL) { -                    title="AboveSubPanel"; +                    title = "AboveSubPanel";                  } else if (wp.type == WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG) { -                    title="AtchDlg"; +                    title = "AtchDlg";                  } else { -                    title=Integer.toString(wp.type); +                    title = Integer.toString(wp.type);                  }                  if (mAppName != null) {                      title += ":" + mAppName;                  }                  wp.setTitle(title);              } +        } else if (wp.type >= WindowManager.LayoutParams.FIRST_SYSTEM_WINDOW && +                wp.type <= WindowManager.LayoutParams.LAST_SYSTEM_WINDOW) { +            // We don't set the app token to this system window because the life cycles should be +            // independent. If an app creates a system window and then the app goes to the stopped +            // state, the system window should not be affected (can still show and receive input +            // events). +            if (curTitle == null || curTitle.length() == 0) { +                String title = "Sys" + Integer.toString(wp.type); +                if (mAppName != null) { +                    title += ":" + mAppName; +                } +                wp.setTitle(title); +            }          } else {              if (wp.token == null) {                  wp.token = mContainer == null ? mAppToken : mContainer.mAppToken;  |