POWERUPREASON

来源:互联网 发布:软件开发编码规范 编辑:程序博客网 时间:2024/06/13 23:08

http://blog.csdn.net/cloudwu007/article/details/6821329

1、手机如果重启,会在/data/system/dropbox 留下开机信息,可以查看次类文件生成的时间标来了解手机重启的时间情况。另外,系统会自动记录最后一次开机/重启的原因到 /proc/bootinfo。

2、查看bootinfo,可以确定重启原因为SW_AP_RESET,即软件原因重启。

C:\>adb shell cat /proc/bootinfo
POWERUPREASON : 0x00004000
MBM_VERSION : 0x00000a64
MBM_LOADER_VERSION : 0x00000a64
FLAT_DEV_TREE_ADDRESS : 0xffffffff
BATTERY_STATUS_AT_BOOT : 0x0001
CID_RECOVER_BOOT : 0x00


POWERUPREASON 的相关解释如下
* Powerup Reason definition */
#define TIME_OF_DAY_ALARM     0x00000008 /* Bit 3  */
#define USB_CABLE             0x00000010 /* Bit 4  */
#define FACTORY_CABLE         0x00000020 /* Bit 5  */
#define AIRPLANE_MODE         0x00000040 /* Bit 6  */
#define PWR_KEY_PRESS         0x00000080 /* Bit 7  */
#define CHARGER               0x00000100 /* Bit 8  */
#define POWER_CUT             0x00000200 /* Bit 9  */
#define REGRESSION_CABLE      0x00000400 /* Bit 10 */
#define SYSTEM_RESTART        0x00000800 /* Bit 11 */
#define MODEL_ASSEMBLY        0x00001000 /* Bit 12 */
#define MODEL_ASSEMBLY_VOL    0x00002000 /* Bit 13 */
#define SW_AP_RESET           0x00004000 /* Bit 14 */
#define WDOG_AP_RESET         0x00008000 /* Bit 15 */
#define CLKMON_CKIH_RESET     0x00010000 /* Bit 16 */
#define AP_KERNEL_PANIC       0x00020000 /* Bit 17 */
#define CPCAP_WDOG            0x00040000 /* Bit 18 */




原创粉丝点击