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.notification.data.model
18
19 import android.app.PendingIntent
20 import android.graphics.drawable.Icon
21 import com.android.internal.logging.InstanceId
22 import com.android.systemui.statusbar.StatusBarIconView
23 import com.android.systemui.statusbar.notification.promoted.shared.model.PromotedNotificationContentModels
24 import com.android.systemui.statusbar.notification.shared.ActiveNotificationModel
25 import com.android.systemui.statusbar.notification.shared.CallType
26 import com.android.systemui.statusbar.notification.stack.BUCKET_UNKNOWN
27
28 /** Simple ActiveNotificationModel builder for use in tests. */
activeNotificationModelnull29 fun activeNotificationModel(
30 key: String,
31 groupKey: String? = null,
32 whenTime: Long = 0L,
33 isForegroundService: Boolean = false,
34 isOngoingEvent: Boolean = false,
35 isAmbient: Boolean = false,
36 isRowDismissed: Boolean = false,
37 isSilent: Boolean = false,
38 isLastMessageFromReply: Boolean = false,
39 isSuppressedFromStatusBar: Boolean = false,
40 isPulsing: Boolean = false,
41 aodIcon: Icon? = null,
42 shelfIcon: Icon? = null,
43 statusBarIcon: Icon? = null,
44 statusBarChipIcon: StatusBarIconView? = null,
45 uid: Int = 0,
46 instanceId: InstanceId? = null,
47 isGroupSummary: Boolean = false,
48 packageName: String = "pkg",
49 appName: String = "appName",
50 contentIntent: PendingIntent? = null,
51 bucket: Int = BUCKET_UNKNOWN,
52 callType: CallType = CallType.None,
53 promotedContent: PromotedNotificationContentModels? = null,
54 ) =
55 ActiveNotificationModel(
56 key = key,
57 groupKey = groupKey,
58 whenTime = whenTime,
59 isForegroundService = isForegroundService,
60 isOngoingEvent = isOngoingEvent,
61 isAmbient = isAmbient,
62 isRowDismissed = isRowDismissed,
63 isSilent = isSilent,
64 isLastMessageFromReply = isLastMessageFromReply,
65 isSuppressedFromStatusBar = isSuppressedFromStatusBar,
66 isPulsing = isPulsing,
67 aodIcon = aodIcon,
68 shelfIcon = shelfIcon,
69 statusBarIcon = statusBarIcon,
70 statusBarChipIconView = statusBarChipIcon,
71 uid = uid,
72 packageName = packageName,
73 appName = appName,
74 contentIntent = contentIntent,
75 instanceId = instanceId,
76 isGroupSummary = isGroupSummary,
77 bucket = bucket,
78 callType = callType,
79 promotedContent = promotedContent,
80 )
81