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

Commit add734d0 authored by Julia Tuttle's avatar Julia Tuttle
Browse files

Catch null handler in PlayerViewHolder.marquee.

We're seeing crashes here; turn them into debug log messages while we
find and fix the underlying issue.

Bug: 209488789
Test: just adding logging
Change-Id: Ib138e9a6ac3cb3f55a41fd15dd7f6855a5b97f47
parent 9975e2c4
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.media

import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@@ -26,6 +27,8 @@ import android.widget.TextView
import com.android.systemui.R
import com.android.systemui.util.animation.TransitionLayout

private const val TAG = "PlayerViewHolder"

/**
 * ViewHolder for a media player.
 */
@@ -94,7 +97,12 @@ class PlayerViewHolder private constructor(itemView: View) {
    }

    fun marquee(start: Boolean, delay: Long) {
        longPressText.getHandler().postDelayed({ longPressText.setSelected(start) }, delay)
        val longPressTextHandler = longPressText.getHandler()
        if (longPressTextHandler == null) {
            Log.d(TAG, "marquee while longPressText.getHandler() is null", Exception())
            return
        }
        longPressTextHandler.postDelayed({ longPressText.setSelected(start) }, delay)
    }

    companion object {