Merge "No-op refactoring of VPN lockdown status check."
am: f694edec6f
Change-Id: I8aab0dd1556b49cafc08d57a8981051ba437fe44
This commit is contained in:
@@ -1143,7 +1143,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
}
|
}
|
||||||
synchronized (mVpns) {
|
synchronized (mVpns) {
|
||||||
final Vpn vpn = mVpns.get(UserHandle.getUserId(uid));
|
final Vpn vpn = mVpns.get(UserHandle.getUserId(uid));
|
||||||
if (vpn != null && vpn.isBlockingUid(uid)) {
|
if (vpn != null && vpn.getLockdown() && vpn.isBlockingUid(uid)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1736,7 +1736,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
// list all state depending on the return value of this function has to be recomputed.
|
// list all state depending on the return value of this function has to be recomputed.
|
||||||
// TODO: add a trigger when the always-on VPN sets its blocked UIDs to reevaluate and
|
// TODO: add a trigger when the always-on VPN sets its blocked UIDs to reevaluate and
|
||||||
// send the necessary onBlockedStatusChanged callbacks.
|
// send the necessary onBlockedStatusChanged callbacks.
|
||||||
if (vpn != null && vpn.isBlockingUid(uid)) {
|
if (vpn != null && vpn.getLockdown() && vpn.isBlockingUid(uid)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -507,13 +507,15 @@ public class VpnTest {
|
|||||||
|
|
||||||
private static void assertBlocked(Vpn vpn, int... uids) {
|
private static void assertBlocked(Vpn vpn, int... uids) {
|
||||||
for (int uid : uids) {
|
for (int uid : uids) {
|
||||||
assertTrue("Uid " + uid + " should be blocked", vpn.isBlockingUid(uid));
|
final boolean blocked = vpn.getLockdown() && vpn.isBlockingUid(uid);
|
||||||
|
assertTrue("Uid " + uid + " should be blocked", blocked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void assertUnblocked(Vpn vpn, int... uids) {
|
private static void assertUnblocked(Vpn vpn, int... uids) {
|
||||||
for (int uid : uids) {
|
for (int uid : uids) {
|
||||||
assertFalse("Uid " + uid + " should not be blocked", vpn.isBlockingUid(uid));
|
final boolean blocked = vpn.getLockdown() && vpn.isBlockingUid(uid);
|
||||||
|
assertFalse("Uid " + uid + " should not be blocked", blocked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user