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