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

Commit 908285de authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Don't dump binder proxies with the lock held." into rvc-qpr-dev am:...

Merge "Don't dump binder proxies with the lock held." into rvc-qpr-dev am: 2ba3c1cf am: 7216ca76

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12685845

Change-Id: I210b3b5aea38dba1788cadbcc1a6de66a530bd55
parents 3aed0006 7216ca76
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -8253,7 +8253,7 @@ public class ActivityManagerService extends IActivityManager.Stub
    private void dumpEverything(FileDescriptor fd, PrintWriter pw, String[] args, int opti,
            boolean dumpAll, String dumpPackage, boolean dumpClient, boolean dumpNormalPriority,
            int dumpAppId) {
            int dumpAppId, boolean dumpProxies) {
        ActiveServices.ServiceDumper sdumper;
@@ -8312,7 +8312,7 @@ public class ActivityManagerService extends IActivityManager.Stub
            }
            sdumper.dumpWithClient();
        }
        if (dumpPackage == null) {
        if (dumpPackage == null && dumpProxies) {
            // Intentionally dropping the lock for this, because dumpBinderProxies() will make many
            // outgoing binder calls to retrieve interface descriptors; while that is system code,
            // there is nothing preventing an app from overriding this implementation by talking to
@@ -8721,13 +8721,14 @@ public class ActivityManagerService extends IActivityManager.Stub
                // dumpEverything() will take the lock when needed, and momentarily drop
                // it for dumping client state.
                dumpEverything(fd, pw, args, opti, dumpAll, dumpPackage, dumpClient,
                        dumpNormalPriority, dumpAppId);
                        dumpNormalPriority, dumpAppId, true /* dumpProxies */);
            } else {
                // Take the lock here, so we get a consistent state for the entire dump;
                // dumpEverything() will take the lock as well, but that is fine.
                // dumpEverything() will take the lock as well, which is fine for everything
                // except dumping proxies, which can take a long time; exclude them.
                synchronized(this) {
                    dumpEverything(fd, pw, args, opti, dumpAll, dumpPackage, dumpClient,
                            dumpNormalPriority, dumpAppId);
                            dumpNormalPriority, dumpAppId, false /* dumpProxies */);
                }
            }
        }