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

Commit 94cc4ffd authored by Russell Brenner's avatar Russell Brenner Committed by Jessica Wagantall
Browse files

[PATCH 1/2] Block developer settings during SUW

Block access to development settings by tapping on the build number
in "About phone". Once SUW has completed, taps will be allowed.
Ticket: CYNGNOS-1404

Bug: 25290269
Change-Id: I9b2787712237f28fba446abab15a9e1c075d0419
(cherry picked from commit 4836ab6d)
parent f7ff5014
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -309,7 +309,11 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
        mUsbManager = (UsbManager)getActivity().getSystemService(Context.USB_SERVICE);

        if (android.os.Process.myUserHandle().getIdentifier() != UserHandle.USER_OWNER
                || mUm.hasUserRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES)) {
                || mUm.hasUserRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES)
                || Settings.Global.getInt(getActivity().getContentResolver(),
                        Settings.Global.DEVICE_PROVISIONED, 0) == 0) {
            // Block access to developer options if the user is not the owner, if user policy
            // restricts it, or if the device has not been provisioned
            mUnavailable = true;
            setPreferenceScreen(new PreferenceScreen(getActivity(), null));
            return;
+6 −0
Original line number Diff line number Diff line
@@ -262,6 +262,12 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
            // Don't enable developer options for secondary users.
            if (UserHandle.myUserId() != UserHandle.USER_OWNER) return true;

            // Don't enable developer options until device has been provisioned
            if (Settings.Global.getInt(getActivity().getContentResolver(),
                    Settings.Global.DEVICE_PROVISIONED, 0) == 0) {
                return true;
            }

            final UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
            if (um.hasUserRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES)) return true;