diff options
author | Wale Ogunwale <ogunwale@google.com> | 2015-01-13 20:32:07 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-01-13 20:32:07 +0000 |
commit | 3c0e7e908f1f90677ae3937199e37c162f81b2f9 (patch) | |
tree | 0414d5d660f209efe8d0f6ceccf4c8f0338583b5 /policy | |
parent | 07b4bfac5d45585953353b54758d89b40e2ec077 (diff) | |
parent | 00c8565614d3555e723ff3d8dad3af92d69d81ea (diff) | |
download | frameworks_base-3c0e7e908f1f90677ae3937199e37c162f81b2f9.zip frameworks_base-3c0e7e908f1f90677ae3937199e37c162f81b2f9.tar.gz frameworks_base-3c0e7e908f1f90677ae3937199e37c162f81b2f9.tar.bz2 |
am 00c85656: am 42b0d10a: am 1ea6afe1: Merge "Don\'t allow windows with invalid types to be added." into lmp-mr1-dev
* commit '00c8565614d3555e723ff3d8dad3af92d69d81ea':
Don't allow windows with invalid types to be added.
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index f8c630e..7124e5b 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -1641,8 +1641,14 @@ public class PhoneWindowManager implements WindowManagerPolicy { outAppOp[0] = AppOpsManager.OP_NONE; - if (type < WindowManager.LayoutParams.FIRST_SYSTEM_WINDOW - || type > WindowManager.LayoutParams.LAST_SYSTEM_WINDOW) { + if (!((type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) + || (type >= FIRST_SUB_WINDOW && type <= LAST_SUB_WINDOW) + || (type >= FIRST_SYSTEM_WINDOW && type <= LAST_SYSTEM_WINDOW))) { + return WindowManagerGlobal.ADD_INVALID_TYPE; + } + + if (type < FIRST_SYSTEM_WINDOW || type > LAST_SYSTEM_WINDOW) { + // Window manager will make sure these are okay. return WindowManagerGlobal.ADD_OKAY; } String permission = null; |