Merge "Supercalifragilisticexpialidocious." into gingerbread
This commit is contained in:
committed by
Android (Google) Code Review
commit
5c2a468481
@@ -69,6 +69,7 @@ import android.widget.TextView;
|
|||||||
public class InstalledAppDetails extends Activity
|
public class InstalledAppDetails extends Activity
|
||||||
implements View.OnClickListener, ApplicationsState.Callbacks {
|
implements View.OnClickListener, ApplicationsState.Callbacks {
|
||||||
private static final String TAG="InstalledAppDetails";
|
private static final String TAG="InstalledAppDetails";
|
||||||
|
static final boolean SUPPORT_DISABLE_APPS = false;
|
||||||
|
|
||||||
private PackageManager mPm;
|
private PackageManager mPm;
|
||||||
private ApplicationsState mState;
|
private ApplicationsState mState;
|
||||||
@@ -259,30 +260,32 @@ public class InstalledAppDetails extends Activity
|
|||||||
} else {
|
} else {
|
||||||
if ((mAppEntry.info.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
|
if ((mAppEntry.info.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
|
||||||
enabled = false;
|
enabled = false;
|
||||||
try {
|
if (SUPPORT_DISABLE_APPS) {
|
||||||
// Try to prevent the user from bricking their phone
|
try {
|
||||||
// by not allowing disabling of apps signed with the
|
// Try to prevent the user from bricking their phone
|
||||||
// system cert and any launcher app in the system.
|
// by not allowing disabling of apps signed with the
|
||||||
PackageInfo sys = mPm.getPackageInfo("android",
|
// system cert and any launcher app in the system.
|
||||||
PackageManager.GET_SIGNATURES);
|
PackageInfo sys = mPm.getPackageInfo("android",
|
||||||
Intent intent = new Intent(Intent.ACTION_MAIN);
|
PackageManager.GET_SIGNATURES);
|
||||||
intent.addCategory(Intent.CATEGORY_HOME);
|
Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||||
intent.setPackage(mAppEntry.info.packageName);
|
intent.addCategory(Intent.CATEGORY_HOME);
|
||||||
List<ResolveInfo> homes = mPm.queryIntentActivities(intent, 0);
|
intent.setPackage(mAppEntry.info.packageName);
|
||||||
if ((homes != null && homes.size() > 0) ||
|
List<ResolveInfo> homes = mPm.queryIntentActivities(intent, 0);
|
||||||
(mPackageInfo != null &&
|
if ((homes != null && homes.size() > 0) ||
|
||||||
sys.signatures[0].equals(mPackageInfo.signatures[0]))) {
|
(mPackageInfo != null &&
|
||||||
// Disable button for core system applications.
|
sys.signatures[0].equals(mPackageInfo.signatures[0]))) {
|
||||||
mUninstallButton.setText(R.string.disable_text);
|
// Disable button for core system applications.
|
||||||
} else if (mAppEntry.info.enabled) {
|
mUninstallButton.setText(R.string.disable_text);
|
||||||
mUninstallButton.setText(R.string.disable_text);
|
} else if (mAppEntry.info.enabled) {
|
||||||
enabled = true;
|
mUninstallButton.setText(R.string.disable_text);
|
||||||
} else {
|
enabled = true;
|
||||||
mUninstallButton.setText(R.string.enable_text);
|
} else {
|
||||||
enabled = true;
|
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 {
|
} else {
|
||||||
mUninstallButton.setText(R.string.uninstall_text);
|
mUninstallButton.setText(R.string.uninstall_text);
|
||||||
|
@@ -354,7 +354,11 @@ public class ManageApplications extends TabActivity implements
|
|||||||
holder.appIcon.setImageDrawable(entry.icon);
|
holder.appIcon.setImageDrawable(entry.icon);
|
||||||
}
|
}
|
||||||
holder.updateSizeText(ManageApplications.this);
|
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.remove(convertView);
|
||||||
mActive.add(convertView);
|
mActive.add(convertView);
|
||||||
|
Reference in New Issue
Block a user