Automated import from //branches/donutburger/...@141523,141523

This commit is contained in:
Romain Guy
2009-03-24 20:27:49 -07:00
committed by The Android Open Source Project
parent d906b720b8
commit 96f4357e06

View File

@@ -3900,14 +3900,26 @@ class PackageManagerService extends IPackageManager.Stub {
private boolean deletePackageX(String packageName, boolean sendBroadCast,
boolean deleteCodeAndResources, int flags) {
PackageRemovedInfo info = new PackageRemovedInfo();
boolean res = false;
boolean res;
synchronized (mInstallLock) {
res = deletePackageLI(packageName, deleteCodeAndResources, flags, info);
}
if(res && sendBroadCast) {
info.sendBroadcast(deleteCodeAndResources, false);
boolean systemUpdate = info.isRemovedPackageSystemUpdate;
info.sendBroadcast(deleteCodeAndResources, systemUpdate);
// If the removed package was a system update, the old system packaged
// was re-enabled; we need to broadcast this information
if (systemUpdate) {
Bundle extras = new Bundle(1);
extras.putInt(Intent.EXTRA_UID, info.removedUid >= 0 ? info.removedUid : info.uid);
extras.putBoolean(Intent.EXTRA_REPLACING, true);
sendPackageBroadcast(Intent.ACTION_PACKAGE_ADDED, packageName, extras);
sendPackageBroadcast(Intent.ACTION_PACKAGE_REPLACED, packageName, extras);
}
}
return res;
}
@@ -3916,7 +3928,8 @@ class PackageManagerService extends IPackageManager.Stub {
String removedPackage;
int uid = -1;
int removedUid = -1;
boolean isRemovedPackageSystemUpdate = false;
void sendBroadcast(boolean fullRemove, boolean replacing) {
Bundle extras = new Bundle(1);
extras.putInt(Intent.EXTRA_UID, removedUid >= 0 ? removedUid : uid);
@@ -4002,6 +4015,7 @@ class PackageManagerService extends IPackageManager.Stub {
Log.i(TAG, "Deleting system pkg from data partition");
}
// Delete the updated package
outInfo.isRemovedPackageSystemUpdate = true;
boolean ret = deleteInstalledPackageLI(p, deleteCodeAndResources, flags, outInfo);
if (!ret) {
return false;