diff options
author | Siva Velusamy <vsiva@google.com> | 2013-07-02 22:40:42 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-07-02 22:40:42 +0000 |
commit | a6b7c206c7d6c4b072fd7e5f4615c27604307c13 (patch) | |
tree | fcc92c7953c5b0716b19b27358b8d11cdc289797 /eclipse | |
parent | a782925de572285c66c17e15bc82191f3ce6dd6c (diff) | |
parent | 3798843fc8d78185fdef67a7ccbfdd2c697ccd88 (diff) | |
download | sdk-a6b7c206c7d6c4b072fd7e5f4615c27604307c13.zip sdk-a6b7c206c7d6c4b072fd7e5f4615c27604307c13.tar.gz sdk-a6b7c206c7d6c4b072fd7e5f4615c27604307c13.tar.bz2 |
Merge "Prompt for package uninstall when signature differs"
Diffstat (limited to 'eclipse')
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java index 4281f19..6818789 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java @@ -1194,7 +1194,17 @@ public final class AndroidLaunchController implements IDebugBridgeChangeListener String.format("Installation failed: Could not copy %1$s to its final location!", launchInfo.getPackageFile().getName()), "Please check logcat output for more details."); - } else if (result.equals("INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES")) { + } else if (result.equals("INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES")) { //$NON-NLS-1$ + if (retryMode != InstallRetryMode.NEVER) { + boolean prompt = AdtPlugin.displayPrompt("Application Install", + "Re-installation failed due to different application signatures. You must perform a full uninstall of the application. WARNING: This will remove the application data!\nDo you want to uninstall?"); + if (prompt) { + doUninstall(device, launchInfo); + String res = doInstall(launchInfo, remotePath, device, false); + return checkInstallResult(res, device, launchInfo, remotePath, + InstallRetryMode.NEVER); + } + } AdtPlugin.printErrorToConsole(launchInfo.getProject(), "Re-installation failed due to different application signatures.", "You must perform a full uninstall of the application. WARNING: This will remove the application data!", @@ -1215,7 +1225,6 @@ public final class AndroidLaunchController implements IDebugBridgeChangeListener * @return a {@link String} with an error code, or <code>null</code> if success. * @throws InstallException if the installation failed. */ - @SuppressWarnings("unused") private String doUninstall(IDevice device, DelayedLaunchInfo launchInfo) throws InstallException { try { |