From 30e348b3c3fe2dc5ae072544c177db036722e5cd Mon Sep 17 00:00:00 2001 From: Doris Ling Date: Wed, 3 Aug 2016 17:26:34 -0700 Subject: [PATCH] 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 --- .../ConfirmDeviceCredentialBaseFragment.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java b/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java index b46fa92a3d8..b7352304a8a 100644 --- a/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java +++ b/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java @@ -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)); + } } }