Commit 0e814daa authored by Vikas Pachdha's avatar Vikas Pachdha

Android: Ask to uninstall the app on version downgrade

Deploy step succeeds with error INSTALL_FAILED_VERSION_DOWNGRADE

Task-number: QTCREATORBUG-17789
Change-Id: Ib1c3023cbea7df1802ce967f10b549db7208aa17
Reviewed-by: Ulf Hermann's avatarUlf Hermann <ulf.hermann@qt.io>
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent fe27f947
...@@ -64,6 +64,7 @@ const QLatin1String UninstallPreviousPackageKey("UninstallPreviousPackage"); ...@@ -64,6 +64,7 @@ const QLatin1String UninstallPreviousPackageKey("UninstallPreviousPackage");
const QLatin1String InstallFailedInconsistentCertificatesString("INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES"); const QLatin1String InstallFailedInconsistentCertificatesString("INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES");
const QLatin1String InstallFailedUpdateIncompatible("INSTALL_FAILED_UPDATE_INCOMPATIBLE"); const QLatin1String InstallFailedUpdateIncompatible("INSTALL_FAILED_UPDATE_INCOMPATIBLE");
const QLatin1String InstallFailedPermissionModelDowngrade("INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE"); const QLatin1String InstallFailedPermissionModelDowngrade("INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE");
const QLatin1String InstallFailedVersionDowngrade("INSTALL_FAILED_VERSION_DOWNGRADE");
const Core::Id AndroidDeployQtStep::Id("Qt4ProjectManager.AndroidDeployQtStep"); const Core::Id AndroidDeployQtStep::Id("Qt4ProjectManager.AndroidDeployQtStep");
////////////////// //////////////////
...@@ -389,6 +390,9 @@ void AndroidDeployQtStep::slotAskForUninstall(DeployErrorCode errorCode) ...@@ -389,6 +390,9 @@ void AndroidDeployQtStep::slotAskForUninstall(DeployErrorCode errorCode)
case UpdateIncompatible: case UpdateIncompatible:
uninstallMsg += InstallFailedUpdateIncompatible+"\n"; uninstallMsg += InstallFailedUpdateIncompatible+"\n";
break; break;
case VersionDowngrade:
uninstallMsg += InstallFailedVersionDowngrade+"\n";
break;
default: default:
break; break;
} }
...@@ -517,6 +521,8 @@ AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::parseDeployErrors(QStr ...@@ -517,6 +521,8 @@ AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::parseDeployErrors(QStr
errorCode |= UpdateIncompatible; errorCode |= UpdateIncompatible;
if (deployOutputLine.contains(InstallFailedPermissionModelDowngrade)) if (deployOutputLine.contains(InstallFailedPermissionModelDowngrade))
errorCode |= PermissionModelDowngrade; errorCode |= PermissionModelDowngrade;
if (deployOutputLine.contains(InstallFailedVersionDowngrade))
errorCode |= VersionDowngrade;
return errorCode; return errorCode;
} }
......
...@@ -66,7 +66,8 @@ class AndroidDeployQtStep : public ProjectExplorer::BuildStep ...@@ -66,7 +66,8 @@ class AndroidDeployQtStep : public ProjectExplorer::BuildStep
InconsistentCertificates = 0x0001, InconsistentCertificates = 0x0001,
UpdateIncompatible = 0x0002, UpdateIncompatible = 0x0002,
PermissionModelDowngrade = 0x0004, PermissionModelDowngrade = 0x0004,
Failure = 0x0008 VersionDowngrade = 0x0008,
Failure = 0x0010
}; };
public: public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment