Merge "Fix re-installation via package uri-s" into qt-dev

This commit is contained in:
TreeHugger Robot
2019-04-13 14:12:03 +00:00
committed by Android (Google) Code Review

View File

@@ -83,6 +83,15 @@ public class InstallInstalling extends AlertActivity {
ApplicationInfo appInfo = getIntent() ApplicationInfo appInfo = getIntent()
.getParcelableExtra(PackageUtil.INTENT_ATTR_APPLICATION_INFO); .getParcelableExtra(PackageUtil.INTENT_ATTR_APPLICATION_INFO);
mPackageURI = getIntent().getData(); mPackageURI = getIntent().getData();
if ("package".equals(mPackageURI.getScheme())) {
try {
getPackageManager().installExistingPackage(appInfo.packageName);
launchSuccess();
} catch (PackageManager.NameNotFoundException e) {
launchFailure(PackageManager.INSTALL_FAILED_INTERNAL_ERROR, null);
}
} else {
final File sourceFile = new File(mPackageURI.getPath()); final File sourceFile = new File(mPackageURI.getPath());
PackageUtil.AppSnippet as = PackageUtil.getAppSnippet(this, appInfo, sourceFile); PackageUtil.AppSnippet as = PackageUtil.getAppSnippet(this, appInfo, sourceFile);
@@ -106,14 +115,6 @@ public class InstallInstalling extends AlertActivity {
setupAlert(); setupAlert();
requireViewById(R.id.installing).setVisibility(View.VISIBLE); requireViewById(R.id.installing).setVisibility(View.VISIBLE);
if ("package".equals(mPackageURI.getScheme())) {
try {
getPackageManager().installExistingPackage(appInfo.packageName);
launchSuccess();
} catch (PackageManager.NameNotFoundException e) {
launchFailure(PackageManager.INSTALL_FAILED_INTERNAL_ERROR, null);
}
} else {
if (savedInstanceState != null) { if (savedInstanceState != null) {
mSessionId = savedInstanceState.getInt(SESSION_ID); mSessionId = savedInstanceState.getInt(SESSION_ID);
mInstallId = savedInstanceState.getInt(INSTALL_ID); mInstallId = savedInstanceState.getInt(INSTALL_ID);