Cleaning up tooltip for ToggleFeaturePreferenceFragment

Cleaning up QS tile tooltip in the Settings page in onDestroy to avoid
leaking the window.

Bug: 279547549
Test: manually check only one tooltip exists
Change-Id: I781cdba1be7be0315de12cd57620521b40969aee
This commit is contained in:
Candice Lo
2023-05-16 06:27:44 +00:00
parent cb92ae1096
commit 3dab6548b9

View File

@@ -296,6 +296,10 @@ public abstract class ToggleFeaturePreferenceFragment extends DashboardFragment
public void onDestroyView() {
super.onDestroyView();
removeActionBarToggleSwitch();
final boolean isTooltipWindowShowing = mTooltipWindow != null && mTooltipWindow.isShowing();
if (isTooltipWindowShowing) {
mTooltipWindow.dismiss();
}
}
@Override