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

Commit d231b2a3 authored by Martijn Coenen's avatar Martijn Coenen Committed by android-build-merger
Browse files

Merge "Don't hold sProxyLock while retrieving interface descriptors." am: ef6fe13c am: d4d27b40

am: 3d4d4253

Change-Id: I27540c32f7150eff152b324c4edccc6afcce6b92
parents 8f17256d 3d4d4253
Loading
Loading
Loading
Loading
+30 −29
Original line number Diff line number Diff line
@@ -242,9 +242,16 @@ public final class BinderProxy implements IBinder {
            }

            Map<String, Integer> counts = new HashMap<>();
            final ArrayList<WeakReference<BinderProxy>> proxiesToQuery =
                    new ArrayList<WeakReference<BinderProxy>>();
            synchronized (sProxyMap) {
                for (ArrayList<WeakReference<BinderProxy>> a : mMainIndexValues) {
                    if (a != null) {
                    for (WeakReference<BinderProxy> weakRef : a) {
                        proxiesToQuery.addAll(a);
                    }
                }
            }
            for (WeakReference<BinderProxy> weakRef : proxiesToQuery) {
                BinderProxy bp = weakRef.get();
                String key;
                if (bp == null) {
@@ -266,8 +273,6 @@ public final class BinderProxy implements IBinder {
                    counts.put(key, i + 1);
                }
            }
                }
            }
            Map.Entry<String, Integer>[] sorted = counts.entrySet().toArray(
                    new Map.Entry[counts.size()]);

@@ -355,10 +360,8 @@ public final class BinderProxy implements IBinder {
     * @hide
     */
    public static InterfaceCount[] getSortedInterfaceCounts(int num) {
        synchronized (sProxyMap) {
        return sProxyMap.getSortedInterfaceCounts(num);
    }
    }

    /**
     * Returns the number of binder proxies held in this process.
@@ -377,12 +380,10 @@ public final class BinderProxy implements IBinder {
     */
    public static void dumpProxyDebugInfo() {
        if (Build.IS_DEBUGGABLE) {
            synchronized (sProxyMap) {
            sProxyMap.dumpProxyInterfaceCounts();
            sProxyMap.dumpPerUidProxyCounts();
        }
    }
    }

    /**
     * Return a BinderProxy for IBinder.