source bootctrl changes
authordeadman96385 <seanhoyt963@gmail.com>
Thu, 26 Mar 2020 04:24:29 +0000 (23:24 -0500)
committerdeadman96385 <seanhoyt963@gmail.com>
Thu, 26 Mar 2020 05:41:47 +0000 (00:41 -0500)
BoardConfig.mk
bootctrl/Android.bp
bootctrl/BootControl.cpp
device.mk

index ae422a3edc8784a528af258842c60c09cb3fd4a2..5361fc7f106d141c2033f5c85fab6ebabf106e44 100644 (file)
@@ -55,6 +55,9 @@ TARGET_PREBUILT_KERNEL := device/motorola/troika/prebuilt/Image.gz-dtb
 TARGET_BOARD_PLATFORM := exynos5
 TARGET_BOARD_PLATFORM_GPU := mali-g72
 
+PRODUCT_SOONG_NAMESPACES += device/motorola/troika
+TARGET_RECOVERY_DEVICE_MODULES += android.hardware.boot@1.0-impl.exynos
+
 # Partitions
 BOARD_FLASH_BLOCK_SIZE := 262144
 
index 05df94397d8e3091103664461dca70ffab659237..3d20c865625c3bded993e9ce9822f134099a47a4 100644 (file)
@@ -17,7 +17,6 @@ cc_library_shared {
     defaults: ["hidl_defaults"],\r
     relative_install_path: "hw",\r
     vendor: true,\r
-    recovery_available: true,\r
     srcs: ["BootControl.cpp"],\r
 \r
     shared_libs: [\r
index 2f2b8c6d6858c5290f0b6e6730b8e7af4d164f74..53637eb741c0a0b9857a508cf4ed5a5db1356278 100644 (file)
@@ -40,14 +40,14 @@ bool BootControl::readMetadata(bctl_metadata_t& data) {
     in.read(reinterpret_cast<char*>(&data), sizeof(bctl_metadata_t));\r
 \r
     if (!validateMetadata(data))\r
-        return -1;\r
+        return false;\r
 \r
     return !in.eof() && !in.fail();\r
 }\r
 \r
 bool BootControl::writeMetadata(bctl_metadata_t& data) {\r
     if (!validateMetadata(data))\r
-        return -1;\r
+        return false;\r
 \r
     // We use std::ios::in | std::ios::out even though we only write so that\r
     // we don't truncate or append to the file, but rather overwrite the file\r
@@ -119,7 +119,7 @@ Return<void> BootControl::markBootSuccessful(markBootSuccessful_cb _hidl_cb) {
     if (readMetadata(data)) {\r
         active_slot = !data.slot_info[0].is_active;\r
         \r
-        data.slot_info[active_slot].boot_successful = 0;\r
+        data.slot_info[active_slot].boot_successful = 1;\r
         data.slot_info[active_slot].tries_remaining = 0;\r
 \r
         if (success)\r
index 00329d6d3fae189fdd98c65e3ef37b80203f6ff8..6ba103b98e23c47f9306462e91244630d48869ff 100644 (file)
--- a/device.mk
+++ b/device.mk
@@ -12,9 +12,6 @@ PRODUCT_PACKAGES += \
     update_engine \
     update_verifier
 
-PRODUCT_PACKAGES += \
-    bootctrl.exynos9610
-
 AB_OTA_POSTINSTALL_CONFIG += \
     RUN_POSTINSTALL_system=true \
     POSTINSTALL_PATH_system=system/bin/otapreopt_script \
@@ -24,7 +21,6 @@ AB_OTA_POSTINSTALL_CONFIG += \
 # Enable update engine sideloading by including the static version of the
 # boot_control HAL and its dependencies.
 PRODUCT_STATIC_BOOT_CONTROL_HAL := \
-    bootctrl.exynos9610 \
     libgptutils \
     libz \
     libcutils