summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/Launcher.java
diff options
context:
space:
mode:
authorPatrick Dubroy <dubroy@google.com>2010-09-07 15:22:01 -0700
committerPatrick Dubroy <dubroy@google.com>2010-09-07 15:22:10 -0700
commit5539af7826ad6dd16202c56549d26dfdcbf977b1 (patch)
tree123e1a9f5f77f2923fc9f26e1a775d3a8a3686df /src/com/android/launcher2/Launcher.java
parent9f7aec8d4317d0407a41e12f236c962b225cb4c3 (diff)
downloadandroid_packages_apps_Trebuchet-5539af7826ad6dd16202c56549d26dfdcbf977b1.tar.gz
android_packages_apps_Trebuchet-5539af7826ad6dd16202c56549d26dfdcbf977b1.tar.bz2
android_packages_apps_Trebuchet-5539af7826ad6dd16202c56549d26dfdcbf977b1.zip
Don't allow system apps to be uninstalled by tapping the trash can button.
Diffstat (limited to 'src/com/android/launcher2/Launcher.java')
-rw-r--r--src/com/android/launcher2/Launcher.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 637f79fb7..b0c6b7042 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -1772,12 +1772,19 @@ public final class Launcher extends Activity
startActivity(intent);
}
- void startApplicationUninstallActivity(ComponentName componentName) {
- String packageName = componentName.getPackageName();
- String className = componentName.getClassName();
- Intent intent = new Intent(
- Intent.ACTION_DELETE, Uri.fromParts("package", packageName, className));
- startActivity(intent);
+ void startApplicationUninstallActivity(ApplicationInfo appInfo) {
+ if ((appInfo.flags & ApplicationInfo.DOWNLOADED_FLAG) == 0) {
+ // System applications cannot be installed. For now, show a toast explaining that.
+ // We may give them the option of disabling apps this way.
+ int messageId = R.string.uninstall_system_app_text;
+ Toast.makeText(this, messageId, Toast.LENGTH_SHORT).show();
+ } else {
+ String packageName = appInfo.componentName.getPackageName();
+ String className = appInfo.componentName.getClassName();
+ Intent intent = new Intent(
+ Intent.ACTION_DELETE, Uri.fromParts("package", packageName, className));
+ startActivity(intent);
+ }
}
void startActivitySafely(Intent intent, Object tag) {