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

Commit 0e9eb9c7 authored by Yi Shiou (Les) Lee's avatar Yi Shiou (Les) Lee Committed by Android (Google) Code Review
Browse files

Merge "wifi: Add new user restrictions" into main

parents ead43373 5263c807
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -1075,6 +1075,7 @@ java_aconfig_library {
// Multi user
aconfig_declarations {
    name: "android.multiuser.flags-aconfig",
    exportable: true,
    package: "android.multiuser",
    container: "system",
    srcs: ["core/java/android/content/pm/multiuser.aconfig"],
@@ -1087,6 +1088,18 @@ java_aconfig_library {
    min_sdk_version: "30",
}

java_aconfig_library {
    name: "android.multiuser.flags-aconfig-java-export",
    aconfig_declarations: "android.multiuser.flags-aconfig",
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
    mode: "exported",
    apex_available: [
        "//apex_available:platform",
        "com.android.wifi",
    ],
    min_sdk_version: "30",
}

// XR
aconfig_declarations {
    name: "android.xr.flags-aconfig",
+5 −0
Original line number Diff line number Diff line
@@ -503,6 +503,11 @@ package android.os {
    method @FlaggedApi("android.os.update_engine_api") public void triggerPostinstall(@NonNull String);
  }

  public class UserManager {
    field @FlaggedApi("android.multiuser.user_restriction_config_wifi_shared_private") public static final String DISALLOW_CONFIG_WIFI_PRIVATE = "no_config_wifi_private";
    field @FlaggedApi("android.multiuser.user_restriction_config_wifi_shared_private") public static final String DISALLOW_CONFIG_WIFI_SHARED = "no_config_wifi_shared";
  }

}

package android.os.storage {
+8 −0
Original line number Diff line number Diff line
@@ -485,3 +485,11 @@ flag {
     description: "Disallow the removal of a user, if it is the last admin user"
     bug: "394970894"
}

flag {
     name: "user_restriction_config_wifi_shared_private"
     is_exported: true
     namespace: "multiuser"
     description: "For user restrictions about adding or editing shared or private Wi-Fi configurations"
     bug: "390240471"
}
+44 −0
Original line number Diff line number Diff line
@@ -345,6 +345,50 @@ public class UserManager {
     */
    public static final String DISALLOW_CONFIG_WIFI = "no_config_wifi";

    /**
     * Specifies if a user is disallowed from adding or editing private Wi-Fi configurations,
     * that is, Wi-Fi configurations that are not shared with other users.
     *
     * Use {@link #DISALLOW_CONFIG_WIFI} if all types of Wi-Fi configurations are disallowed to
     * be added or edited.
     *
     * Note: This restriction is used for system only, it can't be used via
     * the DevicePolicyManager APIs.
     *
     * <p>The default value is <code>false</code>.
     *
     * <p>Key for user restrictions.
     * <p>Type: Boolean
     * @see #getUserRestrictions()
     *
     * @hide
     */
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    @FlaggedApi(android.multiuser.Flags.FLAG_USER_RESTRICTION_CONFIG_WIFI_SHARED_PRIVATE)
    public static final String DISALLOW_CONFIG_WIFI_PRIVATE = "no_config_wifi_private";

    /**
     * Specifies if a user is disallowed from adding or editing shared Wi-Fi configurations,
     * that is, Wi-Fi configurations that are shared with other users.
     *
     * Use {@link #DISALLOW_CONFIG_WIFI} if all types of Wi-Fi configurations are disallowed
     * to be added or edited.
     *
     * Note: This restriction is used for system only, it can't be used via
     * the DevicePolicyManager APIs.
     *
     * <p>The default value is <code>false</code>.
     *
     * <p>Key for user restrictions.
     * <p>Type: Boolean
     * @see #getUserRestrictions()
     *
     * @hide
     */
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    @FlaggedApi(android.multiuser.Flags.FLAG_USER_RESTRICTION_CONFIG_WIFI_SHARED_PRIVATE)
    public static final String DISALLOW_CONFIG_WIFI_SHARED = "no_config_wifi_shared";

    /**
     * Specifies if a user is disallowed from enabling/disabling Wi-Fi.
     *
+2 −0
Original line number Diff line number Diff line
@@ -80,6 +80,8 @@ public class UserRestrictionsUtils {

    public static final Set<String> USER_RESTRICTIONS = newSetWithUniqueCheck(new String[] {
            UserManager.DISALLOW_CONFIG_WIFI,
            UserManager.DISALLOW_CONFIG_WIFI_PRIVATE,
            UserManager.DISALLOW_CONFIG_WIFI_SHARED,
            UserManager.DISALLOW_CONFIG_LOCALE,
            UserManager.DISALLOW_MODIFY_ACCOUNTS,
            UserManager.DISALLOW_INSTALL_APPS,