diff options
author | Yoshitaka Ishida <yoshitaka.ishida@sony.com> | 2018-02-16 18:20:07 +0900 |
---|---|---|
committer | Sen Jiang <senj@google.com> | 2018-04-25 19:28:47 +0000 |
commit | 128936fb266af57d19e1faced52d686d271519d6 (patch) | |
tree | 515701ecf4854448cf4ce23304c1696e10e99709 | |
parent | 51c3e5d3446d8c3fdb16f93b91534a308e114649 (diff) |
postinstall: fixed postinst_action_progress is NaN
If no postinstall is defined, total_weight_ is 0.
When total_weight_ is 0, the result of division is NaN.
The NaN is set to postinst_action_progress, and update_engine
sends the NaN for other software(ex. application) by callback.
The software might show the NaN value on screen as decimal
fraction(double).
Update_engine should not send NaN in this case.
Bug: 78199138
Test: manual - Create update.zip with AB_OTA_POSTINSTALL_CONFIG=(null)
Then, Run ./update_device.py --file update.zip,
and check log
Change-Id: I1ab5e607bc6598262c47b58b2fe7415195d913a4
-rw-r--r-- | payload_consumer/postinstall_runner_action.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/payload_consumer/postinstall_runner_action.cc b/payload_consumer/postinstall_runner_action.cc index cedecda9..b6af1314 100644 --- a/payload_consumer/postinstall_runner_action.cc +++ b/payload_consumer/postinstall_runner_action.cc @@ -264,7 +264,7 @@ bool PostinstallRunnerAction::ProcessProgressLine(const string& line) { void PostinstallRunnerAction::ReportProgress(double frac) { if (!delegate_) return; - if (current_partition_ >= partition_weight_.size()) { + if (current_partition_ >= partition_weight_.size() || total_weight_ == 0) { delegate_->ProgressUpdate(1.); return; } |