Show SD unavailable icon for apps on SD when ejected.

This change include a minor refactoring of PackageItemInfo and related
classes to eliminate code duplication and to avoid redundant work
searching for an ApplicationInfo instance we already have.

Bug: b/2537578
Change-Id: Id0794c3f055ea58b943028f7a84abc7dec9d0aac
This commit is contained in:
Jeff Brown
2010-03-30 19:57:08 -07:00
parent 966fcb81ee
commit 0733079111
8 changed files with 90 additions and 88 deletions

View File

@@ -6278,7 +6278,7 @@ class PackageManagerService extends IPackageManager.Stub {
Log.i(TAG, "Removing non-system package:"+p.packageName);
// Kill application pre-emptively especially for apps on sd.
killApplication(packageName, p.applicationInfo.uid);
ret = deleteInstalledPackageLI (p, deleteCodeAndResources, flags, outInfo);
ret = deleteInstalledPackageLI(p, deleteCodeAndResources, flags, outInfo);
}
return ret;
}
@@ -7605,9 +7605,10 @@ class PackageManagerService extends IPackageManager.Stub {
}
void setFlags(int pkgFlags) {
this.pkgFlags = (pkgFlags & ApplicationInfo.FLAG_SYSTEM) |
(pkgFlags & ApplicationInfo.FLAG_FORWARD_LOCK) |
(pkgFlags & ApplicationInfo.FLAG_EXTERNAL_STORAGE);
this.pkgFlags = pkgFlags & (
ApplicationInfo.FLAG_SYSTEM |
ApplicationInfo.FLAG_FORWARD_LOCK |
ApplicationInfo.FLAG_EXTERNAL_STORAGE);
}
}
@@ -9606,7 +9607,7 @@ class PackageManagerService extends IPackageManager.Stub {
}
// Parse package
int parseFlags = PackageParser.PARSE_CHATTY |
PackageParser.PARSE_ON_SDCARD | mDefParseFlags;
PackageParser.PARSE_ON_SDCARD | mDefParseFlags;
PackageParser pp = new PackageParser(codePath);
pp.setSeparateProcesses(mSeparateProcesses);
final PackageParser.Package pkg = pp.parsePackage(new File(codePath),
@@ -9682,7 +9683,7 @@ class PackageManagerService extends IPackageManager.Stub {
if (res) {
pkgList.add(pkgName);
} else {
Slog.e(TAG, "Failed to delete pkg from sdcard : " + pkgName);
Slog.e(TAG, "Failed to delete pkg from sdcard : " + pkgName);
failedList.add(args);
}
}