Merge "Invert the order of event sending and VpnRunner.exit()" am: 47b156d650 am: 2929e7629a am: 9c7d98aba2 am: 9b0eebc5d9

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

Change-Id: Ibf0b7d93f6651d86737d0f2ba77ff78d0fb1b02b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Chiachang Wang
2022-08-11 10:38:48 +00:00
committed by Automerger Merge Worker

View File

@@ -4042,9 +4042,11 @@ public class Vpn {
// To stop the VPN profile, the caller must be the current prepared package and must be // To stop the VPN profile, the caller must be the current prepared package and must be
// running an Ikev2VpnProfile. // running an Ikev2VpnProfile.
if (isCurrentIkev2VpnLocked(packageName)) { if (isCurrentIkev2VpnLocked(packageName)) {
notifyVpnManagerVpnStopped(packageName, mOwnerUID); // Cache ownerUid to prevent the value being changed after performing VpnRunner.exit().
final int ownerUid = mOwnerUID;
mVpnRunner.exit(); mVpnRunner.exit();
notifyVpnManagerVpnStopped(packageName, ownerUid);
} }
} }