am 15b07df7: am 2e3c7509: Make settings a little aware of multi-user install.

* commit '15b07df79467aeabbe185a38397a90b2961a61b1':
  Make settings a little aware of multi-user install.
This commit is contained in:
Dianne Hackborn
2012-08-24 14:42:55 -07:00
committed by Android Git Automerger
2 changed files with 11 additions and 0 deletions

View File

@@ -322,6 +322,9 @@ public class InstalledAppDetails extends Fragment
Log.w(TAG, "Unable to get package info", e);
}
}
} else if ((mPackageInfo.applicationInfo.flags
& ApplicationInfo.FLAG_INSTALLED) == 0) {
mUninstallButton.setText(R.string.install_text);
} else {
mUninstallButton.setText(R.string.uninstall_text);
}
@@ -1042,6 +1045,12 @@ public class InstalledAppDetails extends Fragment
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT)
.execute((Object)null);
}
} else if ((mAppEntry.info.flags & ApplicationInfo.FLAG_INSTALLED) == 0) {
try {
mPm.installExistingPackage(packageName);
refreshUi();
} catch (NameNotFoundException e) {
}
} else {
uninstallPkg(packageName);
}