summaryrefslogtreecommitdiff
path: root/update_manager/policy_test_utils.h
AgeCommit message (Collapse)Author
2020-11-24update_engine: Use clock and fake clock from SystemStateAmin Hassani
No need to pass clock and fake clock anywhere anymore. This CL makes it to just use those objects available from SystemState and FakeSystemState. BUG=b:171829801 TEST=cros_workon_make --board reef --test update_engine Change-Id: I9a3cf6dd2057620c11b862d3317b83489c76f3ca Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2546625 Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Jae Hoon Kim <kimjae@chromium.org> Commit-Queue: Jae Hoon Kim <kimjae@chromium.org>
2019-08-27update_engine: Replace scoped_refptr with shared_ptr in update_managerAmin Hassani
It seems like scoped_refptr was a substitute for shared_ptr before chromium was on C++11: https://www.chromium.org/developers/smart-pointer-guidelines But that is not the case anymore as we are already on C++14. So just replace it in update_manager with shared_ptr. There is still another use case of it for keeping dbus connections but that can't easily be changed because brillo::DBusConnection is still using scoped_refptr. BUG=chromium:994048 TEST=FEATURES=test emerge update_engine Change-Id: I1fab0408399d678d2851731aea40fc02be459295 Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/1755262 Reviewed-by: Jae Hoon Kim <kimjae@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Commit-Queue: Amin Hassani <ahassani@chromium.org>
2018-07-25update_engine: Add Update Time RestrictionsAdolfo Victoria
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>
2017-12-08Codestyle fixups to satisfy presubmitsAaron Wood
This is a series of whitespace changes to align files created before presubmit checks were enabled to match the presubmit checks that are now in place on master. Test: unit-tests Change-Id: I52e769a3e7e6d390edfa067358a437f342e0e5d5 (cherry picked from commit 11d80256f35ba2995e88b129aaec9d8c7f302b7c)
2017-12-06Policy for AndroidThingsAaron Wood
Adds a separate Policy implementation for AndroidThings, which is not dependent on the ChromeOSPolicy implementation. It uses some new policy implementation fragments (policy features) which were in ChromeOSPolicy. ChromeOSPolicy will be separately refactored to use the policy implementation fragments. The AndroidThingsPolicy and ChromeOSPolicy classes (and dependencies) are compiled in as needed, based on the platform. Both classes and dependencies are compiled into the unit test binary to ensure the proper behavior of both. Some unit tests are slightly duplicated across the Policy and policy implementation fragments to confirm that the policy fragments are consulted in the proper order/precedence. Bug: 66016687 Test: Unit tests, manual OTA Change-Id: I220e5720e0077309931eda70155523b3c0507567 (cherry picked from commit cd0d7bda708a44c2d839d0497e1791b42ed06e3d)