diff options
| author | 2019-01-17 15:49:55 +0000 | |
|---|---|---|
| committer | 2019-01-17 15:49:55 +0000 | |
| commit | df1f806cddff9ab2c6d82ce718d07e741d04fb6d (patch) | |
| tree | 5f3a3db846a8c1dbca055273d13c1b53b6cd827f | |
| parent | 184af56de9293c87960f88c6c2a92c47b6c4a8d5 (diff) | |
| parent | 3df6643ad7652a7fb55233a2362bea757257798f (diff) | |
Merge "Enhance Logging When Skipping Loading Temp Rules"
| -rw-r--r-- | core/java/android/os/GraphicsEnvironment.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java index e4622dbdc379..f51ba9a41a2b 100644 --- a/core/java/android/os/GraphicsEnvironment.java +++ b/core/java/android/os/GraphicsEnvironment.java @@ -306,9 +306,18 @@ public class GraphicsEnvironment { String packageName, String paths, String devOptIn) { - // Check for temporary rules if debuggable or root - if (!isDebuggable(context) && !(getCanLoadSystemLibraries() == 1)) { - Log.v(TAG, "Skipping loading temporary rules file"); + /** + * We only want to load a temp rules file for: + * - apps that are marked 'debuggable' in their manifest + * - devices that are running a userdebug build (ro.debuggable) or can inject libraries for + * debugging (PR_SET_DUMPABLE). + */ + boolean appIsDebuggable = isDebuggable(context); + boolean deviceIsDebuggable = getCanLoadSystemLibraries() == 1; + if (!(appIsDebuggable || deviceIsDebuggable)) { + Log.v(TAG, "Skipping loading temporary rules file: " + + "appIsDebuggable = " + appIsDebuggable + ", " + + "adbRootEnabled = " + deviceIsDebuggable); return false; } |