Change exception to log

This can occur in usage, so avoid crashing SystemUI when it happens.
Relevant tests are already marked `@Ignore` and will be addressed in a
follow-up change.

Bug: 257573640
Test: atest SystemUITests, does not crash on MediaCarouselController
Change-Id: I629157708f31c438613de40796ee891730e36c01
This commit is contained in:
Beth Thibodeau
2022-11-07 16:54:56 -06:00
parent 28ba402dea
commit 512f8bf33e

View File

@@ -610,7 +610,8 @@ constructor(
// are
// elements in mediaPlayers.
if (MediaPlayerData.players().size != mediaContent.childCount) {
throw IllegalStateException(
Log.e(
TAG,
"Size of players list and number of views in carousel are out of sync. " +
"Players size is ${MediaPlayerData.players().size}. " +
"View count is ${mediaContent.childCount}."
@@ -671,7 +672,8 @@ constructor(
// are
// elements in mediaPlayers.
if (MediaPlayerData.players().size != mediaContent.childCount) {
throw IllegalStateException(
Log.e(
TAG,
"Size of players list and number of views in carousel are out of sync. " +
"Players size is ${MediaPlayerData.players().size}. " +
"View count is ${mediaContent.childCount}."