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
This commit is contained in:
Benjamin Franz
2016-07-12 15:20:47 +01:00
parent d061c3abfa
commit 7fbb93d4aa

View File

@@ -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;
@@ -7612,6 +7613,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);