[Large screen] Fix SplitPaitRule not match for deep link problem

- Set both secondary ComponentName and secondary Intent action
  in SplitPairFilter when registering SplitPairRule for deep link.

- Set ComponentName to the Intent which DeepLinkHomepageActivity
  uses to start the deep link page.

This change setup Intent and SplitPairRule to have both
Intent action and ComponentName. It fixes matching problem.

Bug: 201627196
Bug: 199888089
Test: manual
      [Unfolded] Long press home (workspace) -> Pop-up menu ->
      Tap 'Wallpaper & style' -> Launch Settings in the left as
      list and 'Wallpaper & style' in the right as detail.
Change-Id: I8cc8cef911ce0d7d05f332eb86f77f8d2543827f
This commit is contained in:
Arc Wang
2021-09-30 18:55:19 +08:00
parent 4f2a6225c9
commit dcc46cf136
2 changed files with 13 additions and 9 deletions

View File

@@ -67,17 +67,21 @@ public class ActivityEmbeddingRulesController {
registerTwoPanePairRule(mContext,
getComponentName(Settings.class),
getComponentName(SubSettings.class),
null /* secondaryIntentAction */,
true /* finishPrimaryWithSecondary */,
true /* finishSecondaryWithPrimary */);
}
/** Register a SplitPairRule for 2-pane. */
public static void registerTwoPanePairRule(Context context,
ComponentName primary, ComponentName secondary,
boolean finishPrimaryWithSecondary, boolean finishSecondaryWithPrimary) {
ComponentName primaryComponent,
ComponentName secondaryComponent,
String secondaryIntentAction,
boolean finishPrimaryWithSecondary,
boolean finishSecondaryWithPrimary) {
final Set<SplitPairFilter> filters = new HashSet<>();
filters.add(new SplitPairFilter(primary, secondary,
null /* secondaryActivityIntentAction */));
filters.add(new SplitPairFilter(primaryComponent, secondaryComponent,
secondaryIntentAction));
SplitController.getInstance().registerRule(new SplitPairRule(filters,
finishPrimaryWithSecondary,