Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2007bffd authored by Caitlin Shkuratov's avatar Caitlin Shkuratov Committed by Android (Google) Code Review
Browse files

Merge "[CD] Log why we couldn't fetch a StatusBarIconView for a given display." into main

parents 7e1dd4c7 72968422
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -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"
    }
}