AU: Provide a reboot_if_needed D-Bus API.
This will reboot if the current state is UPDATED_REBOOT_NEEDED.
Also add -reboot option to the update_engine_client.
BUG=4250
TEST=unit tests,gmerged on device and tried reboot requests
Review URL: http://codereview.chromium.org/3034026
diff --git a/utils.h b/utils.h
index 5a3efe9..9be2509 100644
--- a/utils.h
+++ b/utils.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -102,6 +102,9 @@
// Returns the error message, if any, from a GError pointer.
const char* GetGErrorMessage(const GError* error);
+// Initiates a system reboot. Returns true on success, false otherwise.
+bool Reboot();
+
// Log a string in hex to LOG(INFO). Useful for debugging.
void HexDumpArray(const unsigned char* const arr, const size_t length);
inline void HexDumpString(const std::string& str) {