Merge "am compat reset --no-kill shouldn't kill the process" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
2c3254c775
@@ -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 ==
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user