[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

@@ -239,13 +239,15 @@ public class SettingsHomepageActivity extends FragmentActivity implements
targetComponentName,
targetIntent.getAction(),
true /* finishPrimaryWithSecondary */,
true /* finishSecondaryWithPrimary */);
true /* finishSecondaryWithPrimary */,
true /* clearTop*/);
ActivityEmbeddingRulesController.registerTwoPanePairRule(this,
new ComponentName(Settings.class.getPackageName(), Settings.class.getName()),
targetComponentName,
targetIntent.getAction(),
true /* finishPrimaryWithSecondary */,
true /* finishSecondaryWithPrimary */);
true /* finishSecondaryWithPrimary */,
true /* clearTop*/);
startActivity(targetIntent);
}