Backporting I57c58c4083bd59f45095c184d6ca5a302f79ff6e to HC-MR1. New change
since file was renamed, making cherry-pick impossible.

Change-Id: Idc802af57fb9926a69ed52d4e776ef57d8b647c6
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index d542673..5cd942c 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -9323,6 +9323,19 @@
             }
             mPendingPackages.clear();
 
+            /*
+             * Make sure all the updated system packages have their shared users
+             * associated with them.
+             */
+            final Iterator<PackageSetting> disabledIt = mDisabledSysPackages.values().iterator();
+            while (disabledIt.hasNext()) {
+                final PackageSetting disabledPs = disabledIt.next();
+                final Object id = getUserIdLP(disabledPs.userId);
+                if (id != null && id instanceof SharedUserSetting) {
+                  disabledPs.sharedUser = (SharedUserSetting) id;
+                }
+            }
+
             readStoppedLP();
 
             mReadMessages.append("Read completed successfully: "