summaryrefslogtreecommitdiff
path: root/update_manager
Commit message (Collapse)AuthorAgeFilesLines
* Add ErrorCode::kDeviceCorrupted.Yifan Hong2020-01-021-0/+1
| | | | | | | | | | | | This error code indicates the device is corrupted in a way that it can no longer receive any future updates. Specifically, if a device encounters a merge error, there is no way we can recover that device. Test: pass Bug: 138808328 Change-Id: Idbd9d1bc5bc02bbba157f17f31b2c5ace839243c
* Add ErrorCode::kNotEnoughSpace.Yifan Hong2019-12-131-0/+1
| | | | | | | | | | Virtual A/B now requires space in userdata, which may not be enough during OTA. A kNotEnoughSpace error code is added to indicate such case. Bug: 138808328 Test: builds Change-Id: I6bf7964911c8eb3b9df9b8752018925a99876d0f
* Sync with CrOS error codes.Yifan Hong2019-12-131-0/+3
| | | | | | | | | | | Add to ErrorCode and metrics::DownloadErrorCode: - kInternalLibCurlError - kUnresolvedHostError - kUnresolvedHostRecovered Test: builds Change-Id: Ibe11c02137860aed583b00b7e05b089ef84edb03
* update_engine: Run clang-format on update_manager/Amin Hassani2019-01-1652-891/+857
| | | | | | | | | | | | BUG=none TEST=unittest Change-Id: I80b56209d757d1156dd5f55bdd758a1ae8388dcc Reviewed-on: https://chromium-review.googlesource.com/1409707 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org>
* update_engine: Merge remote-tracking branch 'cros/upstream' into cros/masterAmin Hassani2019-01-085-15/+86
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since libchrome in AOSP is ahead of CrOS I had to guard against BASE_VER in a few places to satisfy older libchromes. file_fetcher.cc is now needed in delta_generator. A few unittests need to be run as root. BUG=chromium:916593 TEST=unittest TEST=cros_generate_update_payload TEST=cros flash CQ-DEPEND=CL:1399261 Change-Id: If3497549e88e559f8ecc38f414259b9c774f4a44
| * Merge aosp/upstream-master into aosp/master.Sen Jiang2019-01-046-12/+55
| |\ | |/ |/| | | | | | | | | Added BinderUpdateEngineClient::AttemptInstall(). Test: update_engine_unittests Change-Id: Id6911f49d763b0d572658acb7d66857016bf6969
* | Revert "Partially Revert 2b9d241"Hidehiko Abe2018-11-216-8/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 71818c8409812c5a08124627c19aa8ea0625a72e. This patch was created because the upstream update_engine was using the new version of libchrome and the Chrome OS one was not. Now that we are upreving libchrome on Chrome OS we can revert this. BUG=b:37434548 TEST=Build CQ-DEPEND=CL:1240033 Change-Id: I98b7d124212087292500701782de08b3d3ecc559 Reviewed-on: https://chromium-review.googlesource.com/1239818 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Hidehiko Abe <hidehiko@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org>
* | update_engine: Add disconnected network type for metrics reportingColin Howes2018-11-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On a failed update, correctly report that the network is disconnected rather than reporting an "unknown" network type, which is set when the connection type cannot be determined based on the properties of a given service path. BUG=chromium:660283 TEST=Added relevant unittests. Also tested manually by updating via cros flash, unplugging Ethernet after the transfer, and killing the dev_server. Metrics sends "disconnected" as expected. Change-Id: Ia681b769208b67fb5c14d41a646d816a42ccf33e Reviewed-on: https://chromium-review.googlesource.com/1231700 Commit-Ready: Colin Howes <chowes@google.com> Tested-by: Colin Howes <chowes@google.com> Reviewed-by: Amin Hassani <ahassani@chromium.org>
* | update_engine: Rename policy values of DeviceRollbackToTargetVersionMarton Hunyady2018-08-316-22/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename the following values for better understanding and consistency: - RollbackWithFullPowerwash to RollbackAndPowerwash - RollbackWithRestoreOnly to RollbackOnlyIfRestorePossible BUG=chromium:878736 TEST='cros_run_unit_tests --board=caroline --packages update_engine' Change-Id: Ib4129d2c297697e850d3027d35599fc37e104b0e Reviewed-on: https://chromium-review.googlesource.com/1198533 Commit-Ready: Marton Hunyady <hunyadym@chromium.org> Tested-by: Marton Hunyady <hunyadym@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org>
* | update_engine: Add new rollback policy valuesMarton Hunyady2018-08-315-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new values are: - RollbackAndRestoreIfPossible: always roll back, but try to save and restore data if possible. This is rollback_allowed=true. - RollbackWithRestoreOnly: only roll back if it's possible to save and restore data. This is rollback_allowed=false until data save and restore is implemented. BUG=chromium:878736 TEST='cros_run_unit_tests --board=caroline --packages update_engine' Change-Id: Ifd198610c26d11521b39da8fce5f44dc97609bf5 Reviewed-on: https://chromium-review.googlesource.com/1194229 Commit-Ready: Marton Hunyady <hunyadym@chromium.org> Tested-by: Marton Hunyady <hunyadym@chromium.org> Reviewed-by: Zentaro Kavanagh <zentaro@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org>
| * Uprev libchrome to r576279 (1/multiple)Jakub Pawlowski2018-10-132-15/+14
| | | | | | | | | | | | | | | | | | | | * StatisticsRecorder no longer need call to Initialize() * tracked_objects::Location -> base::Location * base::*ToString replaced with base::NumberToString Test: compilation Change-Id: I5f912bd15f7cb26df3edc1ad7f4479122ffb6d7a Merged-In: I5f912bd15f7cb26df3edc1ad7f4479122ffb6d7a
| * Remove NOLINT.Chih-Hung Hsieh2018-10-011-1/+1
| | | | | | | | | | Test: build with WITH_TIDY=1 Change-Id: I2992ed695d71cdd02e21015639951ea960e5feb5
| * Add noexcept to move constructors and assignment operators.Chih-Hung Hsieh2018-10-011-2/+3
| | | | | | | | | | | | Bug: 116614593 Test: build with WITH_TIDY=1 Change-Id: I8e8a665ed0f432e345ca928cbee5ec877adbcc8d
| * Calculate verity hash tree.Sen Jiang2018-09-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Calculate verity hash tree in FilesystemVerifierAction based on configs specified in protobuf, and write it to target partition before reading from those blocks. A new error code kVerityCalculationError was added to report error if it fails. Bug: 28171891 Test: update_engine_unittests Change-Id: I492885a0655bf51043902f578720fffd87e6a3cf
| * Merge remote-tracking branch 'aosp/upstream-master' into aosp/master.Sen Jiang2018-08-1338-48/+1749
| |\ | |/ |/| | | | | | | | | | | | | | | | | | | The following change is reverted because aosp has newer libchrome. 71818c84 Partially Revert 2b9d241 Added stub override for ReportInternalErrorCode(). Fixed RunPosinstallAction typo. Bug: 112326236 Test: update_engine_unittests Change-Id: Ieaae0eef425cbb1278067a48aa19b14ed056317a
* | update_engine: add utilities for update staging policyAdolfo Victoria2018-08-073-0/+388
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add staging_utils files that contain logic to decide what to changes should be done to the state. This includes: * Turn off staging if there is a forced update or if OOBE hasn't been completed * Keep the current staging state if no changes to the policy are detected. * Use a new waiting time if there have been changes to the policy. * If there is a persisted value that is still valid, use it. These changes aren't added to the update engine yet. The return value of CalculateStagingCase will be used in update_attempter in a switch statement to update the state based on the value. BUG=chromium:858621 TEST=cros_workon_make update_engine --test CQ-DEPEND=CL:1142480 Change-Id: Ib06365793618c3f2a357e3ace8c660fe51cdf950 Reviewed-on: https://chromium-review.googlesource.com/1138983 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Adolfo Higueros <adokar@google.com> Reviewed-by: Amin Hassani <ahassani@chromium.org>
* | update_engine: Change time restrictions to return kSucceededAdolfo Victoria2018-07-304-18/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change UpdateTimeRestrictionsPolicyImpl to return kSucceeded in place of kAskMeAgainLater. Since the former is not an expected return value. Background: Policies in UpdateCanBeApplied should return kSucceeded when they want to force a decision, since UpdateCanBeApplied is supposed to only contain sync policies. kAskMeAgainLater is reserved for async policies. BUG=chromium:852860 TEST=cros_workon_make update_engine --test and local tests Change-Id: Ie81a3d09f98ad7aba3c36183873bc153a6b530cf Reviewed-on: https://chromium-review.googlesource.com/1153624 Commit-Ready: Adolfo Higueros <adokar@google.com> Tested-by: Adolfo Higueros <adokar@google.com> Reviewed-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: May Lippert <maybelle@chromium.org>
* | update_engine: Modify Update Time Restrictions to block downloadsAdolfo Victoria2018-07-2512-74/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes Update Time Restrictions policy block downloads rather than checks. This will allow for better capturing of metrics. Furthermore, this change makes Update Time Restrictions only apply for kiosks, per the discussion with security and PM. The following changes are made: * Use UpdateCanBeApplied rather than UpdateCheckAllowed in UpdateTimeRestrictionsPolicyImpl. * ChromeOSPolicy::UpdateCanBeApplied now checks for forced updates. Modify the corresponding classes to implement UpdateCanBeApplied. * Add the auto_launched_kiosk_app_id variable from libbrillo to the policy provider, this variable lets us know if the device is in kiosk-mode. * If the device is not in kiosk mode, this policy won't be used. * Change chromeos_policy to check for policies in UpdateCanBeApplied. * Add unit tests accounting for the new changes. BUG=chromium:852860 TEST=cros_workon_make update_engine --test Change-Id: Iba52fa0fd1f89cc55e5009776036f8949e01e3a0 Reviewed-on: https://chromium-review.googlesource.com/1144435 Commit-Ready: Adolfo Higueros <adokar@google.com> Tested-by: Adolfo Higueros <adokar@google.com> Reviewed-by: Amin Hassani <ahassani@chromium.org>
* | update_engine: Add Update Time RestrictionsAdolfo Victoria2018-07-2518-0/+799
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implementation for the update time restrictions policy where the admin is allowed to choose time interval in which updates will not be checked. - Adds WeeklyTime and WeeklyTimeInterval classes to update_engine to be able to easily do interval range checking and time operations easily in the policy. Added the wiring so the classes can be used as Values and BoxedValues. - Adds disallowed_intervals member to device_policy_provider, since this contains the policy dictated disallowed intervals. The intervals are obtained from libpolicy, a function was added to convert them to the new WeeklyTime classes. Added the corresponding changes to the device policy provider header and interface. - Added the policy to chromeos_policy.cc so that it's taken into account in UpdateCheckAllowed. BUG=chromium:852860 TEST=cros_workon_make update_engine --test Change-Id: If62a2b3650adf149ba87790345e1eb62f0e1bb1f Reviewed-on: https://chromium-review.googlesource.com/1119397 Commit-Ready: Adolfo Higueros <adokar@google.com> Tested-by: Adolfo Higueros <adokar@google.com> Reviewed-by: Amin Hassani <ahassani@chromium.org>
* | update_engine: Allow rollback to kiosk-specified target versionMarton Hunyady2018-06-202-70/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RollbackToTargetVersion policy can now allow rolling back to the target version specified by the kiosk app manifest if the AllowKioskAppControlChromeVersion is set to true. To use this, the following policies must be set: - AutoUpdateDisabled = True - AllowKioskAppControlChromeVersion = True - RollbackToTargetVersion = ROLLBACK_WITH_FULL_POWERWASH - TargetVersionPrefix = not set And the kiosk app has to specify in the manifest.json: - required_platform_version = 10718 This setup will now initiate a rollback. BUG=chromium:853161 TEST='cros_run_unit_tests --board=caroline --packages update_engine' Change-Id: I870e2e2ddc1c915e5599b28944a07ff55e711d5b Reviewed-on: https://chromium-review.googlesource.com/1102509 Commit-Ready: Marton Hunyady <hunyadym@chromium.org> Tested-by: Marton Hunyady <hunyadym@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org>
* | update_engine: Add minutes variable to real time provider.Adolfo Victoria2018-06-155-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | Make it so that the user can also get the current minutes in local time from the real time provider. BUG=chromium:852860 TEST=Real time provider unittests Change-Id: I8118e28c5ab7f000434947fdee9aeae441535ba6 Reviewed-on: https://chromium-review.googlesource.com/1101468 Commit-Ready: Adolfo Higueros <adokar@google.com> Tested-by: Adolfo Higueros <adokar@google.com> Reviewed-by: Amin Hassani <ahassani@chromium.org>
* | Merge remote-tracking branch 'cros/upstream' into cros/masterAmin Hassani2018-06-0413-39/+36
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | BUG=chromium:815356 TEST=unittest TEST=precq TEST=cros flash Change-Id: I8d9c37411708d0cae61613b285123a090ce6deb1
* | | update_engine: Report VPD write failure to UMAAmin Hassani2018-05-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we see many first actives to come from non-FSI images. But we have not been able to figure out why. This CL, reports a new error kFirstActiveOmahaPingSentPersistenceError when writing the first active omaha flag into VPD fails. This allows us to see if that is the actual cause of the problem. CL:1062659 adds the enum value on the Chrome side. BUG=chromium:833980 TEST=unittests TEST=precq Change-Id: I65e233c5f895489ba905494fb20d7b00d0c4af10 Reviewed-on: https://chromium-review.googlesource.com/1062662 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org>
* | | update_engine: Process Omaha response for rollback imagesMarton Hunyady2018-05-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Omaha returns whether the image returned is a rollback in the _rollback="true" argument. If this is set, the client has to check whether it's OK to apply the rollback image (policy is specifically requesting a rollback and verified boot will accept the image based on its kernel and firmware key versions). In addition to this, the device has to do a safe powerwash if the image is a rollback. (We're not supporting rollbacks with partial or no powerwash yet.) We're also setting the rollback_happened preference to avoid force updates happening before the policy is available again. Chromium CL adding the error code: http://crrev.com/c/1047866 BUG=chromium:840432 TEST='cros_run_unit_tests --board=caroline --packages update_engine' Change-Id: I1436ca96211b2a8523e78bf83602ef8b6b525570 Reviewed-on: https://chromium-review.googlesource.com/1047610 Commit-Ready: Marton Hunyady <hunyadym@chromium.org> Tested-by: Marton Hunyady <hunyadym@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org>
* | | Fix error code for no update.Sen Jiang2018-05-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PayloadState does not get notified if there's no update, so the error code will not be updated, move this to UpdateAttempter. We were using the generic kError for no update, this change added a new error code kNoUpdate for this, now update_engine_client will show kNoUpdate instead of kSuccess or a random last error. Bug: 36946608 Test: update_engine_client --check_for_update --follow Change-Id: Ie1e94841788437140e0894dc2e73c314a7564108 (cherry picked from commit 89e24c11b406fe048382bdf1c89334e10417b899) Reviewed-on: https://chromium-review.googlesource.com/1055857 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Nicolas Norvez <norvez@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org>
* | | update_engine: Add rollback_allowed policy in Omaha requestsMarton Hunyady2018-05-106-13/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Send rollback_allowed="true" parameter to Omaha if rollback is allowed through enterprise policy. This parameter indicates to Omaha that the returned image might be a rollback image, if the targetversionprefix parameter is set and it is an earlier version than the one which is currently on the device. Also, this CL changes update_engine behavior to only send targetversionprefix to Omaha if it's not empty. BUG=chromium:814830 TEST='cros_run_unit_tests --board=cyan --packages update_engine' Change-Id: Iaa5503e217631311fb9ba3a5237ccbfedf04afe9 Reviewed-on: https://chromium-review.googlesource.com/932123 Commit-Ready: Marton Hunyady <hunyadym@chromium.org> Tested-by: Marton Hunyady <hunyadym@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org>
* | | update_engine: Set min kernel version based on rollback policy.Zentaro Kavanagh2018-04-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Sets max_kernel_rollforward to tpm_kernver for enterprise enrolled devices if number of allowed rollback versions is > 0, or if no policy is available. - Sets max_kernel_rollforward to 0xfffffffe for consumer devices. - This just holds the rollback window open for enterprise customers while the server side piece of the feature is implemented. - In future max_kernel_rollforward will be set based on the number of allowed rollback versions to the lowest version that still allows those rollbacks, and will progressively increase as the versions age out of the rollback window. BUG=chromium:814090 TEST=emerges Change-Id: I7c192092183dd398f74d34b41bbc65dc2595d081 Reviewed-on: https://chromium-review.googlesource.com/940567 Commit-Ready: Zentaro Kavanagh <zentaro@chromium.org> Tested-by: Zentaro Kavanagh <zentaro@chromium.org> Reviewed-by: Zentaro Kavanagh <zentaro@chromium.org>
* | | update_engine: Consumer value of RollbackAllowedMilestones policy.Marton Hunyady2018-04-202-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Policy value is always 0 for consumer users. For devices which are still in OOBE, we are not setting the policy, so we're not restricting future rollback possibilities. BUG=chromium:813036 TEST='cros_run_unit_tests --board=cyan --packages update_engine' CQ-DEPEND=CL:1013461 Change-Id: I15749f8eb8c8e2e404d73a8f3bd826db59412395 Reviewed-on: https://chromium-review.googlesource.com/985983 Commit-Ready: Marton Hunyady <hunyadym@chromium.org> Tested-by: Marton Hunyady <hunyadym@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Dan Erat <derat@chromium.org>
* | | update_engine: Use org.chromium.KioskAppService service.Daniel Erat2018-03-305-26/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make update_engine use the org.chromium.KioskAppService D-Bus service exported by Chrome rather than the old methods under org.chromium.LibCrosService. BUG=chromium:703229 TEST=unit tests pass; also hacked up RealSystemProvider to call its GetKioskAppRequiredPlatformVersion and manually verified that the D-Bus call succeeds Change-Id: I02d503da1e1aec2319c75e2237c87bfcdcd1f7e5 Reviewed-on: https://chromium-review.googlesource.com/987325 Commit-Ready: Dan Erat <derat@chromium.org> Tested-by: Dan Erat <derat@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org>
* | | update_engine: Populate UpdateCheckParams with rollback policies.Marton Hunyady2018-03-278-2/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are the policies introduced in crrev.com/c/916563, controlling what should happen if target_version_prefix is earlier than the current Chrome OS version, and how long Chrome OS rollback protection should be postponed. BUG=chromium:813036 TEST='cros_run_unit_tests --board=cyan --packages update_engine' Change-Id: I33cf3b8975b52ca4b647a4b69a2d7879a9115d3c Reviewed-on: https://chromium-review.googlesource.com/929321 Commit-Ready: Marton Hunyady <hunyadym@chromium.org> Tested-by: Marton Hunyady <hunyadym@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org>
* | | update_engine: Add new rollback device policies.Marton Hunyady2018-03-266-0/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add rollback_to_target_version and rollback_allowed_milestones device policies to update_engine's device_policy_provider. These are matching the device policies introduced in crrev.com/c/916563. rollback_to_target_version is describing what should happen when the target_version_prefix policy has a lower value than the current OS value. rollback_allowed_milestones is setting the number of milestones rollback protection should be postponed for enterprise enrolled devices. BUG=chromium:813036 TEST='cros_run_unit_tests --board=cyan --packages update_engine' CQ-DEPEND=CL:923971 Change-Id: I310690882f10fcbb57cc9b957fad5388c3a06bc9 Reviewed-on: https://chromium-review.googlesource.com/928723 Commit-Ready: Marton Hunyady <hunyadym@chromium.org> Tested-by: Marton Hunyady <hunyadym@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org>
* | | Reland update over cellular changesWeidong Guo2018-03-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This merge cherrypicks two commits that was reverted in an AOSP git merge. 4b0d6032cbb86ce488c03b31936cda31283f97e3 Add functions to allow update over cellular (including tethered connection) 840703a4cc77228e2606f45665ae3a4bd75ff7dd Fix update over cellular network on guest account Handled multi-package response. Ran clang-format which fixed a lot of issues in those two CLs. BUG=chromium:815356 TEST=unittests, precq Change-Id: I54b6763c4c54755272531b558ed7628ceb0fc6c7 Reviewed-on: https://chromium-review.googlesource.com/965267 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org>
* | | Partially Revert 2b9d241Amin Hassani2018-03-195-21/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2b9d2417722cd4052b0e22494886f93c5b4ef042 update_engine: Update libchrome APIS to r456626. The above commit changes the libchrome API used in update_engine to r456626. But the libchrome has not been upreved fully in the CrOS yet with the exception of some changes represented in UE like CL:882543. So, now we need to revert the changes partially untill the libchrome is updated. BUG=chromium:815356 TEST=unittests, precq Change-Id: If2207f0672c7b9f6dab84e676d9fb8423a047372 Reviewed-on: https://chromium-review.googlesource.com/965266 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org>
| | * Turn on build/header_guard in cpplint. am: 96e3672411Sen Jiang2018-05-091-1/+1
| | |\ | | |/ | |/| | | | | | | | | | am: 47b6cae682 Change-Id: I034d8b64e940f861a4a04c56cd4a2aac3f47993a
| * | Turn on build/header_guard in cpplint.Sen Jiang2018-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | Set the correct root path in CPPLINT.cfg and fix existing violations. Test: tools/repohooks/tools/cpplint.py --quiet system/update_engine/**/*.h Change-Id: I37812854a68116c69bcef28f8b15856b89a07c4d
| | * Replace is_interactive with interactive for consistency in the code. am: ↵Amin Hassani2018-04-1010-28/+28
| | |\ | | |/ | |/| | | | | | | | | | | | | | | | ed37d6819b am: b62bb6ab33 Change-Id: I7f79eaf487664237b8b5225c210e8dc01cf94f2f
| * | Replace is_interactive with interactive for consistency in the code.Amin Hassani2018-04-0610-28/+28
| | | | | | | | | | | | | | | | | | Bug: none Test: unittests Change-Id: I8c98860cfeadb52c7f8e4931d2ad154ae4211d47
| | * Correct some spellings. am: 771f6486a3Sen Jiang2018-04-052-2/+2
| | |\ | | |/ | |/| | | | | | | | | | am: 5e67287bc1 Change-Id: I98a5bd68116da28a5bbcc61da6830e188d854be0
| * | Correct some spellings.Sen Jiang2018-04-042-2/+2
| | | | | | | | | | | | | | | Test: mma Change-Id: Icc49a4ee76f12d302ed18982d334f2f70b7263a8
| | * Fix Android Things policy order. am: a57d53e3edSen Jiang2018-04-021-3/+3
| | |\ | | |/ | |/| | | | | | | | | | am: ff4927fc0c Change-Id: Ib554170b8659257245cd171c7777b8a385944e6b
| * | Fix Android Things policy order.Sen Jiang2018-04-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Interactive update policy needs to be evaluated before official builds policy because we still allow interactive update in unofficial builds. Bug: 77306082 Bug: 71804007 Test: check logcat on unofficial build Change-Id: I90b5e1c89903da6c3951ff0a82c818c9177b7e3a
| | * Fix error code for no update. am: 89e24c11b4Sen Jiang2018-03-271-0/+1
| | |\ | | |/ | |/| | | | | | | | | | am: 832c9f574c Change-Id: I6d806ea15c34fabb89e3cc55ba357fe430eeba01
| * | Fix error code for no update.Sen Jiang2018-03-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PayloadState does not get notified if there's no update, so the error code will not be updated, move this to UpdateAttempter. We were using the generic kError for no update, this change added a new error code kNoUpdate for this, now update_engine_client will show kNoUpdate instead of kSuccess or a random last error. Bug: 36946608 Test: update_engine_client --check_for_update --follow Change-Id: Ie1e94841788437140e0894dc2e73c314a7564108
| | * Remove unnecessary nullptr check for kiosk_required_platform_version_p. am: ↵Sen Jiang2018-03-231-5/+2
| | |\ | | |/ | |/| | | | | | | | | | | | | | | | ee67a8d575 am: 19ee4a919c Change-Id: I2ea58f526ec9ef7a37b57cc98c1563d75093e72f
| * | Remove unnecessary nullptr check for kiosk_required_platform_version_p.Sen Jiang2018-03-231-5/+2
|/ / | | | | | | | | | | Bug: 76213788 Test: mma Change-Id: Ib79cb486d33a592c8ad1742d405419191038da09
| * Refactor ChromeOSPolicy into policy and utilities am: 186ff6a22fAmin Hassani2018-02-287-491/+329
| |\ | |/ |/| | | | | | | am: 4e96a9d067 Change-Id: Iae6790e82c0442b2e28356f727093a32760c799e
* | Refactor ChromeOSPolicy into policy and utilitiesAmin Hassani2018-02-277-491/+329
| | | | | | | | | | | | | | | | | | | | | | | | Building on the policy fragments that have been previously extracted from ChromeOSPolicy, this extracts a few more pieces of logic and replaces sections of ChromeOSPolicy with calls to the extracted methods. Bug: 66016687 Test: unit tests, manually triggered OTA updates Change-Id: I3bc608065f8ab89982f71b8490ebd66ed2266aa3
| * resolve merge conflicts of 0b77cb9fa6941163c4a4099471bef6ef564c0ffe to ↵Sen Jiang2018-01-115-13/+8
| |\ | |/ |/| | | | | | | | | oc-mr1-dev-plus-aosp Test: I solemnly swear I tested this conflict resolution. Change-Id: If51b3d48a3553b81ad7aa79764e649debc844cac
* | Merge remote-tracking branch 'goog/upstream-master'.Sen Jiang2018-01-115-13/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following commits were reverted: 840703a Fix update over cellular network on guest account eaad5d0 Do not merge to AOSP: Fixes the link to brillo-clang-format in CrOS 740efad Reboot even if a system update is not available. Fixed a few sign compare warnings. Had to ifdef out 2 SquashfsFilesystemTest because it depends on unsquashfs -m. Test: update_engine_unittests Change-Id: I6f4ca5003e78c76064ec60d0797505d8c18d00bf Merged-In: I6f4ca5003e78c76064ec60d0797505d8c18d00bf
| * | update_engine: migrate from base::MakeUnique to std::make_uniqueBen Chan2017-10-132-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | base::MakeUnique is being deprecated as we can now use std::make_unique when compiling code in the C++14 mode. BUG=chromium:769107 CQ-DEPEND=CL:669672 TEST=Run unit tests. Change-Id: I82f76647239b1eb3b98b19f6479788ffd86ce756 Reviewed-on: https://chromium-review.googlesource.com/716826 Commit-Ready: Ben Chan <benchan@chromium.org> Tested-by: Ben Chan <benchan@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org>