Merge "ConnectivityService: minor formatting change" am: 4c949ee07c am: 9374e0b598 am: 88a3389b2c
am: 2ca1de8257
Change-Id: I252d293f37d29a53e1b5d913f682c0c16b2a122c
This commit is contained in:
@@ -471,7 +471,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
new ArrayDeque<ValidationLog>(MAX_VALIDATION_LOGS);
|
new ArrayDeque<ValidationLog>(MAX_VALIDATION_LOGS);
|
||||||
|
|
||||||
private void addValidationLogs(ReadOnlyLocalLog log, Network network, String networkExtraInfo) {
|
private void addValidationLogs(ReadOnlyLocalLog log, Network network, String networkExtraInfo) {
|
||||||
synchronized(mValidationLogs) {
|
synchronized (mValidationLogs) {
|
||||||
while (mValidationLogs.size() >= MAX_VALIDATION_LOGS) {
|
while (mValidationLogs.size() >= MAX_VALIDATION_LOGS) {
|
||||||
mValidationLogs.removeLast();
|
mValidationLogs.removeLast();
|
||||||
}
|
}
|
||||||
@@ -1577,7 +1577,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void sendStickyBroadcast(Intent intent) {
|
private void sendStickyBroadcast(Intent intent) {
|
||||||
synchronized(this) {
|
synchronized (this) {
|
||||||
if (!mSystemReady) {
|
if (!mSystemReady) {
|
||||||
mInitialBroadcast = new Intent(intent);
|
mInitialBroadcast = new Intent(intent);
|
||||||
}
|
}
|
||||||
@@ -1618,7 +1618,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
void systemReady() {
|
void systemReady() {
|
||||||
loadGlobalProxy();
|
loadGlobalProxy();
|
||||||
|
|
||||||
synchronized(this) {
|
synchronized (this) {
|
||||||
mSystemReady = true;
|
mSystemReady = true;
|
||||||
if (mInitialBroadcast != null) {
|
if (mInitialBroadcast != null) {
|
||||||
mContext.sendStickyBroadcastAsUser(mInitialBroadcast, UserHandle.ALL);
|
mContext.sendStickyBroadcastAsUser(mInitialBroadcast, UserHandle.ALL);
|
||||||
@@ -3381,7 +3381,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
enforceCrossUserPermission(userId);
|
enforceCrossUserPermission(userId);
|
||||||
throwIfLockdownEnabled();
|
throwIfLockdownEnabled();
|
||||||
|
|
||||||
synchronized(mVpns) {
|
synchronized (mVpns) {
|
||||||
Vpn vpn = mVpns.get(userId);
|
Vpn vpn = mVpns.get(userId);
|
||||||
if (vpn != null) {
|
if (vpn != null) {
|
||||||
return vpn.prepare(oldPackage, newPackage);
|
return vpn.prepare(oldPackage, newPackage);
|
||||||
@@ -3408,7 +3408,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
public void setVpnPackageAuthorization(String packageName, int userId, boolean authorized) {
|
public void setVpnPackageAuthorization(String packageName, int userId, boolean authorized) {
|
||||||
enforceCrossUserPermission(userId);
|
enforceCrossUserPermission(userId);
|
||||||
|
|
||||||
synchronized(mVpns) {
|
synchronized (mVpns) {
|
||||||
Vpn vpn = mVpns.get(userId);
|
Vpn vpn = mVpns.get(userId);
|
||||||
if (vpn != null) {
|
if (vpn != null) {
|
||||||
vpn.setPackageAuthorization(packageName, authorized);
|
vpn.setPackageAuthorization(packageName, authorized);
|
||||||
@@ -3427,7 +3427,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
public ParcelFileDescriptor establishVpn(VpnConfig config) {
|
public ParcelFileDescriptor establishVpn(VpnConfig config) {
|
||||||
throwIfLockdownEnabled();
|
throwIfLockdownEnabled();
|
||||||
int user = UserHandle.getUserId(Binder.getCallingUid());
|
int user = UserHandle.getUserId(Binder.getCallingUid());
|
||||||
synchronized(mVpns) {
|
synchronized (mVpns) {
|
||||||
return mVpns.get(user).establish(config);
|
return mVpns.get(user).establish(config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3444,7 +3444,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
throw new IllegalStateException("Missing active network connection");
|
throw new IllegalStateException("Missing active network connection");
|
||||||
}
|
}
|
||||||
int user = UserHandle.getUserId(Binder.getCallingUid());
|
int user = UserHandle.getUserId(Binder.getCallingUid());
|
||||||
synchronized(mVpns) {
|
synchronized (mVpns) {
|
||||||
mVpns.get(user).startLegacyVpn(profile, mKeyStore, egress);
|
mVpns.get(user).startLegacyVpn(profile, mKeyStore, egress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3458,7 +3458,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
public LegacyVpnInfo getLegacyVpnInfo(int userId) {
|
public LegacyVpnInfo getLegacyVpnInfo(int userId) {
|
||||||
enforceCrossUserPermission(userId);
|
enforceCrossUserPermission(userId);
|
||||||
|
|
||||||
synchronized(mVpns) {
|
synchronized (mVpns) {
|
||||||
return mVpns.get(userId).getLegacyVpnInfo();
|
return mVpns.get(userId).getLegacyVpnInfo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3474,7 +3474,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
return new VpnInfo[0];
|
return new VpnInfo[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized(mVpns) {
|
synchronized (mVpns) {
|
||||||
List<VpnInfo> infoList = new ArrayList<>();
|
List<VpnInfo> infoList = new ArrayList<>();
|
||||||
for (int i = 0; i < mVpns.size(); i++) {
|
for (int i = 0; i < mVpns.size(); i++) {
|
||||||
VpnInfo info = createVpnInfo(mVpns.valueAt(i));
|
VpnInfo info = createVpnInfo(mVpns.valueAt(i));
|
||||||
@@ -3522,7 +3522,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
@Override
|
@Override
|
||||||
public VpnConfig getVpnConfig(int userId) {
|
public VpnConfig getVpnConfig(int userId) {
|
||||||
enforceCrossUserPermission(userId);
|
enforceCrossUserPermission(userId);
|
||||||
synchronized(mVpns) {
|
synchronized (mVpns) {
|
||||||
Vpn vpn = mVpns.get(userId);
|
Vpn vpn = mVpns.get(userId);
|
||||||
if (vpn != null) {
|
if (vpn != null) {
|
||||||
return vpn.getVpnConfig();
|
return vpn.getVpnConfig();
|
||||||
@@ -3556,7 +3556,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
int user = UserHandle.getUserId(Binder.getCallingUid());
|
int user = UserHandle.getUserId(Binder.getCallingUid());
|
||||||
synchronized(mVpns) {
|
synchronized (mVpns) {
|
||||||
Vpn vpn = mVpns.get(user);
|
Vpn vpn = mVpns.get(user);
|
||||||
if (vpn == null) {
|
if (vpn == null) {
|
||||||
Slog.w(TAG, "VPN for user " + user + " not ready yet. Skipping lockdown");
|
Slog.w(TAG, "VPN for user " + user + " not ready yet. Skipping lockdown");
|
||||||
@@ -3791,7 +3791,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onUserStart(int userId) {
|
private void onUserStart(int userId) {
|
||||||
synchronized(mVpns) {
|
synchronized (mVpns) {
|
||||||
Vpn userVpn = mVpns.get(userId);
|
Vpn userVpn = mVpns.get(userId);
|
||||||
if (userVpn != null) {
|
if (userVpn != null) {
|
||||||
loge("Starting user already has a VPN");
|
loge("Starting user already has a VPN");
|
||||||
@@ -3806,7 +3806,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onUserStop(int userId) {
|
private void onUserStop(int userId) {
|
||||||
synchronized(mVpns) {
|
synchronized (mVpns) {
|
||||||
Vpn userVpn = mVpns.get(userId);
|
Vpn userVpn = mVpns.get(userId);
|
||||||
if (userVpn == null) {
|
if (userVpn == null) {
|
||||||
loge("Stopped user has no VPN");
|
loge("Stopped user has no VPN");
|
||||||
@@ -3818,7 +3818,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onUserAdded(int userId) {
|
private void onUserAdded(int userId) {
|
||||||
synchronized(mVpns) {
|
synchronized (mVpns) {
|
||||||
final int vpnsSize = mVpns.size();
|
final int vpnsSize = mVpns.size();
|
||||||
for (int i = 0; i < vpnsSize; i++) {
|
for (int i = 0; i < vpnsSize; i++) {
|
||||||
Vpn vpn = mVpns.valueAt(i);
|
Vpn vpn = mVpns.valueAt(i);
|
||||||
@@ -3828,7 +3828,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onUserRemoved(int userId) {
|
private void onUserRemoved(int userId) {
|
||||||
synchronized(mVpns) {
|
synchronized (mVpns) {
|
||||||
final int vpnsSize = mVpns.size();
|
final int vpnsSize = mVpns.size();
|
||||||
for (int i = 0; i < vpnsSize; i++) {
|
for (int i = 0; i < vpnsSize; i++) {
|
||||||
Vpn vpn = mVpns.valueAt(i);
|
Vpn vpn = mVpns.valueAt(i);
|
||||||
|
|||||||
Reference in New Issue
Block a user