SystemInstaller: don't try to remove system apps without updates

This commit is contained in:
Daniel Martí 2015-08-09 22:47:48 -07:00
parent 8d5c7abe89
commit ba54e8b798

View File

@ -193,7 +193,16 @@ public class SystemInstaller extends Installer {
return; return;
} }
final boolean isSystem = ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0);
final boolean isUpdate = ((appInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0); final boolean isUpdate = ((appInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0);
if (isSystem && !isUpdate) {
// Cannot remove system apps unless we're uninstalling updates
mCallback.onError(InstallerCallback.OPERATION_DELETE,
InstallerCallback.ERROR_CODE_OTHER);
return;
}
int messageId; int messageId;
if (isUpdate) { if (isUpdate) {
messageId = R.string.uninstall_update_confirm; messageId = R.string.uninstall_update_confirm;