summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTianjie <xunchang@google.com>2020-11-30 14:42:25 -0800
committerTianjie <xunchang@google.com>2020-12-08 14:29:11 -0800
commita40c2001fa5330c4527cb61a63289c297b872401 (patch)
tree92183f5930e9ea84fb58687a6d9cfb7a7beb88a6 /include
parentd87b1d1acec169eca89fc9d522de7728c85f3cb5 (diff)
Add a function pointer to get active boot slot
bootcontrol 1.2 adds a new function to get the active boot slot on the next boot. Since the getter is closely related to the gpt implementation of bootcontrol, we add the header here and expose to clients of libhardware. Devices with an old HAL should never call this new getter function. Bug: 173808057 Test: Vts tests for bootcontrol Change-Id: I19135ed16bf0ba546e0a8d9cb2d521ec0a9c5bbc
Diffstat (limited to 'include')
-rw-r--r--include/hardware/boot_control.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/hardware/boot_control.h b/include/hardware/boot_control.h
index 36a867da..abbf3f19 100644
--- a/include/hardware/boot_control.h
+++ b/include/hardware/boot_control.h
@@ -125,7 +125,14 @@ typedef struct boot_control_module {
*/
int (*isSlotMarkedSuccessful)(struct boot_control_module *module, unsigned slot);
- void* reserved[31];
+ /**
+ * Returns the active slot to boot into on the next boot. If
+ * setActiveBootSlot() has been called, the getter function should return
+ * the same slot as the one provided in the last setActiveBootSlot() call.
+ */
+ unsigned (*getActiveBootSlot)(struct boot_control_module *module);
+
+ void* reserved[30];
} boot_control_module_t;