Merge "[Activity embedding] Fix unexpected finished 2nd layer problem"

This commit is contained in:
Arc Wang
2022-10-31 05:50:14 +00:00
committed by Android (Google) Code Review
2 changed files with 31 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.Toolbar;
import androidx.annotation.VisibleForTesting;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowCompat;
@@ -223,10 +224,23 @@ public class SettingsHomepageActivity extends FragmentActivity implements
if (shouldLaunchDeepLinkIntentToRight()) {
launchDeepLinkIntentToRight();
}
// Settings app may be launched on an existing task. Reset SplitPairRule of SubSettings here
// to prevent SplitPairRule of an existing task applied on a new started Settings app.
if (ActivityEmbeddingUtils.isEmbeddingActivityEnabled(this)
&& (getIntent().getFlags() & Intent.FLAG_ACTIVITY_CLEAR_TOP) != 0) {
initSplitPairRules();
}
updateHomepagePaddings();
updateSplitLayout();
}
@VisibleForTesting
void initSplitPairRules() {
new ActivityEmbeddingRulesController(getApplicationContext()).initRules();
}
@Override
protected void onStart() {
((SettingsApplication) getApplication()).setHomeActivity(this);