[3/n] Move new picker logic to AOSP

HubFragment shows below sections for ThemePicker build.

- Wallpaper
- Dark/Light theme
- Themed icon
- Grid

Bug: 190354625
Test: Build and run the app
Change-Id: I5ab205f7f4dbf5838c39ca0eca4808cad3c86fa1
diff --git a/src/com/android/customization/module/DefaultCustomizationInjector.java b/src/com/android/customization/module/DefaultCustomizationInjector.java
index 3b23617..969f22f 100644
--- a/src/com/android/customization/module/DefaultCustomizationInjector.java
+++ b/src/com/android/customization/module/DefaultCustomizationInjector.java
@@ -33,6 +33,7 @@
 import com.android.wallpaper.model.WallpaperInfo;
 import com.android.wallpaper.module.BaseWallpaperInjector;
 import com.android.wallpaper.module.DefaultCategoryProvider;
+import com.android.wallpaper.module.HubSections;
 import com.android.wallpaper.module.LoggingOptInStatusProvider;
 import com.android.wallpaper.module.WallpaperPreferences;
 import com.android.wallpaper.module.WallpaperRotationRefresher;
@@ -46,6 +47,7 @@
     private WallpaperRotationRefresher mWallpaperRotationRefresher;
     private PerformanceMonitor mPerformanceMonitor;
     private WallpaperPreferences mPrefs;
+    private HubSections mHubSections;
 
     @Override
     public synchronized WallpaperPreferences getPreferences(Context context) {
@@ -139,4 +141,11 @@
         return new ThemeManager(provider, activity, overlayManagerCompat, logger);
     }
 
+    @Override
+    public HubSections getHubSections() {
+        if (mHubSections == null) {
+            mHubSections = new DefaultCustomizationSections();
+        }
+        return mHubSections;
+    }
 }
diff --git a/src/com/android/customization/module/DefaultCustomizationSections.java b/src/com/android/customization/module/DefaultCustomizationSections.java
new file mode 100644
index 0000000..d35d198
--- /dev/null
+++ b/src/com/android/customization/module/DefaultCustomizationSections.java
@@ -0,0 +1,60 @@
+package com.android.customization.module;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.lifecycle.LifecycleOwner;
+
+import com.android.customization.model.grid.GridOptionsManager;
+import com.android.customization.model.grid.GridSectionController;
+import com.android.customization.model.mode.ModeSection;
+import com.android.customization.model.themedicon.ThemedIconSectionController;
+import com.android.customization.model.themedicon.ThemedIconSwitchProvider;
+import com.android.customization.model.themedicon.ThemedIconUtils;
+import com.android.wallpaper.R;
+import com.android.wallpaper.model.HubSectionController;
+import com.android.wallpaper.model.PermissionRequester;
+import com.android.wallpaper.model.WallpaperColorsViewModel;
+import com.android.wallpaper.model.WallpaperPreviewNavigator;
+import com.android.wallpaper.model.WallpaperSectionController;
+import com.android.wallpaper.model.WorkspaceViewModel;
+import com.android.wallpaper.module.HubSections;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/** {@link HubSections} for the customization picker. */
+public final class DefaultCustomizationSections implements HubSections {
+
+    @Override
+    public List<HubSectionController<?>> getAllSectionControllers(Activity activity,
+            LifecycleOwner lifecycleOwner, WallpaperColorsViewModel wallpaperColorsViewModel,
+            WorkspaceViewModel workspaceViewModel, PermissionRequester permissionRequester,
+            WallpaperPreviewNavigator wallpaperPreviewNavigator,
+            HubSectionController.HubSectionNavigationController hubSectionNavigationController,
+            @Nullable Bundle savedInstanceState) {
+        List<HubSectionController<?>> sectionControllers = new ArrayList<>();
+
+        // Wallpaper section.
+        sectionControllers.add(new WallpaperSectionController(
+                activity, lifecycleOwner, permissionRequester, wallpaperColorsViewModel,
+                workspaceViewModel, hubSectionNavigationController, wallpaperPreviewNavigator,
+                savedInstanceState));
+
+        // Dark/Light theme section.
+        sectionControllers.add(new ModeSection(activity, lifecycleOwner.getLifecycle()));
+
+        // Themed app icon section.
+        sectionControllers.add(new ThemedIconSectionController(
+                new ThemedIconSwitchProvider(activity, new ThemedIconUtils(activity,
+                        activity.getString(R.string.themed_icon_metadata_key))),
+                workspaceViewModel));
+
+        // App grid section.
+        sectionControllers.add(new GridSectionController(
+                GridOptionsManager.get(activity), hubSectionNavigationController));
+
+        return sectionControllers;
+    }
+}