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

Commit d4ab7ece authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Do not change value read from manifest."

parents 59de9464 3c7b637a
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -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();
@@ -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);


+0 −6
Original line number Original line Diff line number Diff line
@@ -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);
@@ -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(
+0 −4
Original line number Original line Diff line number Diff line
@@ -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);
+1 −2
Original line number Original line Diff line number Diff line
@@ -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(
+3 −3
Original line number Original line Diff line number Diff line
@@ -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;
@@ -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);
                }
                }