Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84abe100 authored by Mark Lu's avatar Mark Lu Committed by Steve Kondik
Browse files

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,
System will be blocked then watchdog timeout.

Solution:
Let display listener executed in background thread handler

Change-Id: Ic894d112612400ed8fb7ba843b3309fdc4f66fe1
parent c8b36677
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -218,7 +218,7 @@ public class UsageStatsService extends SystemService implements
            synchronized (this) {
                mScreenOnTime = readScreenOnTimeLocked();
            }
            mDisplayManager.registerDisplayListener(mDisplayListener, null);
            mDisplayManager.registerDisplayListener(mDisplayListener, mHandler);
            synchronized (this) {
                updateDisplayLocked();
            }