Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1af7ff0 authored by Paul Jensen's avatar Paul Jensen Committed by Android Git Automerger
Browse files

am 0858a297: am 4d8b2f76: am b3322d8a: am f1980965: am 1c637c5f: Merge "Remove...

am 0858a297: am 4d8b2f76: am b3322d8a: am f1980965: am 1c637c5f: Merge "Remove needless locking of mRulesLock that caused deadlocks." into lmp-dev

* commit '0858a29704cd2384f4e65a78abb9062dce04ba3d':
  Remove needless locking of mRulesLock that caused deadlocks.
parents 256b45d3 32bcf376
Loading
Loading
Loading
Loading
+13 −16
Original line number Diff line number Diff line
@@ -979,14 +979,12 @@ public class ConnectivityService extends IConnectivityManager.Stub {
        enforceAccessPermission();
        final int uid = Binder.getCallingUid();
        final ArrayList<NetworkInfo> result = Lists.newArrayList();
        synchronized (mRulesLock) {
        for (int networkType = 0; networkType <= ConnectivityManager.MAX_NETWORK_TYPE;
                networkType++) {
            if (getNetworkInfoForType(networkType) != null) {
                result.add(getFilteredNetworkInfo(networkType, uid));
            }
        }
        }
        return result.toArray(new NetworkInfo[result.size()]);
    }

@@ -1078,7 +1076,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
        enforceAccessPermission();
        final int uid = Binder.getCallingUid();
        final ArrayList<NetworkState> result = Lists.newArrayList();
        synchronized (mRulesLock) {
        for (int networkType = 0; networkType <= ConnectivityManager.MAX_NETWORK_TYPE;
                networkType++) {
            if (getNetworkInfoForType(networkType) != null) {
@@ -1088,7 +1085,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
                result.add(new NetworkState(info, lp, netcap));
            }
        }
        }
        return result.toArray(new NetworkState[result.size()]);
    }

@@ -4132,8 +4128,9 @@ public class ConnectivityService extends IConnectivityManager.Stub {
        if (networkCapabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED)
                == false) {
            final int uidRules;
            final int uid = Binder.getCallingUid();
            synchronized(mRulesLock) {
                uidRules = mUidRules.get(Binder.getCallingUid(), RULE_ALLOW_ALL);
                uidRules = mUidRules.get(uid, RULE_ALLOW_ALL);
            }
            if ((uidRules & RULE_REJECT_METERED) != 0) {
                // we could silently fail or we can filter the available nets to only give