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

Commit 3bbe9c33 authored by satayev's avatar satayev Committed by Automerger Merge Worker
Browse files

Merge "Allow clearing a single change id for tests usage." am: 2805c995

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553537

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4a9c218bac4775f5b59c0b8d2c8154f38b0ff4b9
parents 5e27a324 2805c995
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -172,6 +172,17 @@ interface IPlatformCompat {
     */
    boolean clearOverride(long changeId, String packageName);

    /**
     * Restores the default behaviour for the given change and app.
     *
     * <p>Does not kill the app; to be only used in tests.
     *
     * @param changeId    the ID of the change that was overridden
     * @param packageName the app package name that was overridden
     * @throws SecurityException if overriding changes is not permitted
     */
    void clearOverrideForTest(long changeId, String packageName);

    /**
     * Enables all compatibility changes that have enabledSinceTargetSdk ==
     * {@param targetSdkVersion} for an app, subject to the policy.
+6 −0
Original line number Diff line number Diff line
@@ -210,6 +210,12 @@ public class PlatformCompat extends IPlatformCompat.Stub {
        return existed;
    }

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

    @Override
    public CompatibilityChangeConfig getAppConfig(ApplicationInfo appInfo) {
        checkCompatChangeReadAndLogPermission();