Merge "Ability for DPM to specify fallback mechanism"

This commit is contained in:
Sooraj Sasindran
2022-01-13 17:24:07 +00:00
committed by Gerrit Code Review
6 changed files with 149 additions and 49 deletions

View File

@@ -1078,7 +1078,8 @@ public class ConnectivityManager {
}
/**
* Preference for {@link #setNetworkPreferenceForUser(UserHandle, int, Executor, Runnable)}.
* Preference for {@link ProfileNetworkPreference#setPreference(int)}.
* {@see #setProfileNetworkPreferences(UserHandle, List, Executor, Runnable)}
* Specify that the traffic for this user should by follow the default rules.
* @hide
*/
@@ -1086,7 +1087,8 @@ public class ConnectivityManager {
public static final int PROFILE_NETWORK_PREFERENCE_DEFAULT = 0;
/**
* Preference for {@link #setNetworkPreferenceForUser(UserHandle, int, Executor, Runnable)}.
* Preference for {@link ProfileNetworkPreference#setPreference(int)}.
* {@see #setProfileNetworkPreferences(UserHandle, List, Executor, Runnable)}
* Specify that the traffic for this user should by default go on a network with
* {@link NetworkCapabilities#NET_CAPABILITY_ENTERPRISE}, and on the system default network
* if no such network is available.
@@ -1095,11 +1097,23 @@ public class ConnectivityManager {
@SystemApi(client = MODULE_LIBRARIES)
public static final int PROFILE_NETWORK_PREFERENCE_ENTERPRISE = 1;
/**
* Preference for {@link ProfileNetworkPreference#setPreference(int)}.
* {@see #setProfileNetworkPreferences(UserHandle, List, Executor, Runnable)}
* Specify that the traffic for this user should by default go on a network with
* {@link NetworkCapabilities#NET_CAPABILITY_ENTERPRISE} and if no such network is available
* should not go on the system default network
* @hide
*/
@SystemApi(client = MODULE_LIBRARIES)
public static final int PROFILE_NETWORK_PREFERENCE_ENTERPRISE_NO_FALLBACK = 2;
/** @hide */
@Retention(RetentionPolicy.SOURCE)
@IntDef(value = {
PROFILE_NETWORK_PREFERENCE_DEFAULT,
PROFILE_NETWORK_PREFERENCE_ENTERPRISE
PROFILE_NETWORK_PREFERENCE_ENTERPRISE,
PROFILE_NETWORK_PREFERENCE_ENTERPRISE_NO_FALLBACK
})
public @interface ProfileNetworkPreferencePolicy {
}