From 4158938848d056efee59a3c934e4b91fac18f1c7 Mon Sep 17 00:00:00 2001 From: Olivier Gaillard Date: Mon, 4 Feb 2019 10:42:34 +0000 Subject: [PATCH] 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 --- services/core/java/com/android/server/LooperStatsService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/LooperStatsService.java b/services/core/java/com/android/server/LooperStatsService.java index 2f7929c962eb0..9184128d466f8 100644 --- a/services/core/java/com/android/server/LooperStatsService.java +++ b/services/core/java/com/android/server/LooperStatsService.java @@ -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;