diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-02-05 22:07:33 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-02-05 22:07:33 +0000 |
commit | 3bf98c54fa00af3788192a01399009c0b69dc17b (patch) | |
tree | e312304a4a955e1835e1faa3a8590a86524178be | |
parent | d6b71b5c36cd024a1ed5e79c37137973c28e0719 (diff) | |
parent | 65c41fe0fe369f088ea542f32b556ceea600da77 (diff) | |
download | Media-android12-qpr3-s5-release.tar.gz |
Snap for 8152562 from 65c41fe0fe369f088ea542f32b556ceea600da77 to sc-qpr3-releaseandroid-12.1.0_r9android-12.1.0_r8android-12.1.0_r7android-12.1.0_r22android-12.1.0_r21android-12.1.0_r20android-12.1.0_r19android-12.1.0_r11android-12.1.0_r10android12-qpr3-s7-releaseandroid12-qpr3-s6-releaseandroid12-qpr3-s5-releaseandroid12-qpr3-s4-releaseandroid12-qpr3-s3-releaseandroid12-qpr3-s2-releaseandroid12-qpr3-s1-releaseandroid12-qpr3-release
Change-Id: If70e446f5e70268250e3e646b43a773a2dcf4d94
-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 |