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

Commit dd1e1e1d authored by Ben Lin's avatar Ben Lin
Browse files

Introduce boolean flags to show/hide items in Security & location.

This adds 6 new boolean flags:
config_show_manage_device_admin
config_show_unlock_set_or_change
config_show_screen_pinning_settings
config_show_manage_trust_agents
config_show_show_password
config_show_trust_agent_click_intent

Which when individually set to false, will hide the item from "Security
& location". It will also hide them from surfacing in search results.

Bug:62379222
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=com.android.settings.security
Change-Id: I58d82cbc7f366a9666cdb0f7cd1b90ebbaf418f4
parent 7817a16c
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -120,6 +120,24 @@
    <!-- Whether vibrate_input_devices should be shown or not. -->
    <bool name="config_show_vibrate_input_devices">true</bool>

    <!-- Whether manage_device_admin should be shown or not. -->
    <bool name="config_show_manage_device_admin">true</bool>

    <!-- Whether unlock_set_or_change should be shown or not. -->
    <bool name="config_show_unlock_set_or_change">true</bool>

    <!-- Whether screen_pinning_settings should be shown or not. -->
    <bool name="config_show_screen_pinning_settings">true</bool>

    <!-- Whether manage_trust_agents should be shown or not. -->
    <bool name="config_show_manage_trust_agents">true</bool>

    <!-- Whether show_password should be shown or not. -->
    <bool name="config_show_show_password">true</bool>

    <!-- Whether trust_agent_click_intent should be shown or not. -->
    <bool name="config_show_trust_agent_click_intent">true</bool>

    <!-- Whether wallpaper attribution should be shown or not. -->
    <bool name="config_show_wallpaper_attribution">true</bool>

+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ public class ManageDeviceAdminPreferenceController extends AbstractPreferenceCon

    @Override
    public boolean isAvailable() {
        return true;
        return mContext.getResources().getBoolean(R.bool.config_show_manage_device_admin);
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ public class ChangeScreenLockPreferenceController extends AbstractPreferenceCont

    @Override
    public boolean isAvailable() {
        return true;
        return mContext.getResources().getBoolean(R.bool.config_show_unlock_set_or_change);
    }

    @Override
+2 −1
Original line number Diff line number Diff line
@@ -33,7 +33,8 @@ public class ScreenPinningPreferenceController extends BasePreferenceController

    @Override
    public int getAvailabilityStatus() {
        return AVAILABLE;
        return mContext.getResources().getBoolean(R.bool.config_show_screen_pinning_settings)
                ? AVAILABLE : DISABLED_UNSUPPORTED;
    }

    @Override
+4 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.provider.Settings;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.core.TogglePreferenceController;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.R;

public class ShowPasswordPreferenceController extends TogglePreferenceController {

@@ -53,7 +54,9 @@ public class ShowPasswordPreferenceController extends TogglePreferenceController

    @Override
    public int getAvailabilityStatus() {
        return AVAILABLE;
        return mContext.getResources().getBoolean(R.bool.config_show_show_password)
                ? AVAILABLE : DISABLED_UNSUPPORTED;
    }

}
Loading