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 package com.android.systemui.statusbar.notification.icon.ui.viewbinder
17 
18 import android.content.Context
19 import android.graphics.Rect
20 import android.view.View
21 import com.android.systemui.dagger.SysUISingleton
22 import com.android.systemui.statusbar.StatusBarIconView
23 import com.android.systemui.statusbar.notification.collection.ListEntry
24 import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor
25 import com.android.systemui.statusbar.phone.NotificationIconAreaController
26 import com.android.systemui.statusbar.phone.NotificationIconContainer
27 import javax.inject.Inject
28 
29 /**
30  * Controller class for [NotificationIconContainer]. This implementation serves as a temporary
31  * wrapper around [NotificationIconContainerViewBinder], so that external code can continue to
32  * depend on the [NotificationIconAreaController] interface. Once
33  * [LegacyNotificationIconAreaControllerImpl] is removed, this class can go away and the ViewBinder
34  * can be used directly.
35  */
36 @SysUISingleton
37 class NotificationIconAreaControllerViewBinderWrapperImpl @Inject constructor() :
38     NotificationIconAreaController {
39 
40     /** Called by the Keyguard*ViewController whose view contains the aod icons. */
setupAodIconsnull41     override fun setupAodIcons(aodIcons: NotificationIconContainer?) = unsupported
42 
43     override fun setShelfIcons(icons: NotificationIconContainer) = unsupported
44 
45     override fun onDensityOrFontScaleChanged(context: Context) = unsupported
46 
47     /** Returns the view that represents the notification area. */
48     override fun getNotificationInnerAreaView(): View? = unsupported
49 
50     /** Updates the notifications with the given list of notifications to display. */
51     override fun updateNotificationIcons(entries: List<ListEntry>) = unsupported
52 
53     override fun updateAodNotificationIcons() = unsupported
54 
55     override fun showIconIsolated(icon: StatusBarIconView?, animated: Boolean) = unsupported
56 
57     override fun setIsolatedIconLocation(iconDrawingRect: Rect, requireStateUpdate: Boolean) =
58         unsupported
59 
60     override fun setAnimationsEnabled(enabled: Boolean) = unsupported
61 
62     override fun onThemeChanged() = unsupported
63 
64     override fun getHeight(): Int = unsupported
65 
66     companion object {
67         val unsupported: Nothing
68             get() =
69                 error(
70                     "Code path not supported when ${NotificationIconContainerRefactor.FLAG_NAME}" +
71                         " is disabled"
72                 )
73     }
74 }
75