1 /* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use mHost file 5 * except in compliance with the License. You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software distributed under the 10 * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 11 * KIND, either express or implied. See the License for the specific language governing 12 * permissions and limitations under the License. 13 */ 14 15 package com.android.systemui.statusbar.policy 16 17 import com.android.systemui.qs.tileimpl.QSTileImpl 18 import com.android.systemui.qs.tiles.AlarmTile 19 import com.android.systemui.qs.tiles.CameraToggleTile 20 import com.android.systemui.qs.tiles.DndTile 21 import com.android.systemui.qs.tiles.FlashlightTile 22 import com.android.systemui.qs.tiles.LocationTile 23 import com.android.systemui.qs.tiles.MicrophoneToggleTile 24 import com.android.systemui.qs.tiles.UiModeNightTile 25 import com.android.systemui.qs.tiles.WorkModeTile 26 import dagger.Binds 27 import dagger.Module 28 import dagger.multibindings.IntoMap 29 import dagger.multibindings.StringKey 30 31 @Module 32 interface PolicyModule { 33 34 /** Inject DndTile into tileMap in QSModule */ 35 @Binds @IntoMap @StringKey(DndTile.TILE_SPEC) fun bindDndTile(dndTile: DndTile): QSTileImpl<*> 36 37 /** Inject WorkModeTile into tileMap in QSModule */ 38 @Binds 39 @IntoMap 40 @StringKey(WorkModeTile.TILE_SPEC) 41 fun bindWorkModeTile(workModeTile: WorkModeTile): QSTileImpl<*> 42 43 /** Inject FlashlightTile into tileMap in QSModule */ 44 @Binds 45 @IntoMap 46 @StringKey(FlashlightTile.TILE_SPEC) 47 fun bindFlashlightTile(flashlightTile: FlashlightTile): QSTileImpl<*> 48 49 /** Inject LocationTile into tileMap in QSModule */ 50 @Binds 51 @IntoMap 52 @StringKey(LocationTile.TILE_SPEC) 53 fun bindLocationTile(locationTile: LocationTile): QSTileImpl<*> 54 55 /** Inject CameraToggleTile into tileMap in QSModule */ 56 @Binds 57 @IntoMap 58 @StringKey(CameraToggleTile.TILE_SPEC) 59 fun bindCameraToggleTile(cameraToggleTile: CameraToggleTile): QSTileImpl<*> 60 61 /** Inject MicrophoneToggleTile into tileMap in QSModule */ 62 @Binds 63 @IntoMap 64 @StringKey(MicrophoneToggleTile.TILE_SPEC) 65 fun bindMicrophoneToggleTile(microphoneToggleTile: MicrophoneToggleTile): QSTileImpl<*> 66 67 /** Inject AlarmTile into tileMap in QSModule */ 68 @Binds 69 @IntoMap 70 @StringKey(AlarmTile.TILE_SPEC) 71 fun bindAlarmTile(alarmTile: AlarmTile): QSTileImpl<*> 72 73 @Binds 74 @IntoMap 75 @StringKey(UiModeNightTile.TILE_SPEC) 76 fun bindUiModeNightTile(uiModeNightTile: UiModeNightTile): QSTileImpl<*> 77 } 78