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
1=== modified file 'src/com/canonical/ubuntu/installer/InstallActivity.java'
2--- src/com/canonical/ubuntu/installer/InstallActivity.java 2013-12-20 03:39:53 +0000
3+++ src/com/canonical/ubuntu/installer/InstallActivity.java 2013-12-20 08:53:31 +0000
4@@ -402,11 +402,11 @@
5 Utils.showToast(context, "Download completed, ready to install Ubuntu");
6 startInstallationIfPossible();
7 } else {
8+ String reason = intent.getStringExtra(UbuntuInstallService.INSTALL_RESULT_EXTRA_STR);
9 // make sure it was not cancelled by user
10 if (r != -2) {
11- Utils.showToast(context, "Downlload failed:");
12+ reason = "Download failed: " + reason;
13 }
14- String reason = intent.getStringExtra(UbuntuInstallService.INSTALL_RESULT_EXTRA_STR);
15 Utils.showToast(context, reason);
16 updateInfoOnUiThread(reason);
17 // delete failed download
18
19=== modified file 'src/com/canonical/ubuntu/installer/UbuntuInstallService.java'
20--- src/com/canonical/ubuntu/installer/UbuntuInstallService.java 2013-12-20 03:39:53 +0000
21+++ src/com/canonical/ubuntu/installer/UbuntuInstallService.java 2013-12-20 08:53:31 +0000
22@@ -924,8 +924,8 @@
23 }
24
25 private Intent handleDownloadError(Intent i, int res, String reason) {
26- i.putExtra(DOWNLOAD_RESULT_EXTRA_INT, -1);
27- i.putExtra(DOWNLOAD_RESULT_EXTRA_STR, "Failed to generate update command");
28+ i.putExtra(DOWNLOAD_RESULT_EXTRA_INT, res);
29+ i.putExtra(DOWNLOAD_RESULT_EXTRA_STR, reason);
30 deleteRelease();
31 return i;
32 }

Subscribers

People subscribed via source and target branches

to all changes: