Merge "Fix abnormal behavior on search page" into sc-v2-dev

This commit is contained in:
TreeHugger Robot
2021-11-23 09:38:20 +00:00
committed by Android (Google) Code Review
2 changed files with 64 additions and 17 deletions

View File

@@ -99,20 +99,26 @@ public class ActivityEmbeddingRulesController {
/**
* Register a new SplitPairRule for Settings home. Because homepage is able to be opened by
* {@link Settings} or {@link SettingsHomepageActivity}, we register split rule twice for
* two cases.
* {@link Settings} or {@link SettingsHomepageActivity} or
* {@link SliceDeepLinkHomepageActivity}, we register split rule for above cases.
*/
public static void registerTwoPanePairRuleForSettingsHome(Context context,
ComponentName secondaryComponent,
String secondaryIntentAction,
boolean finishPrimaryWithSecondary,
boolean finishSecondaryWithPrimary,
boolean clearTop) {
if (!ActivityEmbeddingUtils.isEmbeddingActivityEnabled(context)) {
return;
}
registerTwoPanePairRule(
context,
getComponentName(context, Settings.class),
secondaryComponent,
secondaryIntentAction,
true /* finishPrimaryWithSecondary */,
true /* finishSecondaryWithPrimary */,
finishPrimaryWithSecondary,
finishSecondaryWithPrimary,
clearTop);
registerTwoPanePairRule(
@@ -120,8 +126,8 @@ public class ActivityEmbeddingRulesController {
new ComponentName(context, DeepLinkHomepageActivity.class),
secondaryComponent,
secondaryIntentAction,
true /* finishPrimaryWithSecondary */,
true /* finishSecondaryWithPrimary */,
finishPrimaryWithSecondary,
finishSecondaryWithPrimary,
clearTop);
registerTwoPanePairRule(
@@ -129,8 +135,8 @@ public class ActivityEmbeddingRulesController {
getComponentName(context, SettingsHomepageActivity.class),
secondaryComponent,
secondaryIntentAction,
true /* finishPrimaryWithSecondary */,
true /* finishSecondaryWithPrimary */,
finishPrimaryWithSecondary,
finishSecondaryWithPrimary,
clearTop);
registerTwoPanePairRule(
@@ -138,6 +144,26 @@ public class ActivityEmbeddingRulesController {
getComponentName(context, SliceDeepLinkHomepageActivity.class),
secondaryComponent,
secondaryIntentAction,
finishPrimaryWithSecondary,
finishSecondaryWithPrimary,
clearTop);
}
/**
* Register a new SplitPairRule for Settings home.
*/
public static void registerTwoPanePairRuleForSettingsHome(Context context,
ComponentName secondaryComponent,
String secondaryIntentAction,
boolean clearTop) {
if (!ActivityEmbeddingUtils.isEmbeddingActivityEnabled(context)) {
return;
}
registerTwoPanePairRuleForSettingsHome(
context,
secondaryComponent,
secondaryIntentAction,
true /* finishPrimaryWithSecondary */,
true /* finishSecondaryWithPrimary */,
clearTop);