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

Commit f4fd7c70 authored by Andrei Onea's avatar Andrei Onea Committed by Automerger Merge Worker
Browse files

Add non-logging method to PlatformCompat am: 5249ffc9

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2157cf252a274e1cf78ab5d9466b23786a74d659
parents 7861bbb7 5249ffc9
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -107,17 +107,23 @@ public class PlatformCompat extends IPlatformCompat.Stub {
    }

    /**
     * Internal version of the above method. Does not perform costly permission check.
     * Internal version of the above method, without logging. Does not perform costly permission
     * check.
     * TODO(b/167551701): Remove this method and add 'loggability' as a changeid property.
     */
    public boolean isChangeEnabledInternal(long changeId, ApplicationInfo appInfo) {
        if (mCompatConfig.isChangeEnabled(changeId, appInfo)) {
            reportChange(changeId, appInfo.uid,
                    ChangeReporter.STATE_ENABLED);
            return true;
    public boolean isChangeEnabledInternalNoLogging(long changeId, ApplicationInfo appInfo) {
        return mCompatConfig.isChangeEnabled(changeId, appInfo);
    }

    /**
     * Internal version of {@link #isChangeEnabled(long, ApplicationInfo)}. Does not perform costly
     * permission check.
     */
    public boolean isChangeEnabledInternal(long changeId, ApplicationInfo appInfo) {
        boolean value = isChangeEnabledInternalNoLogging(changeId, appInfo);
        reportChange(changeId, appInfo.uid,
                ChangeReporter.STATE_DISABLED);
        return false;
                value ? ChangeReporter.STATE_ENABLED : ChangeReporter.STATE_DISABLED);
        return value;
    }

    @Override
+2 −1
Original line number Diff line number Diff line
@@ -290,7 +290,8 @@ public class AppsFilter {

        private void updateEnabledState(@NonNull AndroidPackage pkg) {
            // TODO(b/135203078): Do not use toAppInfo
            final boolean enabled = mInjector.getCompatibility().isChangeEnabledInternal(
            // TODO(b/167551701): Make changeId non-logging
            final boolean enabled = mInjector.getCompatibility().isChangeEnabledInternalNoLogging(
                    PackageManager.FILTER_APPLICATION_QUERY, pkg.toAppInfoWithoutState());
            if (enabled) {
                mDisabledPackages.remove(pkg.getPackageName());