Address leftover comments of ag/18112116 am: 29b1b5beac
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18643251 Change-Id: If193b655c88009ab38c876828f7d12abd07e8549 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -763,31 +763,36 @@ public class Vpn {
|
|||||||
// Also notify the new package if there was a provider change.
|
// Also notify the new package if there was a provider change.
|
||||||
final boolean shouldNotifyNewPkg = isVpnApp(packageName) && isPackageChanged;
|
final boolean shouldNotifyNewPkg = isVpnApp(packageName) && isPackageChanged;
|
||||||
|
|
||||||
if (setAlwaysOnPackageInternal(packageName, lockdown, lockdownAllowlist)) {
|
if (!setAlwaysOnPackageInternal(packageName, lockdown, lockdownAllowlist)) {
|
||||||
saveAlwaysOnPackage();
|
return false;
|
||||||
// TODO(b/230548427): Remove SDK check once VPN related stuff are decoupled from
|
}
|
||||||
// ConnectivityServiceTest.
|
|
||||||
if (shouldNotifyOldPkg && SdkLevel.isAtLeastT()) {
|
saveAlwaysOnPackage();
|
||||||
// If both of shouldNotifyOldPkg & isPackageChanged are true, which means the
|
|
||||||
// always-on of old package is disabled or the old package is replaced with the new
|
// TODO(b/230548427): Remove SDK check once VPN related stuff are decoupled from
|
||||||
// package. In this case, VpnProfileState should be disconnected.
|
// ConnectivityServiceTest.
|
||||||
sendEventToVpnManagerApp(VpnManager.CATEGORY_EVENT_ALWAYS_ON_STATE_CHANGED,
|
if (!SdkLevel.isAtLeastT()) {
|
||||||
-1 /* errorClass */, -1 /* errorCode*/, oldPackage,
|
|
||||||
null /* sessionKey */, isPackageChanged ? makeDisconnectedVpnProfileState()
|
|
||||||
: makeVpnProfileStateLocked(),
|
|
||||||
null /* underlyingNetwork */, null /* nc */, null /* lp */);
|
|
||||||
}
|
|
||||||
// TODO(b/230548427): Remove SDK check once VPN related stuff are decoupled from
|
|
||||||
// ConnectivityServiceTest.
|
|
||||||
if (shouldNotifyNewPkg && SdkLevel.isAtLeastT()) {
|
|
||||||
sendEventToVpnManagerApp(VpnManager.CATEGORY_EVENT_ALWAYS_ON_STATE_CHANGED,
|
|
||||||
-1 /* errorClass */, -1 /* errorCode*/, packageName,
|
|
||||||
getSessionKeyLocked(), makeVpnProfileStateLocked(),
|
|
||||||
null /* underlyingNetwork */, null /* nc */, null /* lp */);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
|
if (shouldNotifyOldPkg) {
|
||||||
|
// If both of shouldNotifyOldPkg & isPackageChanged are true, that means the
|
||||||
|
// always-on of old package is disabled or the old package is replaced with the new
|
||||||
|
// package. In this case, VpnProfileState should be disconnected.
|
||||||
|
sendEventToVpnManagerApp(VpnManager.CATEGORY_EVENT_ALWAYS_ON_STATE_CHANGED,
|
||||||
|
-1 /* errorClass */, -1 /* errorCode*/, oldPackage,
|
||||||
|
null /* sessionKey */, isPackageChanged ? makeDisconnectedVpnProfileState()
|
||||||
|
: makeVpnProfileStateLocked(),
|
||||||
|
null /* underlyingNetwork */, null /* nc */, null /* lp */);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shouldNotifyNewPkg) {
|
||||||
|
sendEventToVpnManagerApp(VpnManager.CATEGORY_EVENT_ALWAYS_ON_STATE_CHANGED,
|
||||||
|
-1 /* errorClass */, -1 /* errorCode*/, packageName,
|
||||||
|
getSessionKeyLocked(), makeVpnProfileStateLocked(),
|
||||||
|
null /* underlyingNetwork */, null /* nc */, null /* lp */);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user