alarm 开机时判断
来源:互联网 发布:php检查类是否存在 编辑:程序博客网 时间:2024/05/29 17:56
/device/qcom/common/init/init_msm.c:
{ char *alarm_file = "/proc/sys/kernel/boot_reason"; char buf[BUF_SIZE]; char tmp[PROP_VALUE_MAX]=""; property_get("ro.boot.alarmboot", tmp); if(read_file2(alarm_file, buf, sizeof(buf))) { /* * Setup ro.alarm_boot value to true when it is RTC triggered boot up * For existing PMIC chips, the following mapping applies * for the value of boot_reason: * * 0 -> unknown * 1 -> hard reset * 2 -> sudden momentary power loss (SMPL) * 3 -> real time clock (RTC) * 4 -> DC charger inserted * 5 -> USB charger insertd * 6 -> PON1 pin toggled (for secondary PMICs) * 7 -> CBLPWR_N pin toggled (for external power supply) * 8 -> KPDPWR_N pin toggled (power key pressed) */ if(buf[0] == '3' || !strcmp(tmp,"true")) property_set("ro.alarm_boot", "true"); else property_set("ro.alarm_boot", "false"); }
AMS systemReady函数中:
startHomeActivityLocked(mCurrentUserId, "systemReady");// start the power off alarm by boot modeboolean isAlarmBoot = SystemProperties.getBoolean("ro.alarm_boot", false);if (isAlarmBoot) { startAlarmActivityLocked();}
0 0
- alarm 开机时判断
- Alarm
- alarm
- alarm
- alarm
- Alarm
- Alarm
- Alarm
- alarm
- alarm
- alarm
- alarm
- alarm
- 如何判断一个alarm是否已经被创建
- 判断机器是否开机
- 开机时判断是否有U盘插入
- android 如何判断开机完成
- android 如何判断开机完成
- 学习二插树的创建
- 关于分布式事务、两阶段提交、一阶段提交、Best Efforts 1PC模式和事务补偿机制的研究
- 对 qpainter::scale 的注解
- unique_ptr, effective modern c++笔记
- 14.2.2
- alarm 开机时判断
- linux shell 学习之第13章 处理用户输入
- SQL 查看职责,哪个用户有
- 慕课网--toggleButton
- Codeforces Round #369 (Div. 2) B. Chris and Magic Square
- 14.3
- 16. 3Sum Closest
- 15.1.1
- 51nod-1255 字典序最小的子序列