Restrict access to dangerous methods to <= P
Test: make Fixes: 130143562 Change-Id: I1a6a472f83cf00a1ab174a9c5e67d3e9357a0c45 Merged-In: I95107f7b628eecb54e9f4411785186b668e9f3d8 Merged-In: I890030580fdad45c3f8589bf6adbe5798d578cfe (cherry picked from commit 0bb53dbb64bbc937a23e1dc7641c8988a6d11d64)
This commit is contained in:
@@ -510,7 +510,7 @@ public class ConnectivityManager {
|
||||
* The absence of a connection type.
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
|
||||
public static final int TYPE_NONE = -1;
|
||||
|
||||
/**
|
||||
@@ -627,7 +627,7 @@ public class ConnectivityManager {
|
||||
* {@hide}
|
||||
*/
|
||||
@Deprecated
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
|
||||
public static final int TYPE_MOBILE_FOTA = 10;
|
||||
|
||||
/**
|
||||
@@ -645,7 +645,7 @@ public class ConnectivityManager {
|
||||
* {@hide}
|
||||
*/
|
||||
@Deprecated
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
|
||||
public static final int TYPE_MOBILE_CBS = 12;
|
||||
|
||||
/**
|
||||
@@ -655,7 +655,7 @@ public class ConnectivityManager {
|
||||
* {@hide}
|
||||
*/
|
||||
@Deprecated
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
|
||||
public static final int TYPE_WIFI_P2P = 13;
|
||||
|
||||
/**
|
||||
@@ -674,7 +674,7 @@ public class ConnectivityManager {
|
||||
* {@hide}
|
||||
*/
|
||||
@Deprecated
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
|
||||
public static final int TYPE_MOBILE_EMERGENCY = 15;
|
||||
|
||||
/**
|
||||
@@ -775,7 +775,7 @@ public class ConnectivityManager {
|
||||
*/
|
||||
public static final String PRIVATE_DNS_DEFAULT_MODE_FALLBACK = PRIVATE_DNS_MODE_OPPORTUNISTIC;
|
||||
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
|
||||
private final IConnectivityManager mService;
|
||||
/**
|
||||
* A kludge to facilitate static access where a Context pointer isn't available, like in the
|
||||
@@ -867,7 +867,7 @@ public class ConnectivityManager {
|
||||
* {@hide}
|
||||
*/
|
||||
@Deprecated
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
|
||||
public static boolean isNetworkTypeMobile(int networkType) {
|
||||
switch (networkType) {
|
||||
case TYPE_MOBILE:
|
||||
@@ -1304,7 +1304,7 @@ public class ConnectivityManager {
|
||||
*/
|
||||
@Deprecated
|
||||
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
|
||||
public LinkProperties getLinkProperties(int networkType) {
|
||||
try {
|
||||
return mService.getLinkPropertiesForType(networkType);
|
||||
@@ -3042,7 +3042,7 @@ public class ConnectivityManager {
|
||||
*/
|
||||
@Deprecated
|
||||
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
||||
@UnsupportedAppUsage
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
|
||||
public boolean isNetworkSupported(int networkType) {
|
||||
try {
|
||||
return mService.isNetworkSupported(networkType);
|
||||
|
||||
Reference in New Issue
Block a user