Snap for 4664671 from 9009e0c22e578bbf0ed974a6d7924a2ece8bf635 to nyc-iot-release
Change-Id: Ia5edf5be6dd7f1f78c20ff9ad9f63d7fd4672799
diff --git a/common/android_ab.c b/common/android_ab.c
index cfbf530..4a690c8 100644
--- a/common/android_ab.c
+++ b/common/android_ab.c
@@ -39,7 +39,7 @@
memcpy(abc->slot_suffix, "a\0\0\0", 4);
abc->magic = ANDROID_BOOT_CTRL_MAGIC;
abc->version = ANDROID_BOOT_CTRL_VERSION;
- abc->nb_slot = ARRAY_SIZE(abc->slot_info);
+ abc->nb_slot = ANDROID_NUM_SLOTS;
memset(abc->reserved0, 0, sizeof(abc->reserved0));
for (i = 0; i < abc->nb_slot; ++i) {
abc->slot_info[i] = metadata;
diff --git a/include/android_ab.h b/include/android_ab.h
index c264e9b..e590f8f 100644
--- a/include/android_ab.h
+++ b/include/android_ab.h
@@ -12,6 +12,9 @@
/* Android standard boot slot names are 'a', 'b', 'c', ... */
#define ANDROID_BOOT_SLOT_NAME(slot_num) ('a' + (slot_num))
+/* Number of slots */
+#define ANDROID_NUM_SLOTS 2
+
/** android_ab_select - Select the slot where to boot from.
* On Android devices with more than one boot slot (multiple copies of the
* kernel and system images) selects which slot should be used to boot from and