diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-17 21:06:17 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-17 21:06:17 +0000 |
commit | 638902bd1aa5ff2e271817225881f7bd74c05f58 (patch) | |
tree | e312304a4a955e1835e1faa3a8590a86524178be | |
parent | f5edf5a698561402261d7f1a254a6de05d758514 (diff) | |
parent | a1cf3f50aa1b2237a731733805604f05d4548942 (diff) | |
download | Media-android12L-platform-release.tar.gz |
Snap for 8589293 from a1cf3f50aa1b2237a731733805604f05d4548942 to sc-v2-platform-releaseandroid-platform-12.1.0_r9android-platform-12.1.0_r8android-platform-12.1.0_r7android-platform-12.1.0_r6android-platform-12.1.0_r5android-platform-12.1.0_r4android-platform-12.1.0_r26android-platform-12.1.0_r25android-platform-12.1.0_r24android-platform-12.1.0_r23android-platform-12.1.0_r22android-platform-12.1.0_r21android-platform-12.1.0_r20android-platform-12.1.0_r19android-platform-12.1.0_r18android-platform-12.1.0_r17android-platform-12.1.0_r16android-platform-12.1.0_r15android-platform-12.1.0_r14android-platform-12.1.0_r13android-platform-12.1.0_r12android-platform-12.1.0_r11android-platform-12.1.0_r10android12L-platform-release
Change-Id: I69a360f2c13a21e24afced42cb21e0214d100f6d
-rw-r--r-- | src/com/android/car/media/MediaActivity.java | 4 | ||||
-rw-r--r-- | src/com/android/car/media/MediaActivityController.java | 9 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/com/android/car/media/MediaActivity.java b/src/com/android/car/media/MediaActivity.java index b437a1a..591285a 100644 --- a/src/com/android/car/media/MediaActivity.java +++ b/src/com/android/car/media/MediaActivity.java @@ -426,10 +426,6 @@ public class MediaActivity extends FragmentActivity implements MediaActivityCont break; case BROWSING: if (oldMode == Mode.PLAYBACK) { - // When switching from PLAYBACK mode to BROWSING mode, if a CarUiRecyclerView - // shows up and it's in rotary mode, restore focus in the CarUiRecyclerView. - mMediaActivityController.restoreFocusInCurrentNode(); - ViewUtils.hideViewAnimated(mErrorContainer, 0); ViewUtils.showViewAnimated(mBrowseContainer, 0); animateOutPlaybackContainer(fadeOutDuration); diff --git a/src/com/android/car/media/MediaActivityController.java b/src/com/android/car/media/MediaActivityController.java index a29b40d..9882e70 100644 --- a/src/com/android/car/media/MediaActivityController.java +++ b/src/com/android/car/media/MediaActivityController.java @@ -406,6 +406,7 @@ public class MediaActivityController extends ViewControllerBase { updateAppBar(); } + @NonNull private BrowseViewController getControllerForItem(@NonNull MediaItemMetadata item) { BrowseViewController controller = mBrowseViewControllersByNode.get(item); if (controller == null) { @@ -438,15 +439,15 @@ public class MediaActivityController extends ViewControllerBase { } // If the current node has a CarUiRecyclerView and it's in rotary mode, restore focus in it. - void restoreFocusInCurrentNode() { + // Should remain private and definitely NOT be called from MediaActivity#changeModeInternal + // as the controller isn't ready to show the browse data of the new media source (it hasn't + // connected to it (b/217159531). + private void restoreFocusInCurrentNode() { MediaItemMetadata currentNode = getCurrentMediaItem(); if (currentNode == null) { return; } BrowseViewController controller = getControllerForItem(currentNode); - if (controller == null) { - return; - } CarUiRecyclerView carUiRecyclerView = controller.getContent().findViewById(R.id.browse_list); if (carUiRecyclerView != null && carUiRecyclerView instanceof LazyLayoutView |