Merge cherrypicks of ['googleplex-android-review.googlesource.com/23816690'] into udc-release.
Change-Id: If946563d0e03bf63fbb94b0f1a91731c5cb42a63
diff --git a/src/com/android/wallpaper/picker/customization/ui/binder/ScreenPreviewBinder.kt b/src/com/android/wallpaper/picker/customization/ui/binder/ScreenPreviewBinder.kt
index 81f6168..7dffa03 100644
--- a/src/com/android/wallpaper/picker/customization/ui/binder/ScreenPreviewBinder.kt
+++ b/src/com/android/wallpaper/picker/customization/ui/binder/ScreenPreviewBinder.kt
@@ -86,8 +86,17 @@
val workspaceSurface: SurfaceView = previewView.requireViewById(R.id.workspace_surface)
val wallpaperSurface: SurfaceView = previewView.requireViewById(R.id.wallpaper_surface)
val thumbnailRequested = AtomicBoolean(false)
- previewView.contentDescription =
+
+ val fixedWidthDisplayFrameLayout = previewView.parent as? View
+ val screenPreviewClickView = fixedWidthDisplayFrameLayout?.parent as? View
+ // Set the content description on the parent view
+ screenPreviewClickView?.contentDescription =
activity.resources.getString(viewModel.previewContentDescription)
+ fixedWidthDisplayFrameLayout?.importantForAccessibility =
+ View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
+
+ // This ensures that we do not announce the time multiple times
+ previewView.importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
val surfaceViewsReady = {
wallpaperSurface.setBackgroundColor(Color.TRANSPARENT)
workspaceSurface.visibility = View.VISIBLE