1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.systemui.statusbar.pipeline.icons.shared
18 
19 import com.android.systemui.dagger.SysUISingleton
20 import com.android.systemui.statusbar.pipeline.icons.shared.model.BindableIcon
21 import com.android.systemui.statusbar.pipeline.satellite.ui.DeviceBasedSatelliteBindableIcon
22 import javax.inject.Inject
23 
24 /**
25  * Bindable status bar icons represent icon descriptions which can be registered with
26  * StatusBarIconController and can also create their own bindings. A bound icon is responsible for
27  * its own updates via the [repeatWhenAttached] view lifecycle utility. Thus,
28  * StatusBarIconController can (and will) ignore any call to setIcon.
29  *
30  * In other words, these icons are bound once (at controller init) and they will control their
31  * visibility on their own (while their overall appearance remains at the discretion of
32  * StatusBarIconController, via the ModernStatusBarViewBinding interface).
33  */
34 interface BindableIconsRegistry {
35     val bindableIcons: List<BindableIcon>
36 }
37 
38 @SysUISingleton
39 class BindableIconsRegistryImpl
40 @Inject
41 constructor(
42     /** Bindables go here */
43     oemSatellite: DeviceBasedSatelliteBindableIcon
44 ) : BindableIconsRegistry {
45     /**
46      * Adding the injected bindables to this list will get them registered with
47      * StatusBarIconController
48      */
49     override val bindableIcons: List<BindableIcon> = listOf(oemSatellite)
50 }
51