本文主要是介绍Android 控制fastboot模式下功能,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
涉及代码如下
bootable/bootloader/lk/makefile
# 这里编译条件使得user版本下 fastboot 很多功能失效
ifeq ($(TARGET_BUILD_VARIANT),user)CFLAGS += -DDISABLE_FASTBOOT_CMDS=1
endif
bootable/bootloader/lk/app/aboot/aboot.c
// 这里即是宏使用的地方,涉及如下指令是否能用
#ifndef DISABLE_FASTBOOT_CMDS/* Register the following commands only for non-user builds */{"flash:", cmd_flash},{"erase:", cmd_erase},{"boot", cmd_boot},{"continue", cmd_continue},{"reboot", cmd_reboot},{"reboot-bootloader", cmd_reboot_bootloader},{"oem unlock", cmd_oem_unlock},{"oem unlock-go", cmd_oem_unlock_go},{"oem lock", cmd_oem_lock},{"flashing unlock", cmd_oem_unlock},{"flashing lock", cmd_oem_lock},{"flashing lock_critical", cmd_flashing_lock_critical},{"flashing unlock_critical", cmd_flashing_unlock_critical},{"flashing get_unlock_ability", cmd_flashing_get_unlock_ability},{"oem device-info", cmd_oem_devinfo},{"preflash", cmd_preflash},{"oem enable-charger-screen", cmd_oem_enable_charger_screen},{"oem disable-charger-screen", cmd_oem_disable_charger_screen},{"oem off-mode-charge", cmd_oem_off_mode_charger},{"oem select-display-panel", cmd_oem_select_display_panel},{"set_active",cmd_set_active},
#if UNITTEST_FW_SUPPORT{"oem run-tests", cmd_oem_runtests},
#endif
#endif};... ...if (reboot_mode == RECOVERY_MODE){boot_into_recovery = 1;}// 设置reboot模式,修改这里可以强制禁止进入fastboot模式else if(reboot_mode == FASTBOOT_MODE){boot_into_fastboot = true;}else if(reboot_mode == ALARM_BOOT){boot_reason_alarm = true;}
这篇关于Android 控制fastboot模式下功能的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!