Skip to content

Commit 69729fa

Browse files
bfranzgitbuildkicker
authored andcommitted
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
1 parent f0ea4c8 commit 69729fa

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

services/core/java/com/android/server/wm/WindowManagerService.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
import android.os.SystemService;
6666
import android.os.Trace;
6767
import android.os.UserHandle;
68+
import android.os.UserManager;
6869
import android.os.WorkSource;
6970
import android.provider.Settings;
7071
import android.util.ArraySet;
@@ -7613,6 +7614,12 @@ public boolean detectSafeMode() {
76137614
+ " milliseconds before attempting to detect safe mode.");
76147615
}
76157616

7617+
UserManager um = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
7618+
if (um != null && um.hasUserRestriction(UserManager.DISALLOW_SAFE_BOOT)) {
7619+
mSafeMode = false;
7620+
return false;
7621+
}
7622+
76167623
int menuState = mInputManager.getKeyCodeState(-1, InputDevice.SOURCE_ANY,
76177624
KeyEvent.KEYCODE_MENU);
76187625
int sState = mInputManager.getKeyCodeState(-1, InputDevice.SOURCE_ANY, KeyEvent.KEYCODE_S);

0 commit comments

Comments
 (0)