Log a specialized error message if installation task
failed due to insufficient storage space.
This helps the user to disgnose the source of error.
Bug: 200002443
Test: start DSU task and check logcat
Change-Id: Iabb3e0325ae99c343978ca6c35ab8378f20e0527
Right now the installation task does roughly this:
while (has partition data left) {
a. Copy partition data to write buffer.
b. Copy write buffer to shared memory.
c. Binder call submitFromAshmem() to inform the consumer of the
shared memory.
}
Both task (a) and (c) are I/O intensive and time consuming operations.
However (a) and (c) don't have a strong data dependency, and the only
consistency condition we need to maintain is "task (b) can only be
started once task (c) from the previous iteration is complete."
As soon as (b) is complete, (c) and *(a) of the next iteration* can be
started, pipelining task (a) & (c).
Also enlarge the default shared memory size because there are new
improvements after this change. The new default size (512K) is chosen
somewhat randomly, it's large enough to optimize the installation time
and small enough to not starve most devices' RAM.
Speedup:
* physical device: 23s -> 18s (14s if shared memory buffer is 512K)
* virtual device: 19s -> 15s
Bug: 225310919
Test: Install and boot DSU
Change-Id: If7093919762861d19d4fecaf997a699cc1b0fe41
Instead of showing "Install in progress", show which partition is being
installed and the total number of partitions, for example:
"Install in progress: system partition [2/3]"
Bug: 169036106
Test: Start a DSU installation and observe the system notification
Change-Id: I81b414606b1e18109ade5a3480931b162bd2a01f
Weight progress of writable partitions less because they take much less
time to complete compared to readonly partitions. This is best effort
only and done only when we can deduce the total number of partitions
beforehand.
Also publish the weighted progress to events log so external tools can
use this value directly, instead of having to calculate this complex
progress weighting themselves.
Revise the events log field name to better reflect the "unit" the
metrics are in (size -> bytes, partition -> partition_name).
DynamicSystemInstallationService notification progress should use this
weighted progress if available.
Bug: 169036106
Bug: 224909776
Test: Start a DSU installation and observe the logcat and system notification
Change-Id: I81561c1994698387b275cab36ee058dd581f9879
InstallationAsyncTask calls SparseInputStream.read(buf, off, len),
however SparseInputStream didn't override that method, so the method
actually fallbacks to the default implementation, which is a for-loop
calling read() (single byte). This is a significant performance hit.
This modest fix boosts the DSU installation time significantly:
* physical device: 45s -> 15s
* virtual device: 30s -> 7s
Bug: 225310919
Test: start a Dynamic System installation
Change-Id: I5a61dc2e9554719aece43491b813f6647b4bcc65
This modest adjustment 8KiB -> 64KiB significantly boosts the DSU
installation time:
* physical device: 2m34s -> 45s
* virtual device: 46s -> 30s
Also make the shared memory size customizable for fine-tuning.
Bug: 225310919
Test: start a Dynamic System installation and check its execution time.
Change-Id: I0418ba19c3824d31feafce54a71c054061d010e8
Log important events to the 'events' buffer so other tools can robustly
and progmatically parse the DSU logs.
Bug: 224909776
Test: adb logcat -b events -v descriptive \
'*:S dsu_progress_update dsu_install_complete dsu_install_failed'
Change-Id: Iac8d3ec31f51eb9410eb631487e26b4ccb0ccf81
byte(255) converts to int(-1). This is not what we want, we want
int(255), in other words unsigned conversion.
This bug is causing premature EOF when read() is called, because when a
byte(255) is returned, it gets sign-extend to int(-1), causing the
caller to think EOF is reached.
Bug: 217427392
Test: Presubmit
Change-Id: I8ee864816c77cfe2900f5e300d7d4411cce6753a
Factor out common code and some minor polishing.
Bug: 165471299
Test: Fire a DSU installation and observe logcat
Change-Id: Ia13db74c038e49d888e69e43b59ab0ad5b078464
Log the installation progress in logcat if feasible.
Bug: 181043054
Bug: 165471299
Test: Fire a DSU installation and observe logcat
Change-Id: Ib82783f2dfe310335725f39053eaa940d96e7198
It's probably harmless that Thread.sleep() is interrupted, so ignore the
error.
Bug: 165471299
Test: None
Change-Id: I86e07fe82875172c84f96176b4368ead7b60d09d
Right now we use two flags to track the internal states of DSU
notifications, mJustCancelledByUser and mKeepNotification. This makes
the notification posting / dismissing logic very complicated, as any
method can potentially modify the flags.
This change refactors the logic around postStatus() and
resetTaskAndStop() and remove the two flags. After this change,
notification posting logic are consolidated within postStatus() and
dismissing logic are consolidated within resetTaskAndStop().
Bug: 165471299
Test: Start a DSU installation and test "cancel" & "discard"
Change-Id: I59548553e0e92399d322c301011dfd270e7bb0e9
If you are fast and start a DSU installation before the BOOT_COMPLETE
broadcast receiver can start, than the executeNotifyIfInUseCommand()
would destroy the on-going installation session, which is mildly
irritating.
Bug: 165471299
Test: Presubmit
Change-Id: Iaf6a165ece7d2b4a531a78845122046c19d456a7