diff --git a/res/layout/adb_qrcode_scanner_fragment.xml b/res/layout/adb_qrcode_scanner_fragment.xml index 975256d18aa..f37c9a6ff4c 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"/> + android:text="@string/adb_wireless_verifying_qrcode_text" + android:accessibilityLiveRegion="polite"/> diff --git a/src/com/android/settings/development/AdbQrcodeScannerFragment.java b/src/com/android/settings/development/AdbQrcodeScannerFragment.java index 066cf156030..d4c079744a0 100644 --- a/src/com/android/settings/development/AdbQrcodeScannerFragment.java +++ b/src/com/android/settings/development/AdbQrcodeScannerFragment.java @@ -73,6 +73,7 @@ public class AdbQrcodeScannerFragment extends WifiDppQrCodeBaseFragment implemen 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 @@ public class AdbQrcodeScannerFragment extends WifiDppQrCodeBaseFragment implemen 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); @@ -264,6 +266,8 @@ public class AdbQrcodeScannerFragment extends WifiDppQrCodeBaseFragment implemen 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 fb63e0a5384..65577874e20 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 class AdbQrCode extends WifiQrCode { 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); + } }