android OTA升级(VAB分区)
android OTA升级(VAB分区)
升级开始前,升级程序update_engine将要升级的slot标记为unsuccessful,调用boot_ctl的SetSlotAsUnbootable()
hardware/interfaces/boot/1.1/default/boot_control/libboot_control.cpp
316 bool BootControl::SetSlotAsUnbootable(unsigned int slot) { 317 if (slot >= kMaxNumSlots || slot >= num_slots_) { 318 // Invalid slot number. 319 return false; 320 } 321 322 bootloader_control bootctrl; 323 if (!LoadBootloaderControl(misc_device_, &bootctrl)) return false; 324 325 // The only way to mark a slot as unbootable, regardless of the priority is to 326 // set the tries_remaining to 0. 327 bootctrl.slot_info[slot].successful_boot = 0; 328 bootctrl.slot_info[slot].tries_remaining = 0; 329 return UpdateAndSaveBootloaderControl(misc_device_, &bootctrl); 330 }