summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChihhang Chuang <chihhangchuang@google.com>2021-06-14 13:48:57 +0800
committerChihhang Chuang <chihhangchuang@google.com>2021-06-15 01:40:18 +0800
commiteecf85e1eba012f6224ad7d47be3880f14d5204a (patch)
tree17918236f09a81a2e62122cca33a090c196721e6 /src
parentc44abebfe45d55d7c2635aa7bd469d8bc3e42f07 (diff)
downloadThemePicker-eecf85e1eba012f6224ad7d47be3880f14d5204a.tar.gz
[4/4] Move new picker logic to AOSP
- Remove activity overriden for CustomizationPickerActivity, and use the activity in WallpaperPicker2. Bug: 190354625 Test: Build and run the app Change-Id: I080737f0ec30a6090b1180eba98b3aa8087f50a1 Merged-In: I080737f0ec30a6090b1180eba98b3aa8087f50a1
Diffstat (limited to 'src')
-rw-r--r--src/com/android/customization/module/DefaultCustomizationInjector.java6
-rw-r--r--src/com/android/customization/picker/CustomizationFragmentHost.java30
-rw-r--r--src/com/android/customization/picker/grid/GridFragment.java2
-rw-r--r--src/com/android/customization/util/LaunchUtils.java31
4 files changed, 4 insertions, 65 deletions
diff --git a/src/com/android/customization/module/DefaultCustomizationInjector.java b/src/com/android/customization/module/DefaultCustomizationInjector.java
index 969f22fb..5b5c11ef 100644
--- a/src/com/android/customization/module/DefaultCustomizationInjector.java
+++ b/src/com/android/customization/module/DefaultCustomizationInjector.java
@@ -15,8 +15,8 @@
*/
package com.android.customization.module;
-import static com.android.customization.picker.CustomizationPickerActivity.WALLPAPER_FLAVOR_EXTRA;
-import static com.android.customization.picker.CustomizationPickerActivity.WALLPAPER_FOCUS;
+import static com.android.wallpaper.picker.CustomizationPickerActivity.WALLPAPER_FLAVOR_EXTRA;
+import static com.android.wallpaper.picker.CustomizationPickerActivity.WALLPAPER_FOCUS;
import android.content.Context;
import android.content.Intent;
@@ -28,7 +28,6 @@ import androidx.fragment.app.FragmentActivity;
import com.android.customization.model.theme.OverlayManagerCompat;
import com.android.customization.model.theme.ThemeBundleProvider;
import com.android.customization.model.theme.ThemeManager;
-import com.android.customization.picker.CustomizationPickerActivity;
import com.android.wallpaper.model.CategoryProvider;
import com.android.wallpaper.model.WallpaperInfo;
import com.android.wallpaper.module.BaseWallpaperInjector;
@@ -38,6 +37,7 @@ import com.android.wallpaper.module.LoggingOptInStatusProvider;
import com.android.wallpaper.module.WallpaperPreferences;
import com.android.wallpaper.module.WallpaperRotationRefresher;
import com.android.wallpaper.monitor.PerformanceMonitor;
+import com.android.wallpaper.picker.CustomizationPickerActivity;
import com.android.wallpaper.picker.PreviewFragment;
public class DefaultCustomizationInjector extends BaseWallpaperInjector
diff --git a/src/com/android/customization/picker/CustomizationFragmentHost.java b/src/com/android/customization/picker/CustomizationFragmentHost.java
deleted file mode 100644
index d700ec60..00000000
--- a/src/com/android/customization/picker/CustomizationFragmentHost.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.customization.picker;
-
-import com.android.customization.model.CustomizationManager;
-
-/**
- * Interface to be implemented by an Activity hosting any Customization Fragment
- */
-public interface CustomizationFragmentHost {
-
- /**
- * Gets the CustomizationManager manager for the given section
- * @return the {@link CustomizationManager}
- */
- CustomizationManager<?> getCustomizationManager(int sectionId);
-}
diff --git a/src/com/android/customization/picker/grid/GridFragment.java b/src/com/android/customization/picker/grid/GridFragment.java
index 2aeb3487..8bddc221 100644
--- a/src/com/android/customization/picker/grid/GridFragment.java
+++ b/src/com/android/customization/picker/grid/GridFragment.java
@@ -44,7 +44,6 @@ import com.android.customization.model.grid.GridOptionsManager;
import com.android.customization.module.ThemesUserEventLogger;
import com.android.customization.picker.ViewOnlyFullPreviewActivity;
import com.android.customization.picker.WallpaperPreviewer;
-import com.android.customization.util.LaunchUtils;
import com.android.customization.widget.OptionSelectorController;
import com.android.customization.widget.OptionSelectorController.CheckmarkStyle;
import com.android.wallpaper.R;
@@ -52,6 +51,7 @@ import com.android.wallpaper.model.WallpaperInfo;
import com.android.wallpaper.module.CurrentWallpaperInfoFactory;
import com.android.wallpaper.module.InjectorProvider;
import com.android.wallpaper.picker.AppbarFragment;
+import com.android.wallpaper.util.LaunchUtils;
import com.android.wallpaper.widget.BottomActionBar;
import com.bumptech.glide.Glide;
diff --git a/src/com/android/customization/util/LaunchUtils.java b/src/com/android/customization/util/LaunchUtils.java
deleted file mode 100644
index 57791687..00000000
--- a/src/com/android/customization/util/LaunchUtils.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.customization.util;
-
-import android.content.Context;
-import android.content.Intent;
-
-/** Util class for launching activity. */
-public class LaunchUtils {
-
- /** Goes to Launcher's Home. */
- public static void launchHome(Context context) {
- Intent launcherIntent = new Intent(Intent.ACTION_MAIN);
- launcherIntent.addCategory(Intent.CATEGORY_HOME);
- launcherIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
- context.startActivity(launcherIntent);
- }
-}