Merge lp:~humpolec-team/humpolec/UbuntuInstaller_error_toast_fix into lp:humpolec

Proposed by Yuan-Chen Cheng
Status: Merged
Merged at revision: 28
Proposed branch: lp:~humpolec-team/humpolec/UbuntuInstaller_error_toast_fix
Merge into: lp:humpolec
Diff against target: 32 lines (+4/-4)
2 files modified
src/com/canonical/ubuntu/installer/InstallActivity.java (+2/-2)
src/com/canonical/ubuntu/installer/UbuntuInstallService.java (+2/-2)
To merge this branch: bzr merge lp:~humpolec-team/humpolec/UbuntuInstaller_error_toast_fix
Reviewer Review Type Date Requested Status
Rex Tsai Approve
Review via email: mp+199766@code.launchpad.net

Description of the change

error return intent and dispaly download error toast

tested on n4

To post a comment you must log in.
Revision history for this message
Rex Tsai (chihchun) wrote :

LOTM, +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/com/canonical/ubuntu/installer/InstallActivity.java'
--- src/com/canonical/ubuntu/installer/InstallActivity.java 2013-12-20 03:39:53 +0000
+++ src/com/canonical/ubuntu/installer/InstallActivity.java 2013-12-20 08:53:31 +0000
@@ -402,11 +402,11 @@
402 Utils.showToast(context, "Download completed, ready to install Ubuntu");402 Utils.showToast(context, "Download completed, ready to install Ubuntu");
403 startInstallationIfPossible();403 startInstallationIfPossible();
404 } else {404 } else {
405 String reason = intent.getStringExtra(UbuntuInstallService.INSTALL_RESULT_EXTRA_STR);
405 // make sure it was not cancelled by user406 // make sure it was not cancelled by user
406 if (r != -2) {407 if (r != -2) {
407 Utils.showToast(context, "Downlload failed:"); 408 reason = "Download failed: " + reason;
408 }409 }
409 String reason = intent.getStringExtra(UbuntuInstallService.INSTALL_RESULT_EXTRA_STR);
410 Utils.showToast(context, reason);410 Utils.showToast(context, reason);
411 updateInfoOnUiThread(reason);411 updateInfoOnUiThread(reason);
412 // delete failed download412 // delete failed download
413413
=== modified file 'src/com/canonical/ubuntu/installer/UbuntuInstallService.java'
--- src/com/canonical/ubuntu/installer/UbuntuInstallService.java 2013-12-20 03:39:53 +0000
+++ src/com/canonical/ubuntu/installer/UbuntuInstallService.java 2013-12-20 08:53:31 +0000
@@ -924,8 +924,8 @@
924 }924 }
925 925
926 private Intent handleDownloadError(Intent i, int res, String reason) {926 private Intent handleDownloadError(Intent i, int res, String reason) {
927 i.putExtra(DOWNLOAD_RESULT_EXTRA_INT, -1);927 i.putExtra(DOWNLOAD_RESULT_EXTRA_INT, res);
928 i.putExtra(DOWNLOAD_RESULT_EXTRA_STR, "Failed to generate update command");928 i.putExtra(DOWNLOAD_RESULT_EXTRA_STR, reason);
929 deleteRelease();929 deleteRelease();
930 return i;930 return i;
931 }931 }

Subscribers

People subscribed via source and target branches

to all changes: