summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Bestas <mkbestas@gmail.com>2023-06-14 11:52:56 +0300
committeralk3pInjection <webmaster@raspii.tech>2023-07-05 17:28:15 +0800
commitd5f85d3b152fa24c04ed54712a04c20ca192f7ae (patch)
treef1c6b8a1c76e470f8373aac8ac6da44863a1dc39
parent1b68e2a102330af09529f273ab09142ccee9084d (diff)
fixup! SystemUI: Add caffeine QS tile
Change-Id: I16eab8d0ec496bbac7e32eea370c846573349cc9
-rw-r--r--packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/lineage/LineageModule.kt34
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/CaffeineTile.java2
3 files changed, 38 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
index 05527bd2c843..cc3ad9dd8b6e 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
@@ -49,6 +49,7 @@ import com.android.systemui.flags.FlagsModule;
import com.android.systemui.fragments.FragmentService;
import com.android.systemui.keyboard.KeyboardModule;
import com.android.systemui.keyguard.data.BouncerViewModule;
+import com.android.systemui.lineage.LineageModule;
import com.android.systemui.log.dagger.LogModule;
import com.android.systemui.mediaprojection.appselector.MediaProjectionModule;
import com.android.systemui.model.SysUiState;
@@ -155,6 +156,7 @@ import dagger.Provides;
FooterActionsModule.class,
GarbageMonitorModule.class,
KeyboardModule.class,
+ LineageModule.class,
LogModule.class,
MediaProjectionModule.class,
MotionToolModule.class,
diff --git a/packages/SystemUI/src/com/android/systemui/lineage/LineageModule.kt b/packages/SystemUI/src/com/android/systemui/lineage/LineageModule.kt
new file mode 100644
index 000000000000..b68fba0ab6b6
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/lineage/LineageModule.kt
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2023 The LineageOS Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.lineage
+
+import com.android.systemui.qs.tileimpl.QSTileImpl
+import com.android.systemui.qs.tiles.CaffeineTile
+
+import dagger.Binds
+import dagger.Module
+import dagger.multibindings.IntoMap
+import dagger.multibindings.StringKey
+
+@Module
+interface LineageModule {
+ /** Inject CaffeineTile into tileMap in QSModule */
+ @Binds
+ @IntoMap
+ @StringKey(CaffeineTile.TILE_SPEC)
+ fun bindCaffeineTile(caffeineTile: CaffeineTile): QSTileImpl<*>
+}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CaffeineTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CaffeineTile.java
index 340de5648a1b..c292fc729461 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CaffeineTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CaffeineTile.java
@@ -49,6 +49,8 @@ import javax.inject.Inject;
/** Quick settings tile: Caffeine **/
public class CaffeineTile extends QSTileImpl<BooleanState> {
+ public static final String TILE_SPEC = "caffeine";
+
private final Icon mIcon = ResourceIcon.get(R.drawable.ic_qs_caffeine);
private final PowerManager.WakeLock mWakeLock;