• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 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.notification.collection
18 
19 import com.android.internal.logging.MetricsLogger
20 import com.android.systemui.statusbar.notification.NotificationActivityStarter
21 import com.android.systemui.statusbar.notification.collection.coordinator.VisualStabilityCoordinator
22 import com.android.systemui.statusbar.notification.collection.provider.HighPriorityProvider
23 import com.android.systemui.statusbar.notification.headsup.HeadsUpManager
24 import com.android.systemui.statusbar.notification.people.PeopleNotificationIdentifier
25 import com.android.systemui.statusbar.notification.row.NotificationActionClickManager
26 import com.android.systemui.statusbar.notification.row.icon.NotificationIconStyleProvider
27 import javax.inject.Inject
28 
29 /** Creates an appropriate EntryAdapter for the entry type given */
30 class EntryAdapterFactoryImpl
31 @Inject
32 constructor(
33     private val notificationActivityStarter: NotificationActivityStarter,
34     private val metricsLogger: MetricsLogger,
35     private val peopleNotificationIdentifier: PeopleNotificationIdentifier,
36     private val iconStyleProvider: NotificationIconStyleProvider,
37     private val visualStabilityCoordinator: VisualStabilityCoordinator,
38     private val notificationActionClickManager: NotificationActionClickManager,
39     private val highPriorityProvider: HighPriorityProvider,
40     private val headsUpManager: HeadsUpManager,
41 ) : EntryAdapterFactory {
createnull42     override fun create(entry: PipelineEntry): EntryAdapter {
43         return if (entry is NotificationEntry) {
44             NotificationEntryAdapter(
45                 notificationActivityStarter,
46                 metricsLogger,
47                 peopleNotificationIdentifier,
48                 iconStyleProvider,
49                 visualStabilityCoordinator,
50                 notificationActionClickManager,
51                 highPriorityProvider,
52                 headsUpManager,
53                 entry,
54             )
55         } else {
56             BundleEntryAdapter(highPriorityProvider, (entry as BundleEntry))
57         }
58     }
59 }
60