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 package com.android.systemui.statusbar.notification.collection 17 18 import android.app.NotificationChannel 19 import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow 20 import java.util.Collections 21 import kotlinx.coroutines.flow.MutableStateFlow 22 23 /** Class to represent notifications bundled by classification. */ 24 class BundleEntry(key: String) : PipelineEntry(key) { 25 // TODO(b/394483200): move NotificationEntry's implementation to PipelineEntry? 26 val isSensitive: MutableStateFlow<Boolean> = MutableStateFlow(false) 27 28 // TODO (b/389839319): implement the row 29 val row: ExpandableNotificationRow? = null 30 31 private val _children: MutableList<ListEntry> = ArrayList() 32 val children: List<ListEntry> = Collections.unmodifiableList(_children) 33 addChildnull34 fun addChild(child: ListEntry) { 35 _children.add(child) 36 } 37 clearChildrennull38 fun clearChildren() { 39 _children.clear() 40 } 41 42 /** @return Null because bundles do not have an associated NotificationEntry. */ getRepresentativeEntrynull43 override fun getRepresentativeEntry(): NotificationEntry? { 44 return null 45 } 46 getParentnull47 override fun getParent(): PipelineEntry? { 48 return null 49 } 50 wasAttachedInPreviousPassnull51 override fun wasAttachedInPreviousPass(): Boolean { 52 return false 53 } 54 55 companion object { 56 val ROOT_BUNDLES: List<BundleEntry> = 57 listOf( 58 BundleEntry(NotificationChannel.PROMOTIONS_ID), 59 BundleEntry(NotificationChannel.SOCIAL_MEDIA_ID), 60 BundleEntry(NotificationChannel.NEWS_ID), 61 BundleEntry(NotificationChannel.RECS_ID), 62 ) 63 } 64 } 65