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

Commit 914ad469 authored by Song Chun Fan's avatar Song Chun Fan Committed by David Lin
Browse files

Revert "Update the enabled state with the current user state"

This reverts commit 6dbc700b.

Reason for revert: potential culprit for test breakage in <b/323086946>
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:961000c31f541e413073610028e72fb5a11ac177)
Merged-In: Ic4f36ad4492c26314eddc3cd2c28a7bafd609a50
Change-Id: Ic4f36ad4492c26314eddc3cd2c28a7bafd609a50
24D1-dev is based on 24Q2-release. Therefore, we merged this CL to 24D1-dev.
parent b75186ff
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -596,7 +596,7 @@ public class PackageInfoUtils {
        ai.requiredDisplayCategory = a.getRequiredDisplayCategory();
        ai.requireContentUriPermissionFromCaller = a.getRequireContentUriPermissionFromCaller();
        ai.setKnownActivityEmbeddingCerts(a.getKnownActivityEmbeddingCerts());
        assignFieldsComponentInfoParsedMainComponent(ai, a, pkgSetting, state, userId);
        assignFieldsComponentInfoParsedMainComponent(ai, a, pkgSetting, userId);
        return ai;
    }

@@ -659,7 +659,7 @@ public class PackageInfoUtils {
            // Backwards compatibility, coerce to null if empty
            si.metaData = metaData.isEmpty() ? null : metaData;
        }
        assignFieldsComponentInfoParsedMainComponent(si, s, pkgSetting, state, userId);
        assignFieldsComponentInfoParsedMainComponent(si, s, pkgSetting, userId);
        return si;
    }

@@ -710,7 +710,7 @@ public class PackageInfoUtils {
            pi.metaData = metaData.isEmpty() ? null : metaData;
        }
        pi.applicationInfo = applicationInfo;
        assignFieldsComponentInfoParsedMainComponent(pi, p, pkgSetting, state, userId);
        assignFieldsComponentInfoParsedMainComponent(pi, p, pkgSetting, userId);
        return pi;
    }

@@ -903,13 +903,8 @@ public class PackageInfoUtils {

    private static void assignFieldsComponentInfoParsedMainComponent(
            @NonNull ComponentInfo info, @NonNull ParsedMainComponent component,
            @NonNull PackageStateInternal pkgSetting, @NonNull PackageUserStateInternal state,
            @UserIdInt int userId) {
            @NonNull PackageStateInternal pkgSetting, @UserIdInt int userId) {
        assignFieldsComponentInfoParsedMainComponent(info, component);
        // overwrite the enabled state with the current user state
        info.enabled = PackageUserStateUtils.isEnabled(state, info.applicationInfo.enabled,
                info.enabled, info.name, /* flags */ 0);

        Pair<CharSequence, Integer> labelAndIcon =
                ParsedComponentStateUtils.getNonLocalizedLabelAndIcon(component, pkgSetting,
                        userId);