Improve Settings launch performance for normal phones

1. Initialize ActivitEmbedding component only if necessary
2. Early return to avoid executing long execution time operations
  ex: initialize ActivityEmbedding component, feature flag operations

Test: manual - launch settings and profile
Test: run
v2/android-crystalball-eng/health/microbench/startup/firstparty/open-settings
on affacted devices
Test: atest SettingsHomepageActivityTest TopLevelWallpaperPreferenceControllerTest DashboardFeatureProviderImplTest TopLevelSettingsTest TopLevelWallpaperPreferenceControllerTest SearchResultTrampolineTest
Test: atest CtsSettingsTestCases
Fixes: 281505190

Change-Id: I0c1a1dc50f26c4ded02de82190dd7aad59c20c01
This commit is contained in:
Charles Chen
2023-05-10 17:07:15 +08:00
parent 90b344e760
commit 8524048094
3 changed files with 29 additions and 23 deletions

View File

@@ -51,8 +51,9 @@ public class SettingsApplication extends Application {
// Set Spa environment.
setSpaEnvironment();
if (FeatureFlagUtils.isEnabled(this, FeatureFlagUtils.SETTINGS_SUPPORT_LARGE_SCREEN)
&& ActivityEmbeddingUtils.isSettingsSplitEnabled(this)) {
if (ActivityEmbeddingUtils.isSettingsSplitEnabled(this)
&& FeatureFlagUtils.isEnabled(this,
FeatureFlagUtils.SETTINGS_SUPPORT_LARGE_SCREEN)) {
if (WizardManagerHelper.isUserSetupComplete(this)) {
new ActivityEmbeddingRulesController(this).initRules();
} else {