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

Commit 4a3331c8 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 176aad5f f149e793
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -135,6 +135,7 @@ aconfig_declarations_group {
        "surfaceflinger_flags_java_lib",
        "telecom_flags_core_java_lib",
        "telephony_flags_core_java_lib",
        "wifi_framework_aconfig_flags_lib",
        // !!! KEEP THIS LIST ALPHABETICAL !!!
    ],
}
+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("com.android.wifi.flags.multi_user_wifi_enhancement") public static final String DISALLOW_CONFIG_WIFI_PRIVATE = "no_config_wifi_private";
    field @FlaggedApi("com.android.wifi.flags.multi_user_wifi_enhancement") public static final String DISALLOW_CONFIG_WIFI_SHARED = "no_config_wifi_shared";
  }

}

package android.os.storage {
+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
     */
    @FlaggedApi(com.android.wifi.flags.Flags.FLAG_MULTI_USER_WIFI_ENHANCEMENT)
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    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
     */
    @FlaggedApi(com.android.wifi.flags.Flags.FLAG_MULTI_USER_WIFI_ENHANCEMENT)
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    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,