tags:

views:

33

answers:

0

Does Android wake from deep sleep in order to broadcast ACTION_TIME_TICK? From experimenting, I don't think it does, but I'm looking for a definitive answer.

My experiment involved registering a simple BroadcastReceiver to update a TextView on receive:

registerReceiver(new BroadcastReceiver() {
    int ctr = 0;
    @Override
    public void onReceive(Context context, Intent intent) {
        testView.setText("Time ticks: " + ++ctr);
    }
}, new IntentFilter(Intent.ACTION_TIME_TICK));

At 4 ticks, I turned off the screen for about 5 minutes, then turned it back on, and it read 6 ticks. At 13 ticks, I turned the screen for 10 minutes, then turned it back on, and the number of ticks read 14. It only seems to increase by 1-2 ticks no matter how long I leave the phone off, which is why I suspect it doesn't broadcast the action during deep sleep.