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

Commit 62be34e3 authored by Andreas Gampe's avatar Andreas Gampe
Browse files

ActivityManager: Allow DiskRead for wrap.sh determination

Avoid killing debuggable apps which at the same time have a strict-mode
policy installed.

Bug: 33668201
Test: m
Change-Id: Ic3c56b01fe42a473e28c1d6280526afdc85793df
parent 22b829c0
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -3790,9 +3790,14 @@ public final class ActivityManagerService extends ActivityManagerNative
            if ((app.info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
                // Debuggable apps may include a wrapper script with their library directory.
                String wrapperFileName = app.info.nativeLibraryDir + "/wrap.sh";
                StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
                try {
                    if (new File(wrapperFileName).exists()) {
                        invokeWith = "/system/bin/logwrapper " + wrapperFileName;
                    }
                } finally {
                    StrictMode.setThreadPolicy(oldPolicy);
                }
            }
            String requiredAbi = (abiOverride != null) ? abiOverride : app.info.primaryCpuAbi;