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

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

Merge "`am compat reset --no-kill` shouldn't kill the process" into sc-dev

parents aa3477c5 4aa9369c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -179,9 +179,10 @@ interface IPlatformCompat {
     *
     * @param changeId    the ID of the change that was overridden
     * @param packageName the app package name that was overridden
     * @return {@code true} if an override existed
     * @throws SecurityException if overriding changes is not permitted
     */
    void clearOverrideForTest(long changeId, String packageName);
    boolean clearOverrideForTest(long changeId, String packageName);

    /**
     * Enables all compatibility changes that have enabledSinceTargetSdk ==
+7 −1
Original line number Diff line number Diff line
@@ -2984,7 +2984,13 @@ final class ActivityManagerShellCommand extends ShellCommand {
                        pw.println("Reset all changes for " + packageName + " to default value.");
                        return 0;
                    }
                    if (platformCompat.clearOverride(changeId, packageName)) {
                    boolean existed;
                    if (killPackage) {
                        existed = platformCompat.clearOverride(changeId, packageName);
                    } else {
                        existed = platformCompat.clearOverrideForTest(changeId, packageName);
                    }
                    if (existed) {
                        pw.println("Reset change " + changeId + " for " + packageName
                                + " to default value.");
                    } else {
+2 −2
Original line number Diff line number Diff line
@@ -211,9 +211,9 @@ public class PlatformCompat extends IPlatformCompat.Stub {
    }

    @Override
    public void clearOverrideForTest(long changeId, String packageName) {
    public boolean clearOverrideForTest(long changeId, String packageName) {
        checkCompatChangeOverridePermission();
        mCompatConfig.removeOverride(changeId, packageName);
        return mCompatConfig.removeOverride(changeId, packageName);
    }

    @Override