diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-07 03:51:54 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-06-07 03:51:54 +0000 |
commit | ec458d764cd2c4bff7a742381a879896e05c3634 (patch) | |
tree | e312304a4a955e1835e1faa3a8590a86524178be | |
parent | d1b2c1234ae242a899f0433b02358f775a4079e2 (diff) | |
parent | 638902bd1aa5ff2e271817225881f7bd74c05f58 (diff) | |
download | Media-android12L-gsi.tar.gz |
Snap for 8589293 from a1cf3f50aa1b2237a731733805604f05d4548942 to sc-v2-platform-release am: 638902bd1aandroid12L-gsi
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Car/Media/+/18436241
Change-Id: I07e7ad903b9710a28e6f83c669056a8b9ca791fe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-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 |