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

Commit d847634e authored by Marybeth Fair's avatar Marybeth Fair
Browse files

Update PackageManager to use new API.

Use existing unit test since this method was added to preserve PackageManager behavior.

Test: atest com.android.server.pm.PackageParserTest#testParseWithFeatureFlagAttributes_newStorage
Bug: 377311211
Change-Id: I72852c14812f527b6e687ba909ee6a8599727a04
Flag: android.provider.flags.public_internal_read_api
parent a92d9341
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.internal.pm.pkg.component;

import static android.provider.flags.Flags.newStoragePublicApi;
import static android.provider.flags.Flags.publicInternalReadApi;

import static com.android.internal.pm.pkg.parsing.ParsingUtils.ANDROID_RES_NAMESPACE;

@@ -271,7 +272,11 @@ public class AconfigFlags {
            // Note: Unlike with the old storage, with AconfigPackage, we don't have a way to
            // know if the flag is not found or if it's found but the value is false.
            try {
                if (publicInternalReadApi()) {
                    value = aconfigPackage.getBooleanFlagValueInternal(flagName, false);
                } else {
                    value = aconfigPackage.getBooleanFlagValue(flagName, false);
                }
            } catch (Exception e) {
                Slog.e(LOG_TAG, "Failed to read Aconfig flag value for " + flagPackageAndName, e);
                return null;