ConnectivityService: minor formatting change
This patch adds a space character between "synchronized" and
"(mTheLockVariable)" so that all synchronized block have a consistent
syntax. Basic stats shows that "synchronized (" is x10 time more likely
than "synchronized(".
This facilitates finding all locked sections by grepping.
Test: no semantics changes
Bug: 37119619
Change-Id: Id860700efa85ffebafed11af3a2997bc115d9c03
This commit is contained in:
@@ -487,7 +487,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
new ArrayDeque<ValidationLog>(MAX_VALIDATION_LOGS);
|
||||
|
||||
private void addValidationLogs(ReadOnlyLocalLog log, Network network, String networkExtraInfo) {
|
||||
synchronized(mValidationLogs) {
|
||||
synchronized (mValidationLogs) {
|
||||
while (mValidationLogs.size() >= MAX_VALIDATION_LOGS) {
|
||||
mValidationLogs.removeLast();
|
||||
}
|
||||
@@ -1671,7 +1671,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
}
|
||||
|
||||
private void sendStickyBroadcast(Intent intent) {
|
||||
synchronized(this) {
|
||||
synchronized (this) {
|
||||
if (!mSystemReady) {
|
||||
mInitialBroadcast = new Intent(intent);
|
||||
}
|
||||
@@ -1712,7 +1712,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
void systemReady() {
|
||||
loadGlobalProxy();
|
||||
|
||||
synchronized(this) {
|
||||
synchronized (this) {
|
||||
mSystemReady = true;
|
||||
if (mInitialBroadcast != null) {
|
||||
mContext.sendStickyBroadcastAsUser(mInitialBroadcast, UserHandle.ALL);
|
||||
@@ -3494,7 +3494,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
enforceCrossUserPermission(userId);
|
||||
throwIfLockdownEnabled();
|
||||
|
||||
synchronized(mVpns) {
|
||||
synchronized (mVpns) {
|
||||
Vpn vpn = mVpns.get(userId);
|
||||
if (vpn != null) {
|
||||
return vpn.prepare(oldPackage, newPackage);
|
||||
@@ -3521,7 +3521,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
public void setVpnPackageAuthorization(String packageName, int userId, boolean authorized) {
|
||||
enforceCrossUserPermission(userId);
|
||||
|
||||
synchronized(mVpns) {
|
||||
synchronized (mVpns) {
|
||||
Vpn vpn = mVpns.get(userId);
|
||||
if (vpn != null) {
|
||||
vpn.setPackageAuthorization(packageName, authorized);
|
||||
@@ -3540,7 +3540,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
public ParcelFileDescriptor establishVpn(VpnConfig config) {
|
||||
throwIfLockdownEnabled();
|
||||
int user = UserHandle.getUserId(Binder.getCallingUid());
|
||||
synchronized(mVpns) {
|
||||
synchronized (mVpns) {
|
||||
return mVpns.get(user).establish(config);
|
||||
}
|
||||
}
|
||||
@@ -3557,7 +3557,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
throw new IllegalStateException("Missing active network connection");
|
||||
}
|
||||
int user = UserHandle.getUserId(Binder.getCallingUid());
|
||||
synchronized(mVpns) {
|
||||
synchronized (mVpns) {
|
||||
mVpns.get(user).startLegacyVpn(profile, mKeyStore, egress);
|
||||
}
|
||||
}
|
||||
@@ -3571,7 +3571,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
public LegacyVpnInfo getLegacyVpnInfo(int userId) {
|
||||
enforceCrossUserPermission(userId);
|
||||
|
||||
synchronized(mVpns) {
|
||||
synchronized (mVpns) {
|
||||
return mVpns.get(userId).getLegacyVpnInfo();
|
||||
}
|
||||
}
|
||||
@@ -3587,7 +3587,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
return new VpnInfo[0];
|
||||
}
|
||||
|
||||
synchronized(mVpns) {
|
||||
synchronized (mVpns) {
|
||||
List<VpnInfo> infoList = new ArrayList<>();
|
||||
for (int i = 0; i < mVpns.size(); i++) {
|
||||
VpnInfo info = createVpnInfo(mVpns.valueAt(i));
|
||||
@@ -3635,7 +3635,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
@Override
|
||||
public VpnConfig getVpnConfig(int userId) {
|
||||
enforceCrossUserPermission(userId);
|
||||
synchronized(mVpns) {
|
||||
synchronized (mVpns) {
|
||||
Vpn vpn = mVpns.get(userId);
|
||||
if (vpn != null) {
|
||||
return vpn.getVpnConfig();
|
||||
@@ -3669,7 +3669,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
return true;
|
||||
}
|
||||
int user = UserHandle.getUserId(Binder.getCallingUid());
|
||||
synchronized(mVpns) {
|
||||
synchronized (mVpns) {
|
||||
Vpn vpn = mVpns.get(user);
|
||||
if (vpn == null) {
|
||||
Slog.w(TAG, "VPN for user " + user + " not ready yet. Skipping lockdown");
|
||||
@@ -3904,7 +3904,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
}
|
||||
|
||||
private void onUserStart(int userId) {
|
||||
synchronized(mVpns) {
|
||||
synchronized (mVpns) {
|
||||
Vpn userVpn = mVpns.get(userId);
|
||||
if (userVpn != null) {
|
||||
loge("Starting user already has a VPN");
|
||||
@@ -3919,7 +3919,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
}
|
||||
|
||||
private void onUserStop(int userId) {
|
||||
synchronized(mVpns) {
|
||||
synchronized (mVpns) {
|
||||
Vpn userVpn = mVpns.get(userId);
|
||||
if (userVpn == null) {
|
||||
loge("Stopped user has no VPN");
|
||||
@@ -3931,7 +3931,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
}
|
||||
|
||||
private void onUserAdded(int userId) {
|
||||
synchronized(mVpns) {
|
||||
synchronized (mVpns) {
|
||||
final int vpnsSize = mVpns.size();
|
||||
for (int i = 0; i < vpnsSize; i++) {
|
||||
Vpn vpn = mVpns.valueAt(i);
|
||||
@@ -3941,7 +3941,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
}
|
||||
|
||||
private void onUserRemoved(int userId) {
|
||||
synchronized(mVpns) {
|
||||
synchronized (mVpns) {
|
||||
final int vpnsSize = mVpns.size();
|
||||
for (int i = 0; i < vpnsSize; i++) {
|
||||
Vpn vpn = mVpns.valueAt(i);
|
||||
|
||||
Reference in New Issue
Block a user