diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-09-14 12:31:20 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-09-14 12:31:20 -0700 |
commit | 5c2a46848133c0ad6b2197aa1d6f5ae2ba9c8119 (patch) | |
tree | cb1f41a97fd591f5e6a5a4adeea08755ff3da402 | |
parent | c5c8dad0afb84bda9495a0aa1f7d6a3db28de5cb (diff) | |
parent | 44178e2801c013e60defb4b5f390d893e7344a71 (diff) | |
download | packages_apps_Settings-5c2a46848133c0ad6b2197aa1d6f5ae2ba9c8119.zip packages_apps_Settings-5c2a46848133c0ad6b2197aa1d6f5ae2ba9c8119.tar.gz packages_apps_Settings-5c2a46848133c0ad6b2197aa1d6f5ae2ba9c8119.tar.bz2 |
Merge "Supercalifragilisticexpialidocious." into gingerbread
-rw-r--r-- | src/com/android/settings/applications/InstalledAppDetails.java | 49 | ||||
-rw-r--r-- | src/com/android/settings/applications/ManageApplications.java | 6 |
2 files changed, 31 insertions, 24 deletions
diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java index 8765dfb..af03549 100644 --- a/src/com/android/settings/applications/InstalledAppDetails.java +++ b/src/com/android/settings/applications/InstalledAppDetails.java @@ -69,6 +69,7 @@ import android.widget.TextView; public class InstalledAppDetails extends Activity implements View.OnClickListener, ApplicationsState.Callbacks { private static final String TAG="InstalledAppDetails"; + static final boolean SUPPORT_DISABLE_APPS = false; private PackageManager mPm; private ApplicationsState mState; @@ -259,30 +260,32 @@ public class InstalledAppDetails extends Activity } else { if ((mAppEntry.info.flags & ApplicationInfo.FLAG_SYSTEM) != 0) { enabled = false; - try { - // Try to prevent the user from bricking their phone - // by not allowing disabling of apps signed with the - // system cert and any launcher app in the system. - PackageInfo sys = mPm.getPackageInfo("android", - PackageManager.GET_SIGNATURES); - Intent intent = new Intent(Intent.ACTION_MAIN); - intent.addCategory(Intent.CATEGORY_HOME); - intent.setPackage(mAppEntry.info.packageName); - List<ResolveInfo> homes = mPm.queryIntentActivities(intent, 0); - if ((homes != null && homes.size() > 0) || - (mPackageInfo != null && - sys.signatures[0].equals(mPackageInfo.signatures[0]))) { - // Disable button for core system applications. - mUninstallButton.setText(R.string.disable_text); - } else if (mAppEntry.info.enabled) { - mUninstallButton.setText(R.string.disable_text); - enabled = true; - } else { - mUninstallButton.setText(R.string.enable_text); - enabled = true; + if (SUPPORT_DISABLE_APPS) { + try { + // Try to prevent the user from bricking their phone + // by not allowing disabling of apps signed with the + // system cert and any launcher app in the system. + PackageInfo sys = mPm.getPackageInfo("android", + PackageManager.GET_SIGNATURES); + Intent intent = new Intent(Intent.ACTION_MAIN); + intent.addCategory(Intent.CATEGORY_HOME); + intent.setPackage(mAppEntry.info.packageName); + List<ResolveInfo> homes = mPm.queryIntentActivities(intent, 0); + if ((homes != null && homes.size() > 0) || + (mPackageInfo != null && + sys.signatures[0].equals(mPackageInfo.signatures[0]))) { + // Disable button for core system applications. + mUninstallButton.setText(R.string.disable_text); + } else if (mAppEntry.info.enabled) { + mUninstallButton.setText(R.string.disable_text); + enabled = true; + } else { + mUninstallButton.setText(R.string.enable_text); + enabled = true; + } + } catch (PackageManager.NameNotFoundException e) { + Log.w(TAG, "Unable to get package info", e); } - } catch (PackageManager.NameNotFoundException e) { - Log.w(TAG, "Unable to get package info", e); } } else { mUninstallButton.setText(R.string.uninstall_text); diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/ManageApplications.java index 772e48d..34e0e8e 100644 --- a/src/com/android/settings/applications/ManageApplications.java +++ b/src/com/android/settings/applications/ManageApplications.java @@ -354,7 +354,11 @@ public class ManageApplications extends TabActivity implements holder.appIcon.setImageDrawable(entry.icon); } holder.updateSizeText(ManageApplications.this); - holder.disabled.setVisibility(entry.info.enabled ? View.GONE : View.VISIBLE); + if (InstalledAppDetails.SUPPORT_DISABLE_APPS) { + holder.disabled.setVisibility(entry.info.enabled ? View.GONE : View.VISIBLE); + } else { + holder.disabled.setVisibility(View.GONE); + } } mActive.remove(convertView); mActive.add(convertView); |