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

Commit 961000c3 authored by Song Chun Fan's avatar Song Chun Fan Committed by Android (Google) Code Review
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

Change-Id: Ic4f36ad4492c26314eddc3cd2c28a7bafd609a50
parent 6dbc700b
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -595,7 +595,7 @@ public class PackageInfoUtils {
        ai.applicationInfo = applicationInfo;
        ai.requiredDisplayCategory = a.getRequiredDisplayCategory();
        ai.setKnownActivityEmbeddingCerts(a.getKnownActivityEmbeddingCerts());
        assignFieldsComponentInfoParsedMainComponent(ai, a, pkgSetting, state, userId);
        assignFieldsComponentInfoParsedMainComponent(ai, a, pkgSetting, userId);
        return ai;
    }

@@ -658,7 +658,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;
    }

@@ -709,7 +709,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;
    }

@@ -902,13 +902,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);