summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/ConnectedDisplaysStatusBarNotificationIconViewStore.kt18
1 files changed, 15 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/ConnectedDisplaysStatusBarNotificationIconViewStore.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/ConnectedDisplaysStatusBarNotificationIconViewStore.kt
index eb55856d994b..5760b5f79c74 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/ConnectedDisplaysStatusBarNotificationIconViewStore.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/ConnectedDisplaysStatusBarNotificationIconViewStore.kt
@@ -16,6 +16,7 @@
package com.android.systemui.statusbar.notification.icon.ui.viewbinder
+import android.util.Log
import com.android.systemui.display.domain.interactor.DisplayWindowPropertiesInteractor
import com.android.systemui.lifecycle.Activatable
import com.android.systemui.statusbar.StatusBarIconView
@@ -61,9 +62,16 @@ constructor(
}
override fun iconView(key: String): StatusBarIconView? {
- val entry = notifCollection.getEntry(key) ?: return null
- val displayWindowProperties =
- displayWindowPropertiesInteractor.getForStatusBar(displayId) ?: return null
+ val entry = notifCollection.getEntry(key)
+ if (entry == null) {
+ Log.w(TAG, "No notification entry found for key: $key")
+ return null
+ }
+ val displayWindowProperties = displayWindowPropertiesInteractor.getForStatusBar(displayId)
+ if (displayWindowProperties == null) {
+ Log.w(TAG, "No display properties found for display id: $displayId")
+ return null
+ }
return cachedIcons.computeIfAbsent(key) {
val context = displayWindowProperties.context
iconManager.createSbIconView(context, entry)
@@ -93,4 +101,8 @@ constructor(
interface Factory {
fun create(displayId: Int): ConnectedDisplaysStatusBarNotificationIconViewStore
}
+
+ companion object {
+ private const val TAG = "ConnectedDisplaysNotifIconViewStore"
+ }
}