[Large screen] Fix searched Subsettings back navigation bug

Settings app registers SubSettings SplitPairRule with clearTop
true, it will finish Settings app if users click back button on
a SubSettings page.

This change registers SubSettings SplitPairRule with clearTop
true when users click a SubSettings item in Settings home menu.

And this change registers SubSettings SplitPairRule with clearTop
false when users click a SubSettings item in search result.

Bug: 204501750
Test: manual
      1. Settings -> Search settings -> search a SubSettings item
         (e.g., Battery)
      2. Click the searched item.
      3. Click back button.
Change-Id: I6e1862de528e971137ae7087de608bbdd79096b2
This commit is contained in:
Arc Wang
2021-10-29 10:48:53 +08:00
parent 29063a7981
commit 54998b7bfe
5 changed files with 44 additions and 13 deletions

View File

@@ -180,7 +180,10 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider {
com.android.settings.Settings.class.getName()),
new ComponentName(tile.getPackageName(),
tile.getComponentName()),
null, true, true);
null /* secondaryIntentAction */,
true /* finishPrimaryWithSecondary */,
true /* finishSecondaryWithPrimary */,
true /* clearTop */);
// Highlight preference ui.
final TopLevelSettings topLevelSettings = (TopLevelSettings) fragment;