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
1=== added directory 'doc'
2=== added file 'doc/Design.txt'
3--- doc/Design.txt 1970-01-01 00:00:00 +0000
4+++ doc/Design.txt 2013-12-27 07:19:45 +0000
5@@ -0,0 +1,40 @@
6+
7+How dual boot works ?
8+=====================
9+
10+Android have two partition that can store image that can boot.
11+One is boot partition, and the other is recovery partition.
12+
13+We put ubuntu kernel and ramdisk in recovery partition. We put
14+ubuntu program in userdata partition as flie system.img and
15+also a swap file there.
16+
17+For other files that created as ubuntu runs, we keep it at:
18+
19+ /data/user-data: store user data, like /home/phablet
20+ /data/system-data: store system data, like /etc, /var
21+
22+
23+Android Installer APP Design
24+============================
25+
26+How we detect system status ?
27+
28+Preferecne
29+ We use PREF_KEY_XXX variable in UbuntuInstallService as key to
30+ store value for certain status value. In the following paragraph,
31+ if you saw PREF_KEY_XXX, it means the value for that key in
32+ preference.
33+
34+ PREF_KEY_INSTALLED_VERSION
35+ valid: ubuntu installed and we go to LaunchActivity.
36+ invalid: ubuntu not installed and we go to InstallActivity.
37+
38+ PREF_KEY_DOWNLOADED_VERSION
39+ invalid: ubuntu has not been downloaded
40+ valid and mDownloadedSize is 0: full downloaded.
41+ valid and mDownloadedSize > 0: partial downloaded.
42+
43+ As full downloaded complete, the PREF_KEY_UPDATE_COMMAND will be
44+ set.
45+
46
47=== modified file 'src/com/canonical/ubuntu/installer/UbuntuInstallService.java'
48--- src/com/canonical/ubuntu/installer/UbuntuInstallService.java 2013-12-26 07:18:14 +0000
49+++ src/com/canonical/ubuntu/installer/UbuntuInstallService.java 2013-12-27 07:19:45 +0000
50@@ -185,7 +185,7 @@
51 // FIXME make workPath in Cache a private function
52 private boolean workPathInCache = false;
53 private String mRootOfWorkPath;
54- private boolean mIsCanceled;
55+ private volatile boolean mIsCanceled;
56
57 // progress values
58 private long mProgress; // so far handled amount downloaded/processed
59@@ -1018,7 +1018,8 @@
60 if (mIsCanceled) {
61 output.close();
62 conn = null;
63- input.close();
64+ // input.close() need more time to close() as donwload large file.
65+ input = null;
66 long flen = file.length();
67 if (flen > 0) {
68 try {
69
70=== modified file 'src/com/canonical/ubuntu/installer/VersionInfo.java'
71--- src/com/canonical/ubuntu/installer/VersionInfo.java 2013-12-25 11:31:43 +0000
72+++ src/com/canonical/ubuntu/installer/VersionInfo.java 2013-12-27 07:19:45 +0000
73@@ -12,7 +12,7 @@
74 private static final String JSON = "_json";
75 private static final String DESCRIPTION = "_description";
76 private static final String VERSION = "_version";
77- // partial download: long
78+ // DOWNLOADED_SIZE: long
79 // full-download: d_version is not empty and this value is 0
80 // partial download: d_version is not empty and this value is > 0
81 private static final String DOWNLOADED_SIZE = "_downloaded-size";

Subscribers

People subscribed via source and target branches

to all changes: