Don't allow rollback when we are enterprise enrolled.
As stated (and verified) by the device_policy protobuf, we can determine
whether a device is enterprise enrolled by checking if GetOwner is empty.
We use this knowledge to not allow rollback when powerwash is also requested (
the default).
As part of this CL I've figured out how to unittest Rollback and added tests
for both enterprise and non-enterprise rollback.
BUG=chromium:254829
TEST=Tested on both an enrolled and non-enrolled device. Verified only the
latter actually did a powerwash while the other aborted correctly. Also ran
new unittests
Change-Id: Idfe6bfef88819fe1bab7da6b31854faf7642c9ce
Reviewed-on: https://gerrit.chromium.org/gerrit/61645
Reviewed-by: David Zeuthen <zeuthen@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
diff --git a/dbus_service.cc b/dbus_service.cc
index 8619b2d..bc84858 100644
--- a/dbus_service.cc
+++ b/dbus_service.cc
@@ -110,7 +110,7 @@
bool powerwash,
GError **error) {
LOG(INFO) << "Attempting rollback to non-active partitions.";
- return self->system_state_->update_attempter()->Rollback(powerwash);
+ return self->system_state_->update_attempter()->Rollback(powerwash, NULL);
}
gboolean update_engine_service_reset_status(UpdateEngineService* self,