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

Commit bbc3045a authored by rich cannings's avatar rich cannings
Browse files

Ability to hide verification settings

Add a setting that controls the visibility of the package verification
setting in the Settings app.

Bug:7022814
Change-Id: I6e503924adc112b4528d94b1e533baae6079e85e
parent 38305fb1
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -245,6 +245,7 @@ public class SecuritySettings extends SettingsPreferenceFragment
        mToggleAppInstallation.setChecked(isNonMarketAppsAllowed());

        // Package verification
        if (showVerifierSetting()) {
            mToggleVerifyApps = (CheckBoxPreference) findPreference(KEY_TOGGLE_VERIFY_APPLICATIONS);
            if (isVerifierInstalled()) {
                mToggleVerifyApps.setChecked(isVerifyAppsEnabled());
@@ -252,6 +253,7 @@ public class SecuritySettings extends SettingsPreferenceFragment
                mToggleVerifyApps.setChecked(false);
                mToggleVerifyApps.setEnabled(false);
            }
        }

        mUserSelectedWidget = root.findPreference(KEY_CHOOSE_USER_SELECTED_LOCKSCREEN_WIDGET);
        if (mUserSelectedWidget != null) {
@@ -300,6 +302,11 @@ public class SecuritySettings extends SettingsPreferenceFragment
        return (receivers.size() > 0) ? true : false;
    }

    private boolean showVerifierSetting() {
        return Settings.Global.getInt(getContentResolver(),
                                      Settings.Global.PACKAGE_VERIFIER_SETTING_VISIBLE, 1) > 0;
    }

    private void warnAppInstallation() {
        // TODO: DialogFragment?
        mWarnInstallApps = new AlertDialog.Builder(getActivity()).setTitle(