在package com.android.deskclock.Alarms中把以下代码
if (!disablePoweroffAlarm && "unencrypted".equals(SystemProperties.get("ro.crypto.state"))) {
// not enabled device encrypt, enable power-off alarm
am.set(POWER_OFF_WAKE_UP, atTimeInMillis, sender);
} else {
// enabled device encrypt, use google default design
am.set(AlarmManager.RTC_WAKEUP, atTimeInMillis, sender);
}
修改成
am.set(AlarmManager.RTC_WAKEUP, atTimeInMillis, sender);
不需要上面if 中的那个判断