Fix no show quick settings tutorial after device rotates

Root cause: Render apps below the cutout area to make the fragment recreate multiple times when the device rotates. The tutorial status is not stored correctly and try to show the tutorial when activity is finishing.
Solution: Avoid showing the tutorial when the activity is finishing and store correct tutorial status after recreate.

Bug: 239578655
Test: Manual testing
Change-Id: I3ff12e23eb971f61280ebc89014b086dc348d734
This commit is contained in:
menghanli
2022-08-19 11:08:13 +08:00
parent 5171a38fe2
commit 057c5dc8ed
4 changed files with 33 additions and 14 deletions

View File

@@ -153,12 +153,10 @@ public class AccessibilityQuickSettingsPrimarySwitchPreferenceControllerTest {
@Test
@Config(shadows = ShadowFragment.class)
public void restoreValueFromSavedInstanceState_showTooltipView() {
mController.displayPreference(mScreen);
mController.setChecked(true);
final Bundle savedInstanceState = new Bundle();
savedInstanceState.putBoolean(KEY_SAVED_QS_TOOLTIP_RESHOW, /* value= */ true);
mController.onCreate(savedInstanceState);
mFragment.onCreate(savedInstanceState);
mController.displayPreference(mScreen);
assertThat(getLatestPopupWindow().isShowing()).isTrue();