Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 830213cf authored by Benjamin Franz's avatar Benjamin Franz Committed by Jessica Wagantall
Browse files

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.

CYNGNOS-3235
Bug: 26251884
Change-Id: I4945d5d676928346c11ea305a5b6a2e1a42e94e6
(cherry picked from commit 7fbb93d4)
(cherry picked from commit 96bfee4f)
parent d1067d5a
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -66,6 +66,7 @@ import android.os.SystemProperties;
import android.os.SystemService;
import android.os.SystemService;
import android.os.Trace;
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.WorkSource;
import android.os.WorkSource;
import android.provider.Settings;
import android.provider.Settings;
import android.util.ArraySet;
import android.util.ArraySet;
@@ -7687,6 +7688,12 @@ public class WindowManagerService extends IWindowManager.Stub
                   + " milliseconds before attempting to detect safe mode.");
                   + " 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,
        int menuState = mInputManager.getKeyCodeState(-1, InputDevice.SOURCE_ANY,
                KeyEvent.KEYCODE_MENU);
                KeyEvent.KEYCODE_MENU);
        int sState = mInputManager.getKeyCodeState(-1, InputDevice.SOURCE_ANY, KeyEvent.KEYCODE_S);
        int sState = mInputManager.getKeyCodeState(-1, InputDevice.SOURCE_ANY, KeyEvent.KEYCODE_S);