diff options
author | Benjamin Franz <bfranz@google.com> | 2016-07-12 15:20:47 +0100 |
---|---|---|
committer | gitbuildkicker <android-build@google.com> | 2016-08-16 15:52:28 -0700 |
commit | a2041d6b45615c076a182da088d6ca1e0c53ee40 (patch) | |
tree | db1bd8656de1566b8429a77fc5f84d008b312b3e /services | |
parent | 637501e9f6fdade50e2e64a227c402dc9e7f301d (diff) | |
download | frameworks_base-a2041d6b45615c076a182da088d6ca1e0c53ee40.zip frameworks_base-a2041d6b45615c076a182da088d6ca1e0c53ee40.tar.gz frameworks_base-a2041d6b45615c076a182da088d6ca1e0c53ee40.tar.bz2 |
DO NOT MERGE Block the user from entering safe boot mode
Block the user from entering safe boot mode if the DISALLOW_SAFE_BOOT
policy is set.
Bug: 26251884
Change-Id: I4945d5d676928346c11ea305a5b6a2e1a42e94e6
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/wm/WindowManagerService.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 71bbdb6..d695d93 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -65,6 +65,7 @@ import android.os.SystemProperties; import android.os.SystemService; import android.os.Trace; import android.os.UserHandle; +import android.os.UserManager; import android.os.WorkSource; import android.provider.Settings; import android.util.ArraySet; @@ -7613,6 +7614,12 @@ public class WindowManagerService extends IWindowManager.Stub + " milliseconds before attempting to detect safe mode."); } + UserManager um = (UserManager) mContext.getSystemService(Context.USER_SERVICE); + if (um != null && um.hasUserRestriction(UserManager.DISALLOW_SAFE_BOOT)) { + mSafeMode = false; + return false; + } + int menuState = mInputManager.getKeyCodeState(-1, InputDevice.SOURCE_ANY, KeyEvent.KEYCODE_MENU); int sState = mInputManager.getKeyCodeState(-1, InputDevice.SOURCE_ANY, KeyEvent.KEYCODE_S); |