Merge lp:~humpolec-team/humpolec/UbuntuInstaller-refine2013122701 into lp:humpolec

Proposed by Yuan-Chen Cheng
Status: Merged
Merged at revision: 47
Proposed branch: lp:~humpolec-team/humpolec/UbuntuInstaller-refine2013122701
Merge into: lp:humpolec
Diff against target: 81 lines (+44/-3)
3 files modified
doc/Design.txt (+40/-0)
src/com/canonical/ubuntu/installer/UbuntuInstallService.java (+3/-2)
src/com/canonical/ubuntu/installer/VersionInfo.java (+1/-1)
To merge this branch: bzr merge lp:~humpolec-team/humpolec/UbuntuInstaller-refine2013122701
Reviewer Review Type Date Requested Status
Rex Tsai Approve
Review via email: mp+200090@code.launchpad.net

Description of the change

1. add Design.txt document.
2. add volatile to mIsCanceled to make sure no thread local cache.
3. work around http downloading input stream close takes too long.

it took seconds to cancel download if we do input.close()

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

This should goes in 3 different commit for changes tracking. :-)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'doc'
=== added file 'doc/Design.txt'
--- doc/Design.txt 1970-01-01 00:00:00 +0000
+++ doc/Design.txt 2013-12-27 07:19:45 +0000
@@ -0,0 +1,40 @@
1
2How dual boot works ?
3=====================
4
5Android have two partition that can store image that can boot.
6One is boot partition, and the other is recovery partition.
7
8We put ubuntu kernel and ramdisk in recovery partition. We put
9ubuntu program in userdata partition as flie system.img and
10also a swap file there.
11
12For other files that created as ubuntu runs, we keep it at:
13
14 /data/user-data: store user data, like /home/phablet
15 /data/system-data: store system data, like /etc, /var
16
17
18Android Installer APP Design
19============================
20
21How we detect system status ?
22
23Preferecne
24 We use PREF_KEY_XXX variable in UbuntuInstallService as key to
25 store value for certain status value. In the following paragraph,
26 if you saw PREF_KEY_XXX, it means the value for that key in
27 preference.
28
29 PREF_KEY_INSTALLED_VERSION
30 valid: ubuntu installed and we go to LaunchActivity.
31 invalid: ubuntu not installed and we go to InstallActivity.
32
33 PREF_KEY_DOWNLOADED_VERSION
34 invalid: ubuntu has not been downloaded
35 valid and mDownloadedSize is 0: full downloaded.
36 valid and mDownloadedSize > 0: partial downloaded.
37
38 As full downloaded complete, the PREF_KEY_UPDATE_COMMAND will be
39 set.
40
041
=== modified file 'src/com/canonical/ubuntu/installer/UbuntuInstallService.java'
--- src/com/canonical/ubuntu/installer/UbuntuInstallService.java 2013-12-26 07:18:14 +0000
+++ src/com/canonical/ubuntu/installer/UbuntuInstallService.java 2013-12-27 07:19:45 +0000
@@ -185,7 +185,7 @@
185 // FIXME make workPath in Cache a private function185 // FIXME make workPath in Cache a private function
186 private boolean workPathInCache = false;186 private boolean workPathInCache = false;
187 private String mRootOfWorkPath;187 private String mRootOfWorkPath;
188 private boolean mIsCanceled;188 private volatile boolean mIsCanceled;
189 189
190 // progress values190 // progress values
191 private long mProgress; // so far handled amount downloaded/processed 191 private long mProgress; // so far handled amount downloaded/processed
@@ -1018,7 +1018,8 @@
1018 if (mIsCanceled) {1018 if (mIsCanceled) {
1019 output.close();1019 output.close();
1020 conn = null;1020 conn = null;
1021 input.close();1021 // input.close() need more time to close() as donwload large file.
1022 input = null;
1022 long flen = file.length();1023 long flen = file.length();
1023 if (flen > 0) {1024 if (flen > 0) {
1024 try {1025 try {
10251026
=== modified file 'src/com/canonical/ubuntu/installer/VersionInfo.java'
--- src/com/canonical/ubuntu/installer/VersionInfo.java 2013-12-25 11:31:43 +0000
+++ src/com/canonical/ubuntu/installer/VersionInfo.java 2013-12-27 07:19:45 +0000
@@ -12,7 +12,7 @@
12 private static final String JSON = "_json";12 private static final String JSON = "_json";
13 private static final String DESCRIPTION = "_description";13 private static final String DESCRIPTION = "_description";
14 private static final String VERSION = "_version";14 private static final String VERSION = "_version";
15 // partial download: long15 // DOWNLOADED_SIZE: long
16 // full-download: d_version is not empty and this value is 016 // full-download: d_version is not empty and this value is 0
17 // partial download: d_version is not empty and this value is > 017 // partial download: d_version is not empty and this value is > 0
18 private static final String DOWNLOADED_SIZE = "_downloaded-size";18 private static final String DOWNLOADED_SIZE = "_downloaded-size";

Subscribers

People subscribed via source and target branches

to all changes: