Send VPN manager event when VPN is deactivated
Bug: 191413541
Test: atest FrameworksNetTests:VpnTest
Change-Id: I35fc360204f0227a969ff2b12a4c47f701a55a9c
(cherry picked from commit 3f5bf1f059)
Merged-In: I35fc360204f0227a969ff2b12a4c47f701a55a9c
This commit is contained in:
@@ -1110,6 +1110,17 @@ public class Vpn {
|
|||||||
if (!VpnConfig.LEGACY_VPN.equals(mPackage)) {
|
if (!VpnConfig.LEGACY_VPN.equals(mPackage)) {
|
||||||
mAppOpsManager.finishOp(
|
mAppOpsManager.finishOp(
|
||||||
AppOpsManager.OPSTR_ESTABLISH_VPN_MANAGER, mOwnerUID, mPackage, null);
|
AppOpsManager.OPSTR_ESTABLISH_VPN_MANAGER, mOwnerUID, mPackage, null);
|
||||||
|
// The underlying network, NetworkCapabilities and LinkProperties are not
|
||||||
|
// necessary to send to VPN app since the purpose of this event is to notify
|
||||||
|
// VPN app that VPN is deactivated by the user.
|
||||||
|
// TODO(b/230548427): Remove SDK check once VPN related stuff are decoupled from
|
||||||
|
// ConnectivityServiceTest.
|
||||||
|
if (SdkLevel.isAtLeastT()) {
|
||||||
|
sendEventToVpnManagerApp(VpnManager.CATEGORY_EVENT_DEACTIVATED_BY_USER,
|
||||||
|
-1 /* errorClass */, -1 /* errorCode*/, mPackage,
|
||||||
|
getSessionKeyLocked(), makeVpnProfileStateLocked(),
|
||||||
|
null /* underlyingNetwork */, null /* nc */, null /* lp */);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// cleanupVpnStateLocked() is called from mVpnRunner.exit()
|
// cleanupVpnStateLocked() is called from mVpnRunner.exit()
|
||||||
mVpnRunner.exit();
|
mVpnRunner.exit();
|
||||||
|
|||||||
Reference in New Issue
Block a user