Merge "Restrict access to dangerous methods to <= P" into qt-dev

This commit is contained in:
TreeHugger Robot
2019-04-22 07:14:10 +00:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 11 deletions

View File

@@ -510,7 +510,7 @@ public class ConnectivityManager {
* The absence of a connection type. * The absence of a connection type.
* @hide * @hide
*/ */
@UnsupportedAppUsage @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
public static final int TYPE_NONE = -1; public static final int TYPE_NONE = -1;
/** /**
@@ -627,7 +627,7 @@ public class ConnectivityManager {
* {@hide} * {@hide}
*/ */
@Deprecated @Deprecated
@UnsupportedAppUsage @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
public static final int TYPE_MOBILE_FOTA = 10; public static final int TYPE_MOBILE_FOTA = 10;
/** /**
@@ -645,7 +645,7 @@ public class ConnectivityManager {
* {@hide} * {@hide}
*/ */
@Deprecated @Deprecated
@UnsupportedAppUsage @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
public static final int TYPE_MOBILE_CBS = 12; public static final int TYPE_MOBILE_CBS = 12;
/** /**
@@ -655,7 +655,7 @@ public class ConnectivityManager {
* {@hide} * {@hide}
*/ */
@Deprecated @Deprecated
@UnsupportedAppUsage @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
public static final int TYPE_WIFI_P2P = 13; public static final int TYPE_WIFI_P2P = 13;
/** /**
@@ -674,7 +674,7 @@ public class ConnectivityManager {
* {@hide} * {@hide}
*/ */
@Deprecated @Deprecated
@UnsupportedAppUsage @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
public static final int TYPE_MOBILE_EMERGENCY = 15; 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; 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; private final IConnectivityManager mService;
/** /**
* A kludge to facilitate static access where a Context pointer isn't available, like in the * A kludge to facilitate static access where a Context pointer isn't available, like in the
@@ -867,7 +867,7 @@ public class ConnectivityManager {
* {@hide} * {@hide}
*/ */
@Deprecated @Deprecated
@UnsupportedAppUsage @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
public static boolean isNetworkTypeMobile(int networkType) { public static boolean isNetworkTypeMobile(int networkType) {
switch (networkType) { switch (networkType) {
case TYPE_MOBILE: case TYPE_MOBILE:
@@ -1304,7 +1304,7 @@ public class ConnectivityManager {
*/ */
@Deprecated @Deprecated
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
@UnsupportedAppUsage @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
public LinkProperties getLinkProperties(int networkType) { public LinkProperties getLinkProperties(int networkType) {
try { try {
return mService.getLinkPropertiesForType(networkType); return mService.getLinkPropertiesForType(networkType);
@@ -3042,7 +3042,7 @@ public class ConnectivityManager {
*/ */
@Deprecated @Deprecated
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
@UnsupportedAppUsage @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
public boolean isNetworkSupported(int networkType) { public boolean isNetworkSupported(int networkType) {
try { try {
return mService.isNetworkSupported(networkType); return mService.isNetworkSupported(networkType);

View File

@@ -25,6 +25,7 @@ import android.app.backup.BackupManager;
import android.app.usage.NetworkStatsManager; import android.app.usage.NetworkStatsManager;
import android.content.Context; import android.content.Context;
import android.media.MediaPlayer; import android.media.MediaPlayer;
import android.os.Build;
import android.os.RemoteException; import android.os.RemoteException;
import android.os.ServiceManager; import android.os.ServiceManager;
import android.util.DataUnit; import android.util.DataUnit;
@@ -169,7 +170,7 @@ public class TrafficStats {
private static INetworkStatsService sStatsService; private static INetworkStatsService sStatsService;
@UnsupportedAppUsage @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
private synchronized static INetworkStatsService getStatsService() { private synchronized static INetworkStatsService getStatsService() {
if (sStatsService == null) { if (sStatsService == null) {
sStatsService = INetworkStatsService.Stub.asInterface( sStatsService = INetworkStatsService.Stub.asInterface(
@@ -979,7 +980,7 @@ public class TrafficStats {
* Interfaces are never removed from this list, so counters should always be * Interfaces are never removed from this list, so counters should always be
* monotonic. * monotonic.
*/ */
@UnsupportedAppUsage @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 130143562)
private static String[] getMobileIfaces() { private static String[] getMobileIfaces() {
try { try {
return getStatsService().getMobileIfaces(); return getStatsService().getMobileIfaces();