Check apps idle states on time changes

And ensure that the listeners are informed of app standby transitions
that might occur during time changes.

Fix for apps that sometimes don't have network access until reboot.

Bug: 26488100
Change-Id: Ic342c188a6cd19faee88f50b2c6a342a6968cb23
This commit is contained in:
Amith Yamasani
2016-01-22 11:27:16 -08:00
parent a6855a1faa
commit c465e71cdc

View File

@@ -557,6 +557,7 @@ public class UsageStatsService extends SystemService implements
}
mRealTimeSnapshot = actualRealtime;
mSystemTimeSnapshot = actualSystemTime;
postCheckIdleStates(UserHandle.USER_ALL);
}
return actualSystemTime;
}
@@ -601,7 +602,7 @@ public class UsageStatsService extends SystemService implements
|| event.mEventType == Event.SYSTEM_INTERACTION
|| event.mEventType == Event.USER_INTERACTION)) {
if (previouslyIdle) {
// Slog.d(TAG, "Informing listeners of out-of-idle " + event.mPackage);
//Slog.d(TAG, "Informing listeners of out-of-idle " + event.mPackage);
mHandler.sendMessage(mHandler.obtainMessage(MSG_INFORM_LISTENERS, userId,
/* idle = */ 0, event.mPackage));
notifyBatteryStats(event.mPackage, userId, false);