OSDN Git Service

DO NOT MERGE ANYWHERE 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)
committerJoe LaPenna <jlapenna@google.com>
Thu, 12 Nov 2015 01:39:24 +0000 (17:39 -0800)
commit7018f60b06fd0c647ebf13225320d7e15d02e075
treee57985493090564dc1c8ca9423442c89474fc295
parent1090acc958add85c1332fc73b66258ea4efba69e
DO NOT MERGE ANYWHERE 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

BUG: 25355086

Change-Id: Ic894d112612400ed8fb7ba843b3309fdc4f66fe1
(Cherrypicked from 4e59db328d8b0cc163d2e3eb0f7f3a108f20a58d)
services/usage/java/com/android/server/usage/UsageStatsService.java