diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-19 04:40:05 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-19 04:40:05 +0000 |
commit | f0b789dae4a5da7336b850cb8cf022ac27f78d52 (patch) | |
tree | e312304a4a955e1835e1faa3a8590a86524178be | |
parent | ca7b382ead95e6710ed42412f0af49be6125bcf9 (diff) | |
parent | 8666e534a0b568d6647a7f5c518975213519628a (diff) | |
download | Media-gki13-boot-release.tar.gz |
Snap for 8743232 from 8666e534a0b568d6647a7f5c518975213519628a to gki13-boot-releasegki13-boot-release
Change-Id: I85132a1845e4c354c1e2313257c07ab20ee7b83e
-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 |