diff options
| author | 2019-12-17 23:29:02 +0000 | |
|---|---|---|
| committer | 2019-12-17 23:29:02 +0000 | |
| commit | ad2d19a0d6e8ddd11c11e5548b03ae9c4fad7f1a (patch) | |
| tree | 9cf33e391d5e2792a69d4d498a71f9efa524ab1a | |
| parent | 2c20c4f07bbccd08653d477eeb25ff9d7e7853cd (diff) | |
| parent | f235ec4564df32cd2d67111b100a528341534524 (diff) | |
Merge "Give a new Handler to each injected Executor."
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/util/concurrency/ConcurrencyModule.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/util/concurrency/ConcurrencyModule.java b/packages/SystemUI/src/com/android/systemui/util/concurrency/ConcurrencyModule.java index 24f49ff99879..3e90581292ce 100644 --- a/packages/SystemUI/src/com/android/systemui/util/concurrency/ConcurrencyModule.java +++ b/packages/SystemUI/src/com/android/systemui/util/concurrency/ConcurrencyModule.java @@ -18,11 +18,12 @@ package com.android.systemui.util.concurrency; import android.content.Context; import android.os.Handler; +import android.os.Looper; import com.android.systemui.dagger.qualifiers.Background; -import com.android.systemui.dagger.qualifiers.BgHandler; +import com.android.systemui.dagger.qualifiers.BgLooper; import com.android.systemui.dagger.qualifiers.Main; -import com.android.systemui.dagger.qualifiers.MainHandler; +import com.android.systemui.dagger.qualifiers.MainLooper; import java.util.concurrent.Executor; @@ -38,8 +39,8 @@ public abstract class ConcurrencyModule { * Provide a Background-Thread Executor by default. */ @Provides - public static Executor provideExecutor(@BgHandler Handler handler) { - return new ExecutorImpl(handler); + public static Executor provideExecutor(@BgLooper Looper looper) { + return new ExecutorImpl(new Handler(looper)); } /** @@ -47,8 +48,8 @@ public abstract class ConcurrencyModule { */ @Provides @Background - public static Executor provideBackgroundExecutor(@BgHandler Handler handler) { - return new ExecutorImpl(handler); + public static Executor provideBackgroundExecutor(@BgLooper Looper looper) { + return new ExecutorImpl(new Handler(looper)); } /** @@ -64,8 +65,8 @@ public abstract class ConcurrencyModule { * Provide a Background-Thread Executor by default. */ @Provides - public static DelayableExecutor provideDelayableExecutor(@BgHandler Handler handler) { - return new ExecutorImpl(handler); + public static DelayableExecutor provideDelayableExecutor(@BgLooper Looper looper) { + return new ExecutorImpl(new Handler(looper)); } /** @@ -73,8 +74,8 @@ public abstract class ConcurrencyModule { */ @Provides @Background - public static DelayableExecutor provideBackgroundDelayableExecutor(@BgHandler Handler handler) { - return new ExecutorImpl(handler); + public static DelayableExecutor provideBackgroundDelayableExecutor(@BgLooper Looper looper) { + return new ExecutorImpl(new Handler(looper)); } /** @@ -82,7 +83,7 @@ public abstract class ConcurrencyModule { */ @Provides @Main - public static DelayableExecutor provideMainDelayableExecutor(@MainHandler Handler handler) { - return new ExecutorImpl(handler); + public static DelayableExecutor provideMainDelayableExecutor(@MainLooper Looper looper) { + return new ExecutorImpl(new Handler(looper)); } } |