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

Commit 7cc2c4c2 authored by yuemingw's avatar yuemingw Committed by Yueming Wang
Browse files

Add DISALLOW_CONFIG_LOCATION_MODE.

Bug: 67674888
Test: cts test will be added in b/67674901

Design doc: https://docs.google.com/document/d/1rvEg5jE3lMhjH-OA0iTLBUY2opM96fg7BrP81MoPnmg/edit#

Change-Id: I284d421eedfb238084fa61e7661638c22b28734f
parent fd88d435
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -32279,6 +32279,7 @@ package android.os {
    field public static final java.lang.String DISALLOW_CONFIG_CREDENTIALS = "no_config_credentials";
    field public static final java.lang.String DISALLOW_CONFIG_DATE_TIME = "no_config_date_time";
    field public static final java.lang.String DISALLOW_CONFIG_LOCALE = "no_config_locale";
    field public static final java.lang.String DISALLOW_CONFIG_LOCATION_MODE = "no_config_location_mode";
    field public static final java.lang.String DISALLOW_CONFIG_MOBILE_NETWORKS = "no_config_mobile_networks";
    field public static final java.lang.String DISALLOW_CONFIG_TETHERING = "no_config_tethering";
    field public static final java.lang.String DISALLOW_CONFIG_VPN = "no_config_vpn";
+22 −0
Original line number Diff line number Diff line
@@ -334,6 +334,28 @@ public class UserManager {
     */
    public static final String DISALLOW_CONFIG_VPN = "no_config_vpn";

    /**
     * Specifies if a user is disallowed from configuring location mode. Device owner and profile
     * owners can set this restriction and it only applies on the managed user.
     *
     * <p>In a managed profile, location sharing is forced off when it's off on primary user, so
     * user can still turn off location sharing on managed profile when the restriction is set by
     * profile owner on managed profile.
     *
     * <p>This user restriction is different from {@link #DISALLOW_SHARE_LOCATION},
     * as the device owner or profile owner can still enable or disable location mode via
     * {@link DevicePolicyManager#setSecureSetting} when this restriction is on.
     *
     * <p>The default value is <code>false</code>.
     *
     * <p>Key for user restrictions.
     * <p>Type: Boolean
     * @see DevicePolicyManager#addUserRestriction(ComponentName, String)
     * @see DevicePolicyManager#clearUserRestriction(ComponentName, String)
     * @see #getUserRestrictions()
     */
    public static final String DISALLOW_CONFIG_LOCATION_MODE = "no_config_location_mode";

    /**
     * Specifies if date, time and timezone configuring is disallowed.
     *
+1 −0
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@ public class UserRestrictionsUtils {
            UserManager.DISALLOW_AUTOFILL,
            UserManager.DISALLOW_USER_SWITCH,
            UserManager.DISALLOW_UNIFIED_PASSWORD,
            UserManager.DISALLOW_CONFIG_LOCATION_MODE
    });

    /**