Merge changes I75d810e4,I50111f0c into udc-qpr-dev

* changes:
  Doing null check before generating Extra Dim tooltip
  Doing null check before generating Font Size tooltip
This commit is contained in:
Candice Lo
2023-06-21 00:51:48 +00:00
committed by Android (Google) Code Review
2 changed files with 24 additions and 9 deletions

View File

@@ -130,10 +130,17 @@ public abstract class AccessibilityQuickSettingsPrimarySwitchPreferenceControlle
return;
}
// TODO (287728819): Move tooltip showing to SystemUI
// Since the lifecycle of controller is independent of that of the preference, doing
// null check on switch is a temporary solution for the case that switch view
// is not ready when we would like to show the tooltip. If the switch is not ready,
// we give up showing the tooltip and also do not reshow it in the future.
if (mPreference.getSwitch() != null) {
mTooltipWindow = new AccessibilityQuickSettingsTooltipWindow(mContext);
mTooltipWindow.setup(getTileTooltipContent(),
R.drawable.accessibility_auto_added_qs_tooltip_illustration);
mTooltipWindow.showAtTopCenter(mPreference.getSwitch());
}
AccessibilityQuickSettingUtils.optInValueToSharedPreferences(mContext, tileComponentName);
mNeedsQSTooltipReshow = false;
}

View File

@@ -213,11 +213,19 @@ abstract class PreviewSizeSeekBarController extends BasePreferenceController imp
return;
}
// TODO (287728819): Move tooltip showing to SystemUI
// Since the lifecycle of controller is independent of that of the preference, doing
// null check on seekbar is a temporary solution for the case that seekbar view
// is not ready when we would like to show the tooltip. If the seekbar is not ready,
// we give up showing the tooltip and also do not reshow it in the future.
if (mSeekBarPreference.getSeekbar() != null) {
mTooltipWindow = new AccessibilityQuickSettingsTooltipWindow(mContext);
mTooltipWindow.setup(getTileTooltipContent(),
R.drawable.accessibility_auto_added_qs_tooltip_illustration);
mTooltipWindow.showAtTopCenter(mSeekBarPreference.getSeekbar());
AccessibilityQuickSettingUtils.optInValueToSharedPreferences(mContext, tileComponentName);
}
AccessibilityQuickSettingUtils.optInValueToSharedPreferences(mContext,
tileComponentName);
mNeedsQSTooltipReshow = false;
}