[a11y] Fix TalkBack readback on adb qrcode fragment.

TalkBack was picking up the text in the action bar, so if we hide it,
it will read the first body of text it encounters which would be "Scan
QR code. Pair device over Wi-Fi by scanning a QR code."

Bug: 152461605

Test: Manual. Enable TalkBack in Settings > Accessibility > TalkBack.
Navigate to Developer options > Wireless debugging > Pair by QR code.
When QR code scanner fragment opens, it should say "Scan QR code. Pair
device over Wi-Fi by scanning a QR code."

Change-Id: Ia91bf4ea215e6a377335f2b9dcf2acf10afd268e
This commit is contained in:
Joshua Duong
2020-04-01 00:07:11 -07:00
parent 6162b0c37d
commit bfd73c0d78

View File

@@ -207,6 +207,15 @@ public class AdbQrcodeScannerFragment extends WifiDppQrCodeBaseFragment implemen
super.onAttach(context);
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
getActivity().getActionBar().hide();
// setTitle for TalkBack
getActivity().setTitle(R.string.wifi_dpp_scan_qr_code);
}
@Override
public int getMetricsCategory() {
return 0;