Make settings a little aware of multi-user install.

Change-Id: Id04f137dbc80dfee7b6c436efc2225ceccb88faa
This commit is contained in:
Dianne Hackborn
2012-08-23 18:44:31 -07:00
parent f3de41a24d
commit 2e3c75094b
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);
}