Loading services/core/java/com/android/server/pm/RemovePackageHelper.java +1 −2 Original line number Diff line number Diff line Loading @@ -392,8 +392,7 @@ final class RemovePackageHelper { // Delete from mSettings final SparseBooleanArray changedUsers = new SparseBooleanArray(); synchronized (mPm.mLock) { mPm.mSettings.removePackageLPw(packageName); outInfo.mIsAppIdRemoved = true; outInfo.mIsAppIdRemoved = mPm.mSettings.removePackageAndAppIdLPw(packageName); if (!mPm.mSettings.isDisabledSystemPackageLPr(packageName)) { final SharedUserSetting sus = mPm.mSettings.getSharedUserSettingLPr(deletedPs); // If we don't have a disabled system package to reinstall, the package is Loading services/core/java/com/android/server/pm/Settings.java +12 −7 Original line number Diff line number Diff line Loading @@ -92,7 +92,6 @@ import android.util.proto.ProtoOutputStream; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.os.BackgroundThread; import com.android.internal.pm.parsing.pkg.PackageImpl; import com.android.internal.pm.pkg.component.ParsedComponent; import com.android.internal.pm.pkg.component.ParsedIntentInfo; import com.android.internal.pm.pkg.component.ParsedPermission; Loading Loading @@ -1460,22 +1459,28 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile return false; } int removePackageLPw(String name) { /** * Remove package from mPackages and its corresponding AppId. * * @return True if the AppId has been removed. * False if the app doesn't exist, or if the app has a shared UID and there are other apps that * still use the same shared UID even after the target app is removed. */ boolean removePackageAndAppIdLPw(String name) { final PackageSetting p = mPackages.remove(name); if (p != null) { removeInstallerPackageStatus(name); SharedUserSetting sharedUserSetting = getSharedUserSettingLPr(p); if (sharedUserSetting != null) { sharedUserSetting.removePackage(p); if (checkAndPruneSharedUserLPw(sharedUserSetting, false)) { return sharedUserSetting.mAppId; } return checkAndPruneSharedUserLPw(sharedUserSetting, false); } else { removeAppIdLPw(p.getAppId()); return p.getAppId(); return true; } } return -1; return false; } /** Loading Loading
services/core/java/com/android/server/pm/RemovePackageHelper.java +1 −2 Original line number Diff line number Diff line Loading @@ -392,8 +392,7 @@ final class RemovePackageHelper { // Delete from mSettings final SparseBooleanArray changedUsers = new SparseBooleanArray(); synchronized (mPm.mLock) { mPm.mSettings.removePackageLPw(packageName); outInfo.mIsAppIdRemoved = true; outInfo.mIsAppIdRemoved = mPm.mSettings.removePackageAndAppIdLPw(packageName); if (!mPm.mSettings.isDisabledSystemPackageLPr(packageName)) { final SharedUserSetting sus = mPm.mSettings.getSharedUserSettingLPr(deletedPs); // If we don't have a disabled system package to reinstall, the package is Loading
services/core/java/com/android/server/pm/Settings.java +12 −7 Original line number Diff line number Diff line Loading @@ -92,7 +92,6 @@ import android.util.proto.ProtoOutputStream; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.os.BackgroundThread; import com.android.internal.pm.parsing.pkg.PackageImpl; import com.android.internal.pm.pkg.component.ParsedComponent; import com.android.internal.pm.pkg.component.ParsedIntentInfo; import com.android.internal.pm.pkg.component.ParsedPermission; Loading Loading @@ -1460,22 +1459,28 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile return false; } int removePackageLPw(String name) { /** * Remove package from mPackages and its corresponding AppId. * * @return True if the AppId has been removed. * False if the app doesn't exist, or if the app has a shared UID and there are other apps that * still use the same shared UID even after the target app is removed. */ boolean removePackageAndAppIdLPw(String name) { final PackageSetting p = mPackages.remove(name); if (p != null) { removeInstallerPackageStatus(name); SharedUserSetting sharedUserSetting = getSharedUserSettingLPr(p); if (sharedUserSetting != null) { sharedUserSetting.removePackage(p); if (checkAndPruneSharedUserLPw(sharedUserSetting, false)) { return sharedUserSetting.mAppId; } return checkAndPruneSharedUserLPw(sharedUserSetting, false); } else { removeAppIdLPw(p.getAppId()); return p.getAppId(); return true; } } return -1; return false; } /** Loading