Merge "Skip sending VpnManager events for Settings VPNs" into tm-dev am: fab86f9cce

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19415033

Change-Id: Ibcd0e3a4bc7038438c79172ee47038599dda1611
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-08-19 16:14:12 +00:00
committed by Automerger Merge Worker

View File

@@ -2944,7 +2944,7 @@ public class Vpn {
// All the above failures are configuration errors, and are terminal // All the above failures are configuration errors, and are terminal
// TODO(b/230548427): Remove SDK check once VPN related stuff are // TODO(b/230548427): Remove SDK check once VPN related stuff are
// decoupled from ConnectivityServiceTest. // decoupled from ConnectivityServiceTest.
if (SdkLevel.isAtLeastT()) { if (SdkLevel.isAtLeastT() && isVpnApp(mPackage)) {
sendEventToVpnManagerApp(VpnManager.CATEGORY_EVENT_IKE_ERROR, sendEventToVpnManagerApp(VpnManager.CATEGORY_EVENT_IKE_ERROR,
VpnManager.ERROR_CLASS_NOT_RECOVERABLE, VpnManager.ERROR_CLASS_NOT_RECOVERABLE,
ikeException.getErrorType(), ikeException.getErrorType(),
@@ -2962,7 +2962,7 @@ public class Vpn {
// All the above failures are configuration errors, and are terminal // All the above failures are configuration errors, and are terminal
// TODO(b/230548427): Remove SDK check once VPN related stuff are // TODO(b/230548427): Remove SDK check once VPN related stuff are
// decoupled from ConnectivityServiceTest. // decoupled from ConnectivityServiceTest.
if (SdkLevel.isAtLeastT()) { if (SdkLevel.isAtLeastT() && isVpnApp(mPackage)) {
sendEventToVpnManagerApp(VpnManager.CATEGORY_EVENT_IKE_ERROR, sendEventToVpnManagerApp(VpnManager.CATEGORY_EVENT_IKE_ERROR,
VpnManager.ERROR_CLASS_RECOVERABLE, VpnManager.ERROR_CLASS_RECOVERABLE,
ikeException.getErrorType(), ikeException.getErrorType(),
@@ -2981,7 +2981,7 @@ public class Vpn {
} else if (exception instanceof IkeNetworkLostException) { } else if (exception instanceof IkeNetworkLostException) {
// TODO(b/230548427): Remove SDK check once VPN related stuff are // TODO(b/230548427): Remove SDK check once VPN related stuff are
// decoupled from ConnectivityServiceTest. // decoupled from ConnectivityServiceTest.
if (SdkLevel.isAtLeastT()) { if (SdkLevel.isAtLeastT() && isVpnApp(mPackage)) {
sendEventToVpnManagerApp(VpnManager.CATEGORY_EVENT_NETWORK_ERROR, sendEventToVpnManagerApp(VpnManager.CATEGORY_EVENT_NETWORK_ERROR,
VpnManager.ERROR_CLASS_RECOVERABLE, VpnManager.ERROR_CLASS_RECOVERABLE,
VpnManager.ERROR_CODE_NETWORK_LOST, VpnManager.ERROR_CODE_NETWORK_LOST,
@@ -2996,7 +2996,7 @@ public class Vpn {
if (exception.getCause() instanceof UnknownHostException) { if (exception.getCause() instanceof UnknownHostException) {
// TODO(b/230548427): Remove SDK check once VPN related stuff are // TODO(b/230548427): Remove SDK check once VPN related stuff are
// decoupled from ConnectivityServiceTest. // decoupled from ConnectivityServiceTest.
if (SdkLevel.isAtLeastT()) { if (SdkLevel.isAtLeastT() && isVpnApp(mPackage)) {
sendEventToVpnManagerApp(VpnManager.CATEGORY_EVENT_NETWORK_ERROR, sendEventToVpnManagerApp(VpnManager.CATEGORY_EVENT_NETWORK_ERROR,
VpnManager.ERROR_CLASS_RECOVERABLE, VpnManager.ERROR_CLASS_RECOVERABLE,
VpnManager.ERROR_CODE_NETWORK_UNKNOWN_HOST, VpnManager.ERROR_CODE_NETWORK_UNKNOWN_HOST,
@@ -3010,7 +3010,7 @@ public class Vpn {
} else if (exception.getCause() instanceof IkeTimeoutException) { } else if (exception.getCause() instanceof IkeTimeoutException) {
// TODO(b/230548427): Remove SDK check once VPN related stuff are // TODO(b/230548427): Remove SDK check once VPN related stuff are
// decoupled from ConnectivityServiceTest. // decoupled from ConnectivityServiceTest.
if (SdkLevel.isAtLeastT()) { if (SdkLevel.isAtLeastT() && isVpnApp(mPackage)) {
sendEventToVpnManagerApp(VpnManager.CATEGORY_EVENT_NETWORK_ERROR, sendEventToVpnManagerApp(VpnManager.CATEGORY_EVENT_NETWORK_ERROR,
VpnManager.ERROR_CLASS_RECOVERABLE, VpnManager.ERROR_CLASS_RECOVERABLE,
VpnManager.ERROR_CODE_NETWORK_PROTOCOL_TIMEOUT, VpnManager.ERROR_CODE_NETWORK_PROTOCOL_TIMEOUT,
@@ -3024,7 +3024,7 @@ public class Vpn {
} else if (exception.getCause() instanceof IOException) { } else if (exception.getCause() instanceof IOException) {
// TODO(b/230548427): Remove SDK check once VPN related stuff are // TODO(b/230548427): Remove SDK check once VPN related stuff are
// decoupled from ConnectivityServiceTest. // decoupled from ConnectivityServiceTest.
if (SdkLevel.isAtLeastT()) { if (SdkLevel.isAtLeastT() && isVpnApp(mPackage)) {
sendEventToVpnManagerApp(VpnManager.CATEGORY_EVENT_NETWORK_ERROR, sendEventToVpnManagerApp(VpnManager.CATEGORY_EVENT_NETWORK_ERROR,
VpnManager.ERROR_CLASS_RECOVERABLE, VpnManager.ERROR_CLASS_RECOVERABLE,
VpnManager.ERROR_CODE_NETWORK_IO, VpnManager.ERROR_CODE_NETWORK_IO,