Bug fix: looper not enabled

Looper should not be enabled when we build the LooperStatsService so
that setEnabled is called and the observer is installed.

Test: atest LooperStatsTest
Change-Id: I8d8800a6a2222b2d67a2aacdc58ce631dc1c8217
This commit is contained in:
Olivier Gaillard
2019-02-04 10:42:34 +00:00
parent 0c573ea5c6
commit 4158938848

View File

@@ -59,7 +59,8 @@ public class LooperStatsService extends Binder {
private final Context mContext;
private final LooperStats mStats;
private boolean mEnabled = DEFAULT_ENABLED;
// Default should be false so that the first call to #setEnabled installed the looper observer.
private boolean mEnabled = false;
private LooperStatsService(Context context, LooperStats stats) {
this.mContext = context;