Merge "Exposed some testAPIs in NetworkPolicyManager" am: 4338d7f97a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1585006 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I823a2663e5ea6fee8d71a3ed60a320fb1a00cd51
This commit is contained in:
@@ -990,6 +990,12 @@ package android.net {
|
|||||||
field public static final int INVALID_SECURITY_PARAMETER_INDEX = 0; // 0x0
|
field public static final int INVALID_SECURITY_PARAMETER_INDEX = 0; // 0x0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class NetworkPolicyManager {
|
||||||
|
method public boolean getRestrictBackground();
|
||||||
|
method @NonNull public static String resolveNetworkId(@NonNull android.net.wifi.WifiConfiguration);
|
||||||
|
method public void setRestrictBackground(boolean);
|
||||||
|
}
|
||||||
|
|
||||||
public class NetworkStack {
|
public class NetworkStack {
|
||||||
method public static void setServiceForTest(@Nullable android.os.IBinder);
|
method public static void setServiceForTest(@Nullable android.os.IBinder);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -483,6 +483,8 @@ GetterSetterNames: android.location.LocationRequest#isLocationSettingsIgnored():
|
|||||||
|
|
||||||
GetterSetterNames: android.location.LocationRequest#isLowPowerMode():
|
GetterSetterNames: android.location.LocationRequest#isLowPowerMode():
|
||||||
|
|
||||||
|
GetterSetterNames: android.net.NetworkPolicyManager#getRestrictBackground():
|
||||||
|
Symmetric method for `setRestrictBackground` must be named `isRestrictBackground`; was `getRestrictBackground`
|
||||||
GetterSetterNames: android.os.IncidentReportArgs#isAll():
|
GetterSetterNames: android.os.IncidentReportArgs#isAll():
|
||||||
|
|
||||||
GetterSetterNames: android.service.notification.NotificationStats#setDirectReplied():
|
GetterSetterNames: android.service.notification.NotificationStats#setDirectReplied():
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import android.annotation.IntDef;
|
|||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.RequiresPermission;
|
import android.annotation.RequiresPermission;
|
||||||
import android.annotation.SystemService;
|
import android.annotation.SystemService;
|
||||||
|
import android.annotation.TestApi;
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import android.compat.annotation.UnsupportedAppUsage;
|
import android.compat.annotation.UnsupportedAppUsage;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -55,6 +56,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@TestApi
|
||||||
@SystemService(Context.NETWORK_POLICY_SERVICE)
|
@SystemService(Context.NETWORK_POLICY_SERVICE)
|
||||||
public class NetworkPolicyManager {
|
public class NetworkPolicyManager {
|
||||||
|
|
||||||
@@ -125,6 +127,7 @@ public class NetworkPolicyManager {
|
|||||||
public static final int RULE_REJECT_ALL = 1 << 6;
|
public static final int RULE_REJECT_ALL = 1 << 6;
|
||||||
/**
|
/**
|
||||||
* Reject traffic on all networks for restricted networking mode.
|
* Reject traffic on all networks for restricted networking mode.
|
||||||
|
* @hide
|
||||||
*/
|
*/
|
||||||
public static final int RULE_REJECT_RESTRICTED_MODE = 1 << 10;
|
public static final int RULE_REJECT_RESTRICTED_MODE = 1 << 10;
|
||||||
|
|
||||||
@@ -351,6 +354,7 @@ public class NetworkPolicyManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
|
@TestApi
|
||||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||||
public void setRestrictBackground(boolean restrictBackground) {
|
public void setRestrictBackground(boolean restrictBackground) {
|
||||||
try {
|
try {
|
||||||
@@ -361,6 +365,7 @@ public class NetworkPolicyManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
|
@TestApi
|
||||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||||
public boolean getRestrictBackground() {
|
public boolean getRestrictBackground() {
|
||||||
try {
|
try {
|
||||||
@@ -506,6 +511,8 @@ public class NetworkPolicyManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get multipath preference for the given network.
|
* Get multipath preference for the given network.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
*/
|
*/
|
||||||
public int getMultipathPreference(Network network) {
|
public int getMultipathPreference(Network network) {
|
||||||
try {
|
try {
|
||||||
@@ -624,7 +631,9 @@ public class NetworkPolicyManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public static String resolveNetworkId(WifiConfiguration config) {
|
@TestApi
|
||||||
|
@NonNull
|
||||||
|
public static String resolveNetworkId(@NonNull WifiConfiguration config) {
|
||||||
return WifiInfo.sanitizeSsid(config.isPasspoint()
|
return WifiInfo.sanitizeSsid(config.isPasspoint()
|
||||||
? config.providerFriendlyName : config.SSID);
|
? config.providerFriendlyName : config.SSID);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user