Fix 3385675: Uninstall option available for system app

- when a system app is selected in all apps, don't show uninstall button
- if it's an updated system app, show "Uninstall update"
- Also, remove unused code for non-existent flag for games

Change-Id: I46753ee8d213b2ba1613b71ac1fe73d79786129c
This commit is contained in:
Patrick Dubroy committed 2011-02-28 15:49:59 -08:00
1 parent 60b753b4cf
commit cd953711fc
7 files changed
+31 -35

No files matched your search

+7 -12
View File
@@ -59,9 +59,9 @@ class ApplicationInfo extends ItemInfo {
ComponentName componentName;
static final int APP_FLAG = 1;
static final int GAME_FLAG = 2;
static final int DOWNLOADED_FLAG = 4;
static final int DOWNLOADED_FLAG = 1;
static final int UPDATED_SYSTEM_APP_FLAG = 2;
int flags = 0;
ApplicationInfo() {
@@ -83,17 +83,12 @@ class ApplicationInfo extends ItemInfo {
int appFlags = pm.getApplicationInfo(packageName, 0).flags;
if ((appFlags & android.content.pm.ApplicationInfo.FLAG_SYSTEM) == 0) {
flags |= DOWNLOADED_FLAG;
}
if ((appFlags & android.content.pm.ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) {
flags |= DOWNLOADED_FLAG;
if ((appFlags & android.content.pm.ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) {
flags |= UPDATED_SYSTEM_APP_FLAG;
}
}
firstInstallTime = pm.getPackageInfo(packageName, 0).firstInstallTime;
// TODO: Figure out how to determine what is a game
// If it's not a game, it's an app
if ((flags & GAME_FLAG) == 0) {
flags |= APP_FLAG;
}
} catch (NameNotFoundException e) {
Log.d(TAG, "PackageManager.getApplicationInfo failed for " + packageName);
}