Merge "[a11y] Fix TalkBack readback on adb qrcode fragment." into rvc-dev
diff --git a/res/layout/adb_qrcode_scanner_fragment.xml b/res/layout/adb_qrcode_scanner_fragment.xml
index 975256d..f37c9a6 100644
--- a/res/layout/adb_qrcode_scanner_fragment.xml
+++ b/res/layout/adb_qrcode_scanner_fragment.xml
@@ -99,10 +99,12 @@
android:layout_height="wrap_content"/>
<TextView
+ android:id="@+id/verifying_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/adb_wireless_item_progress_text"
- android:text="@string/adb_wireless_verifying_qrcode_text"/>
+ android:text="@string/adb_wireless_verifying_qrcode_text"
+ android:accessibilityLiveRegion="polite"/>
</LinearLayout>
diff --git a/src/com/android/settings/development/AdbQrcodeScannerFragment.java b/src/com/android/settings/development/AdbQrcodeScannerFragment.java
index 0a02c95..7a30443 100644
--- a/src/com/android/settings/development/AdbQrcodeScannerFragment.java
+++ b/src/com/android/settings/development/AdbQrcodeScannerFragment.java
@@ -73,6 +73,7 @@
private QrDecorateView mDecorateView;
private View mQrCameraView;
private View mVerifyingView;
+ private TextView mVerifyingTextView;
private TextView mErrorMessage;
/** QR code data scanned by camera */
@@ -168,6 +169,7 @@
mQrCameraView = view.findViewById(R.id.camera_layout);
mVerifyingView = view.findViewById(R.id.verifying_layout);
+ mVerifyingTextView = view.findViewById(R.id.verifying_textview);
setHeaderTitle(R.string.wifi_dpp_scan_qr_code);
mSummary.setText(R.string.adb_wireless_qrcode_pairing_description);
@@ -273,6 +275,8 @@
mDecorateView.setFocused(true);
mQrCameraView.setVisibility(View.GONE);
mVerifyingView.setVisibility(View.VISIBLE);
+ AdbQrCode.triggerVibrationForQrCodeRecognition(getContext());
+ mVerifyingTextView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
try {
mAdbManager.enablePairingByQrCode(mAdbConfig.getSsid(),
mAdbConfig.getPreSharedKey());
diff --git a/src/com/android/settings/wifi/dpp/AdbQrCode.java b/src/com/android/settings/wifi/dpp/AdbQrCode.java
index fb63e0a..6557787 100644
--- a/src/com/android/settings/wifi/dpp/AdbQrCode.java
+++ b/src/com/android/settings/wifi/dpp/AdbQrCode.java
@@ -15,6 +15,7 @@
*/
package com.android.settings.wifi.dpp;
+import android.content.Context;
import android.text.TextUtils;
/**
@@ -53,4 +54,13 @@
public WifiNetworkConfig getAdbNetworkConfig() {
return mAdbConfig;
}
+
+ /**
+ * Triggers a vibration to notify of a valid QR code.
+ *
+ * @param context The context to use
+ */
+ public static void triggerVibrationForQrCodeRecognition(Context context) {
+ WifiDppUtils.triggerVibrationForQrCodeRecognition(context);
+ }
}