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

This reverts commit 6dbc700b2452d2194cc18ec2d1c25a30fb71c6a1.

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
diff --git a/services/core/java/com/android/server/pm/parsing/PackageInfoUtils.java b/services/core/java/com/android/server/pm/parsing/PackageInfoUtils.java
index b18503d..1c70af0 100644
--- a/services/core/java/com/android/server/pm/parsing/PackageInfoUtils.java
+++ b/services/core/java/com/android/server/pm/parsing/PackageInfoUtils.java
@@ -596,7 +596,7 @@
         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 @@
             // 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 @@
             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 @@
 
     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);