Fix accessibility title in confirm device credential fragment.

When setting the accessibility title in confirm credential fragment, it
simply does nothing if the title is null. But for most of the confirm
fragment only have header and details, not the title. In that case,
nothing will be set. Changing it to use the supplemental text directly
if the title is null.

Change-Id: Id9fdebf04535ccc8f38a933758a7948ee2966fb4
Fixes: 30221638
This commit is contained in:
Doris Ling
2016-08-03 17:26:34 -07:00
parent 02fcbdea4e
commit 30e348b3c3

View File

@@ -164,12 +164,16 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends OptionsMenuFra
if (intent != null) {
CharSequence titleText = intent.getCharSequenceExtra(
ConfirmDeviceCredentialBaseFragment.TITLE_TEXT);
if (titleText == null || supplementalText == null) {
if (supplementalText == null) {
return;
}
String accessibilityTitle =
new StringBuilder(titleText).append(",").append(supplementalText).toString();
getActivity().setTitle(Utils.createAccessibleSequence(titleText, accessibilityTitle));
if (titleText == null) {
getActivity().setTitle(supplementalText);
} else {
String accessibilityTitle =
new StringBuilder(titleText).append(",").append(supplementalText).toString();
getActivity().setTitle(Utils.createAccessibleSequence(titleText, accessibilityTitle));
}
}
}