Loading services/core/java/com/android/server/pm/InstallPackageHelper.java +17 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,7 @@ import com.android.server.pm.permission.Permission; import com.android.server.pm.permission.PermissionManagerServiceInternal; import com.android.server.pm.pkg.AndroidPackage; import com.android.server.pm.pkg.PackageStateInternal; import com.android.server.pm.pkg.PackageUserStateInternal; import com.android.server.pm.pkg.SharedLibraryWrapper; import com.android.server.rollback.RollbackManagerInternal; import com.android.server.utils.WatchedArrayMap; Loading Loading @@ -2617,6 +2618,22 @@ final class InstallPackageHelper { } // Clear any existing archive state. mPm.mInstallerService.mPackageArchiver.clearArchiveState(ps, userId); // Check for new user that was created at the same time of this installation // and has no UserState if pkg is installed for first time. final SparseArray<? extends PackageUserStateInternal> us = ps.getUserStates(); if (allUsers.length != us.size()) { for (int i = 0; i < allUsers.length; i++) { final int currentUserId = allUsers[i]; final PackageUserStateInternal pus = us.get(currentUserId); if (pus == null) { // If a user state doesn't exist, explicitly set the app to // be not installed on the user, otherwise the default installed // state on that user would become true, which is incorrect. ps.setInstalled(false, currentUserId); } } } } else { // The caller explicitly specified INSTALL_ALL_USERS flag. // Thus, updating the settings to install the app for all users. Loading services/core/java/com/android/server/pm/PackageSetting.java +1 −1 Original line number Diff line number Diff line Loading @@ -853,7 +853,7 @@ public class PackageSetting extends SettingBase implements PackageStateInternal usesStaticLibrariesVersions = other.usesStaticLibrariesVersions != null ? Arrays.copyOf(other.usesStaticLibrariesVersions, other.usesStaticLibrariesVersions.length) : null; mUserStates.clear(); for (int i = 0; i < other.mUserStates.size(); i++) { if (sealedSnapshot) { mUserStates.put(other.mUserStates.keyAt(i), Loading Loading
services/core/java/com/android/server/pm/InstallPackageHelper.java +17 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,7 @@ import com.android.server.pm.permission.Permission; import com.android.server.pm.permission.PermissionManagerServiceInternal; import com.android.server.pm.pkg.AndroidPackage; import com.android.server.pm.pkg.PackageStateInternal; import com.android.server.pm.pkg.PackageUserStateInternal; import com.android.server.pm.pkg.SharedLibraryWrapper; import com.android.server.rollback.RollbackManagerInternal; import com.android.server.utils.WatchedArrayMap; Loading Loading @@ -2617,6 +2618,22 @@ final class InstallPackageHelper { } // Clear any existing archive state. mPm.mInstallerService.mPackageArchiver.clearArchiveState(ps, userId); // Check for new user that was created at the same time of this installation // and has no UserState if pkg is installed for first time. final SparseArray<? extends PackageUserStateInternal> us = ps.getUserStates(); if (allUsers.length != us.size()) { for (int i = 0; i < allUsers.length; i++) { final int currentUserId = allUsers[i]; final PackageUserStateInternal pus = us.get(currentUserId); if (pus == null) { // If a user state doesn't exist, explicitly set the app to // be not installed on the user, otherwise the default installed // state on that user would become true, which is incorrect. ps.setInstalled(false, currentUserId); } } } } else { // The caller explicitly specified INSTALL_ALL_USERS flag. // Thus, updating the settings to install the app for all users. Loading
services/core/java/com/android/server/pm/PackageSetting.java +1 −1 Original line number Diff line number Diff line Loading @@ -853,7 +853,7 @@ public class PackageSetting extends SettingBase implements PackageStateInternal usesStaticLibrariesVersions = other.usesStaticLibrariesVersions != null ? Arrays.copyOf(other.usesStaticLibrariesVersions, other.usesStaticLibrariesVersions.length) : null; mUserStates.clear(); for (int i = 0; i < other.mUserStates.size(); i++) { if (sealedSnapshot) { mUserStates.put(other.mUserStates.keyAt(i), Loading