OSDN Git Service

Fix system watchdog timeout when reading too many usage events.
authorMark Lu <Mark_Lu@htc.com>
Fri, 6 Nov 2015 07:26:15 +0000 (15:26 +0800)
committerMark Lu <Mark_Lu@htc.com>
Mon, 9 Nov 2015 07:24:48 +0000 (07:24 +0000)
commit4e59db328d8b0cc163d2e3eb0f7f3a108f20a58d
tree20e6c80dcddbc3c34d4aa655f7bd636ae0c9b3b1
parent7abb36599d9537296d9a51f766152025c6ed0491
Fix system watchdog timeout when reading too many usage events.

Symptom:
As issue link:
https://code.google.com/p/android/issues/detail?id=193100

RootCause:
UsageStatsService.onDisplayChanged executed in system main thread,
If calling UsageStatsManager.queryEvents with too many events before it
(i.e. in daily usage event file,
too many activity resume / pause events or configuration change
during monkey test),
System will be blocked then watchdog timeout.

Solution:
Let display listener executed in background thread handler

Change-Id: Ic894d112612400ed8fb7ba843b3309fdc4f66fe1
services/usage/java/com/android/server/usage/UsageStatsService.java