I have an Alarm App that works perfectly
except when the phone is deeply asleep.
When truly asleep my alarm activity shows up after the user wakes up the phone. I want the phone to wake up the user...
这项评估直接从广播接收器开始。 www.un.org/Depts/DGACM/index_french.htm
One clue:
Log D DeepSleepService: AlarmManager go out of deepsleep
...
PowerManagerService: putReleasedWakeLock
PowerManagerService: *mAcquiredLocks contents****
PowerManagerService: LockList entry : flags=0x10000006 tag=com.solidllc.foo.WakeLock
PowerManagerService: LockList entry : flags=0x1 tag=RILJ
PowerManagerService: LockList entry : flags=0x1 tag=network-location
PowerManagerService: LockList entry : flags=0xa tag=KEEP_SCREEN_ON_FLAG
PowerManagerService: putReleasedWakeLock --> remove partial wakelocks into list, size i
...
//
//My manifest:
android.permission.INTERNET
android.permission.WAKE_LOCK
android.permission.DEVICE_POWER
android.permission.DISABLE_KEYGUARD
The Alarm Clock that comes with Android has the above plus: "Modify global system settings" and "Retrieve Running apps".
任何人都知道可以做些什么?
非常感谢。
Here is the code that sets the alarm:
void armAlarm(int hour, int minute) {
Calendar alarmtime = new GregorianCalendar();
alarmtime.set(Calendar.HOUR_OF_DAY, hour);
alarmtime.set(Calendar.MINUTE, minute);
alarmtime.set(Calendar.SECOND, 0);
Intent intent = new Intent(RatActivity.this, AlarmReceiver.class);
PendingIntent pi = PendingIntent.getBroadcast(RatActivity.this, 0,
intent, 0);
AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
am.cancel(pi);
am.setRepeating(AlarmManager.RTC_WAKEUP, alarmtime.getTimeInMillis(),
AlarmManager.INTERVAL_DAY, pi);
}