diff options
| author | 2019-11-19 21:24:34 -0500 | |
|---|---|---|
| committer | 2019-11-19 21:24:34 -0500 | |
| commit | 6711ec9e4562094e16bcb2ef791cb0e5cdcd27f7 (patch) | |
| tree | 4e52930e28301cd992f64296d54683d3166a3b24 | |
| parent | ad51c4d85f6607e5a2d3ca30faee7b7d7abed2f2 (diff) | |
Remove Dependency.get(MAIN_HANDLER) from SystemUIService
Bug: 144503618
Test: atest SystemUITests
Change-Id: Ia75498b500333ac4924f1b1e3f7831f7ff7754e3
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/SystemUIService.java | 14 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/dagger/DefaultServiceBinder.java | 7 |
2 files changed, 20 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIService.java b/packages/SystemUI/src/com/android/systemui/SystemUIService.java index 8825f1279796..164595742ae0 100644 --- a/packages/SystemUI/src/com/android/systemui/SystemUIService.java +++ b/packages/SystemUI/src/com/android/systemui/SystemUIService.java @@ -20,20 +20,32 @@ import android.annotation.NonNull; import android.app.Service; import android.content.Intent; import android.os.Build; +import android.os.Handler; import android.os.IBinder; import android.os.Process; import android.os.SystemProperties; import android.util.Slog; import com.android.internal.os.BinderInternal; +import com.android.systemui.dagger.qualifiers.MainHandler; import com.android.systemui.shared.plugins.PluginManager; import com.android.systemui.shared.plugins.PluginManagerImpl; import java.io.FileDescriptor; import java.io.PrintWriter; +import javax.inject.Inject; + public class SystemUIService extends Service { + private final Handler mMainHandler; + + @Inject + public SystemUIService(@MainHandler Handler mainHandler) { + super(); + mMainHandler = mainHandler; + } + @Override public void onCreate() { super.onCreate(); @@ -56,7 +68,7 @@ public class SystemUIService extends Service { "uid " + uid + " sent too many Binder proxies to uid " + Process.myUid()); } - }, Dependency.get(Dependency.MAIN_HANDLER)); + }, mMainHandler); } } diff --git a/packages/SystemUI/src/com/android/systemui/dagger/DefaultServiceBinder.java b/packages/SystemUI/src/com/android/systemui/dagger/DefaultServiceBinder.java index 85cd51c4e169..f790d9929846 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/DefaultServiceBinder.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/DefaultServiceBinder.java @@ -19,6 +19,7 @@ package com.android.systemui.dagger; import android.app.Service; import com.android.systemui.ImageWallpaper; +import com.android.systemui.SystemUIService; import com.android.systemui.doze.DozeService; import com.android.systemui.keyguard.KeyguardService; import com.android.systemui.screenshot.TakeScreenshotService; @@ -54,6 +55,12 @@ public abstract class DefaultServiceBinder { /** */ @Binds @IntoMap + @ClassKey(SystemUIService.class) + public abstract Service bindSystemUIService(SystemUIService service); + + /** */ + @Binds + @IntoMap @ClassKey(TakeScreenshotService.class) public abstract Service bindTakeScreenshotService(TakeScreenshotService service); } |