ActivityManager: Allow DiskRead for wrap.sh determination
Avoid killing debuggable apps which at the same time have a strict-mode
policy installed.
(cherry picked from commit 62be34e32e)
Bug: 33668201
Test: m
Change-Id: Ic3c56b01fe42a473e28c1d6280526afdc85793df
This commit is contained in:
@@ -3929,8 +3929,13 @@ public class ActivityManagerService extends IActivityManager.Stub
|
||||
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";
|
||||
if (new File(wrapperFileName).exists()) {
|
||||
invokeWith = "/system/bin/logwrapper " + wrapperFileName;
|
||||
StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
|
||||
try {
|
||||
if (new File(wrapperFileName).exists()) {
|
||||
invokeWith = "/system/bin/logwrapper " + wrapperFileName;
|
||||
}
|
||||
} finally {
|
||||
StrictMode.setThreadPolicy(oldPolicy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user