Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57373045 authored by Ching-Sung Li's avatar Ching-Sung Li Committed by Ching Sung Li
Browse files

Initialize WallpaperPicker in CustomizationPicker's creation only

Initialize WallpaperPicker section in CustomizationPickerActivity's onCreate() only

Bug: 131310001
Test: Manual
Change-Id: Iac58f689f66dbf1e2a2f1bc1ad52a84a5c8f6151
parent 0831fa8d
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@ package com.android.customization.picker;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.os.Build;
@@ -97,12 +96,15 @@ public class CustomizationPickerActivity extends FragmentActivity implements Wal
    private CategoryFragment mWallpaperCategoryFragment;
    private WallpaperSetter mWallpaperSetter;

    private boolean mWallpaperCategoryInitialized;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        Injector injector = InjectorProvider.getInjector();
        mDelegate = new WallpaperPickerDelegate(this, this, injector);
        mUserEventLogger = injector.getUserEventLogger(this);
        initSections();
        mWallpaperCategoryInitialized = false;

        // Restore this Activity's state before restoring contained Fragments state.
        super.onCreate(savedInstanceState);
@@ -413,8 +415,11 @@ public class CustomizationPickerActivity extends FragmentActivity implements Wal

        @Override
        void onVisible() {
            if (!mWallpaperCategoryInitialized) {
                mDelegate.initialize(mForceCategoryRefresh);
            }
            mWallpaperCategoryInitialized = true;
        }
    }

    private class ThemeSection extends CustomizationSection<ThemeBundle> {