From 4af8bbdf2701076d5c2d4cf9559b13180d39b5f0 Mon Sep 17 00:00:00 2001 From: Prince Date: Mon, 15 Jul 2024 19:54:59 +0000 Subject: Updated widgetAccessibilityDelegate in communal view model to perform Accessibility Action Test: Device Tested Flag: NONE Accessibility changes Fixes: 346919444 347128368 Change-Id: I6194474797edff89feb9a7b91f6960cefd2323eb --- .../systemui/communal/ui/viewmodel/CommunalViewModel.kt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalViewModel.kt b/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalViewModel.kt index 780bf70f3f7b..836c4c0b5353 100644 --- a/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalViewModel.kt @@ -17,6 +17,7 @@ package com.android.systemui.communal.ui.viewmodel import android.content.res.Resources +import android.os.Bundle import android.view.View import android.view.accessibility.AccessibilityNodeInfo import com.android.systemui.communal.domain.interactor.CommunalInteractor @@ -209,6 +210,20 @@ constructor( ) ) } + + override fun performAccessibilityAction( + host: View, + action: Int, + args: Bundle? + ): Boolean { + when (action) { + AccessibilityNodeInfo.AccessibilityAction.ACTION_LONG_CLICK.id -> { + onOpenWidgetEditor() + return true + } + } + return super.performAccessibilityAction(host, action, args) + } } private val _isEnableWidgetDialogShowing: MutableStateFlow = MutableStateFlow(false) -- cgit v1.2.3-59-g8ed1b