Loading core/java/android/app/ActivityThread.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -6520,7 +6520,8 @@ public final class ActivityThread extends ClientTransactionHandler { } } // Allow binder tracing, and application-generated systrace messages if we're profileable. // Allow binder tracing, and application-generated systrace messages if we're profileable. boolean isAppProfileable = data.appInfo.isProfileableByShell(); boolean isAppDebuggable = (data.appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; boolean isAppProfileable = isAppDebuggable || data.appInfo.isProfileableByShell(); Trace.setAppTracingAllowed(isAppProfileable); Trace.setAppTracingAllowed(isAppProfileable); if ((isAppProfileable || Build.IS_DEBUGGABLE) && data.enableBinderTracking) { if ((isAppProfileable || Build.IS_DEBUGGABLE) && data.enableBinderTracking) { Binder.enableTracing(); Binder.enableTracing(); Loading @@ -6532,7 +6533,6 @@ public final class ActivityThread extends ClientTransactionHandler { } } // Allow renderer debugging features if we're debuggable. // Allow renderer debugging features if we're debuggable. boolean isAppDebuggable = (data.appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; HardwareRenderer.setDebuggingEnabled(isAppDebuggable || Build.IS_DEBUGGABLE); HardwareRenderer.setDebuggingEnabled(isAppDebuggable || Build.IS_DEBUGGABLE); HardwareRenderer.setPackageName(data.appInfo.packageName); HardwareRenderer.setPackageName(data.appInfo.packageName); Loading core/java/android/content/pm/PackageParser.java +0 −6 Original line number Original line Diff line number Diff line Loading @@ -1648,10 +1648,6 @@ public class PackageParser { final String attr = attrs.getAttributeName(i); final String attr = attrs.getAttributeName(i); if ("debuggable".equals(attr)) { if ("debuggable".equals(attr)) { debuggable = attrs.getAttributeBooleanValue(i, false); debuggable = attrs.getAttributeBooleanValue(i, false); if (debuggable) { // Debuggable implies profileable profilableByShell = true; } } } if ("multiArch".equals(attr)) { if ("multiArch".equals(attr)) { multiArch = attrs.getAttributeBooleanValue(i, false); multiArch = attrs.getAttributeBooleanValue(i, false); Loading Loading @@ -3471,8 +3467,6 @@ public class PackageParser { com.android.internal.R.styleable.AndroidManifestApplication_debuggable, com.android.internal.R.styleable.AndroidManifestApplication_debuggable, false)) { false)) { ai.flags |= ApplicationInfo.FLAG_DEBUGGABLE; ai.flags |= ApplicationInfo.FLAG_DEBUGGABLE; // Debuggable implies profileable ai.privateFlags |= ApplicationInfo.PRIVATE_FLAG_PROFILEABLE_BY_SHELL; } } if (sa.getBoolean( if (sa.getBoolean( Loading core/java/android/content/pm/parsing/ApkLiteParseUtils.java +0 −4 Original line number Original line Diff line number Diff line Loading @@ -380,10 +380,6 @@ public class ApkLiteParseUtils { switch (attr) { switch (attr) { case "debuggable": case "debuggable": debuggable = attrs.getAttributeBooleanValue(i, false); debuggable = attrs.getAttributeBooleanValue(i, false); if (debuggable) { // Debuggable implies profileable profilableByShell = true; } break; break; case "multiArch": case "multiArch": multiArch = attrs.getAttributeBooleanValue(i, false); multiArch = attrs.getAttributeBooleanValue(i, false); Loading core/java/android/content/pm/parsing/ParsingPackageUtils.java +1 −2 Original line number Original line Diff line number Diff line Loading @@ -1720,8 +1720,7 @@ public class ParsingPackageUtils { // TODO(b/135203078): Should parsing code be responsible for this? Maybe move to a // TODO(b/135203078): Should parsing code be responsible for this? Maybe move to a // util or just have PackageImpl return true if either flag is set // util or just have PackageImpl return true if either flag is set // Debuggable implies profileable pkg.setProfileableByShell(pkg.isProfileableByShell()); pkg.setProfileableByShell(pkg.isProfileableByShell() || pkg.isDebuggable()); if (sa.hasValueOrEmpty(R.styleable.AndroidManifestApplication_resizeableActivity)) { if (sa.hasValueOrEmpty(R.styleable.AndroidManifestApplication_resizeableActivity)) { pkg.setResizeableActivity(sa.getBoolean( pkg.setResizeableActivity(sa.getBoolean( Loading services/core/java/com/android/server/am/ActivityManagerService.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -405,9 +405,7 @@ import java.util.Locale; import java.util.Map; import java.util.Map; import java.util.Objects; import java.util.Objects; import java.util.Set; import java.util.Set; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger; Loading Loading @@ -8436,7 +8434,9 @@ public class ActivityManagerService extends IActivityManager.Stub synchronized (this) { synchronized (this) { boolean isDebuggable = "1".equals(SystemProperties.get(SYSTEM_DEBUGGABLE, "0")); boolean isDebuggable = "1".equals(SystemProperties.get(SYSTEM_DEBUGGABLE, "0")); if (!isDebuggable) { if (!isDebuggable) { if (!app.isProfileableByShell()) { boolean isAppDebuggable = (app.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; boolean isAppProfileable = app.isProfileableByShell(); if (!isAppDebuggable && !isAppProfileable) { throw new SecurityException("Process not debuggable, " throw new SecurityException("Process not debuggable, " + "and not profileable by shell: " + app.packageName); + "and not profileable by shell: " + app.packageName); } } Loading Loading
core/java/android/app/ActivityThread.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -6520,7 +6520,8 @@ public final class ActivityThread extends ClientTransactionHandler { } } // Allow binder tracing, and application-generated systrace messages if we're profileable. // Allow binder tracing, and application-generated systrace messages if we're profileable. boolean isAppProfileable = data.appInfo.isProfileableByShell(); boolean isAppDebuggable = (data.appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; boolean isAppProfileable = isAppDebuggable || data.appInfo.isProfileableByShell(); Trace.setAppTracingAllowed(isAppProfileable); Trace.setAppTracingAllowed(isAppProfileable); if ((isAppProfileable || Build.IS_DEBUGGABLE) && data.enableBinderTracking) { if ((isAppProfileable || Build.IS_DEBUGGABLE) && data.enableBinderTracking) { Binder.enableTracing(); Binder.enableTracing(); Loading @@ -6532,7 +6533,6 @@ public final class ActivityThread extends ClientTransactionHandler { } } // Allow renderer debugging features if we're debuggable. // Allow renderer debugging features if we're debuggable. boolean isAppDebuggable = (data.appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; HardwareRenderer.setDebuggingEnabled(isAppDebuggable || Build.IS_DEBUGGABLE); HardwareRenderer.setDebuggingEnabled(isAppDebuggable || Build.IS_DEBUGGABLE); HardwareRenderer.setPackageName(data.appInfo.packageName); HardwareRenderer.setPackageName(data.appInfo.packageName); Loading
core/java/android/content/pm/PackageParser.java +0 −6 Original line number Original line Diff line number Diff line Loading @@ -1648,10 +1648,6 @@ public class PackageParser { final String attr = attrs.getAttributeName(i); final String attr = attrs.getAttributeName(i); if ("debuggable".equals(attr)) { if ("debuggable".equals(attr)) { debuggable = attrs.getAttributeBooleanValue(i, false); debuggable = attrs.getAttributeBooleanValue(i, false); if (debuggable) { // Debuggable implies profileable profilableByShell = true; } } } if ("multiArch".equals(attr)) { if ("multiArch".equals(attr)) { multiArch = attrs.getAttributeBooleanValue(i, false); multiArch = attrs.getAttributeBooleanValue(i, false); Loading Loading @@ -3471,8 +3467,6 @@ public class PackageParser { com.android.internal.R.styleable.AndroidManifestApplication_debuggable, com.android.internal.R.styleable.AndroidManifestApplication_debuggable, false)) { false)) { ai.flags |= ApplicationInfo.FLAG_DEBUGGABLE; ai.flags |= ApplicationInfo.FLAG_DEBUGGABLE; // Debuggable implies profileable ai.privateFlags |= ApplicationInfo.PRIVATE_FLAG_PROFILEABLE_BY_SHELL; } } if (sa.getBoolean( if (sa.getBoolean( Loading
core/java/android/content/pm/parsing/ApkLiteParseUtils.java +0 −4 Original line number Original line Diff line number Diff line Loading @@ -380,10 +380,6 @@ public class ApkLiteParseUtils { switch (attr) { switch (attr) { case "debuggable": case "debuggable": debuggable = attrs.getAttributeBooleanValue(i, false); debuggable = attrs.getAttributeBooleanValue(i, false); if (debuggable) { // Debuggable implies profileable profilableByShell = true; } break; break; case "multiArch": case "multiArch": multiArch = attrs.getAttributeBooleanValue(i, false); multiArch = attrs.getAttributeBooleanValue(i, false); Loading
core/java/android/content/pm/parsing/ParsingPackageUtils.java +1 −2 Original line number Original line Diff line number Diff line Loading @@ -1720,8 +1720,7 @@ public class ParsingPackageUtils { // TODO(b/135203078): Should parsing code be responsible for this? Maybe move to a // TODO(b/135203078): Should parsing code be responsible for this? Maybe move to a // util or just have PackageImpl return true if either flag is set // util or just have PackageImpl return true if either flag is set // Debuggable implies profileable pkg.setProfileableByShell(pkg.isProfileableByShell()); pkg.setProfileableByShell(pkg.isProfileableByShell() || pkg.isDebuggable()); if (sa.hasValueOrEmpty(R.styleable.AndroidManifestApplication_resizeableActivity)) { if (sa.hasValueOrEmpty(R.styleable.AndroidManifestApplication_resizeableActivity)) { pkg.setResizeableActivity(sa.getBoolean( pkg.setResizeableActivity(sa.getBoolean( Loading
services/core/java/com/android/server/am/ActivityManagerService.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -405,9 +405,7 @@ import java.util.Locale; import java.util.Map; import java.util.Map; import java.util.Objects; import java.util.Objects; import java.util.Set; import java.util.Set; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger; Loading Loading @@ -8436,7 +8434,9 @@ public class ActivityManagerService extends IActivityManager.Stub synchronized (this) { synchronized (this) { boolean isDebuggable = "1".equals(SystemProperties.get(SYSTEM_DEBUGGABLE, "0")); boolean isDebuggable = "1".equals(SystemProperties.get(SYSTEM_DEBUGGABLE, "0")); if (!isDebuggable) { if (!isDebuggable) { if (!app.isProfileableByShell()) { boolean isAppDebuggable = (app.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; boolean isAppProfileable = app.isProfileableByShell(); if (!isAppDebuggable && !isAppProfileable) { throw new SecurityException("Process not debuggable, " throw new SecurityException("Process not debuggable, " + "and not profileable by shell: " + app.packageName); + "and not profileable by shell: " + app.packageName); } } Loading