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

Commit 2f7cb6b6 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Settings: Requirement for Hardware Interface"

parents b1d602b6 1edd054b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -124,9 +124,13 @@ public class UsbSettings extends SettingsPreferenceFragment {
            Log.d(TAG, "createPreferenceHierarchy mass_storage enabled");
            root.removePreference(mSDCard);
        }

        boolean isSimCardInserted = SystemProperties
                .getBoolean("persist.sys.sim.activate", false);
        boolean isUsbSecurityEnable = SystemProperties
                .getBoolean("persist.sys.usb.security", false);
        UserManager um = (UserManager) getActivity().getSystemService(Context.USER_SERVICE);
        if (um.hasUserRestriction(UserManager.DISALLOW_USB_FILE_TRANSFER)) {
        if (um.hasUserRestriction(UserManager.DISALLOW_USB_FILE_TRANSFER)
                || (!isSimCardInserted && isUsbSecurityEnable)) {
            mMtp.setEnabled(false);
            mPtp.setEnabled(false);
            mSDCard.setEnabled(false);