Opt-out for always-on VPN: rename API.
Rename the opt-out flag in AndroidManifest to SERVICE_META_DATA_SUPPORTS_ALWAYS_ON as directed by the API Council. Bug: 64331776 Bug: 36650087 Test: runtest --path java/com/android/server/connectivity/VpnTest.java Change-Id: I24326fad7a89083a2409134640bda81ee0359d08
This commit is contained in:
@@ -840,8 +840,8 @@ public class ConnectivityManager {
|
|||||||
* In order to support the always-on feature, an app has to
|
* In order to support the always-on feature, an app has to
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>target {@link VERSION_CODES#N API 24} or above, and
|
* <li>target {@link VERSION_CODES#N API 24} or above, and
|
||||||
* <li>not opt out through the {@link VpnService#METADATA_SUPPORTS_ALWAYS_ON} meta-data
|
* <li>not opt out through the {@link VpnService#SERVICE_META_DATA_SUPPORTS_ALWAYS_ON}
|
||||||
* field.
|
* meta-data field.
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @param userId The identifier of the user for whom the VPN app is installed.
|
* @param userId The identifier of the user for whom the VPN app is installed.
|
||||||
|
|||||||
@@ -346,7 +346,7 @@ public class VpnTest extends AndroidTestCase {
|
|||||||
// Apps that opt out explicitly are not supported
|
// Apps that opt out explicitly are not supported
|
||||||
appInfo.targetSdkVersion = VERSION_CODES.CUR_DEVELOPMENT;
|
appInfo.targetSdkVersion = VERSION_CODES.CUR_DEVELOPMENT;
|
||||||
Bundle metaData = new Bundle();
|
Bundle metaData = new Bundle();
|
||||||
metaData.putBoolean(VpnService.METADATA_SUPPORTS_ALWAYS_ON, false);
|
metaData.putBoolean(VpnService.SERVICE_META_DATA_SUPPORTS_ALWAYS_ON, false);
|
||||||
svcInfo.metaData = metaData;
|
svcInfo.metaData = metaData;
|
||||||
assertFalse(vpn.isAlwaysOnPackageSupported(PKGS[0]));
|
assertFalse(vpn.isAlwaysOnPackageSupported(PKGS[0]));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user