summaryrefslogtreecommitdiff
path: root/update_manager/update_time_restrictions_policy_impl.h
AgeCommit message (Collapse)Author
2018-07-30update_engine: Change time restrictions to return kSucceededAdolfo Victoria
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>
2018-07-25update_engine: Modify Update Time Restrictions to block downloadsAdolfo Victoria
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>
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>