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

Commit 4836ab6d authored by Russell Brenner's avatar Russell Brenner
Browse files

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.

Bug: 25290269
Change-Id: I9b2787712237f28fba446abab15a9e1c075d0419
parent 26bb544f
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -259,7 +259,11 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
        mWifiManager = (WifiManager) getSystemService(Context.WIFI_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
@@ -209,6 +209,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;