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

Commit 68fa7462 authored by Tsung-Mao Fang's avatar Tsung-Mao Fang Committed by Automerger Merge Worker
Browse files

Set an action name for wallpaer index am: 0f7b80f4

parents 8fc819f8 0f7b80f4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -49,6 +49,10 @@
    <string name="config_wallpaper_picker_class" translatable="false">com.android.settings.Settings$WallpaperSettingsActivity</string>
    <!-- Fully-qualified class name for the styles & wallpaper picker activity. -->
    <string name="config_styles_and_wallpaper_picker_class" translatable="false"></string>
    <!-- Action name for the wallpaper picker activity. -->
    <string name="config_wallpaper_picker_action" translatable="false"></string>
    <!-- Action name for the styles & wallpaper picker activity. -->
    <string name="config_styles_and_wallpaper_picker_action" translatable="false"></string>
    <!-- Intent extra for wallpaper picker activity. -->
    <string name="config_wallpaper_picker_launch_extra" translatable="false">com.android.wallpaper.LAUNCH_SOURCE</string>

+9 −0
Original line number Diff line number Diff line
@@ -41,6 +41,8 @@ public class WallpaperPreferenceController extends BasePreferenceController {
    private final String mWallpaperPackage;
    private final String mWallpaperClass;
    private final String mStylesAndWallpaperClass;
    private final String mWallpaperActionName;
    private final String mStylesAndWallpaperActionName;
    private final String mWallpaperLaunchExtra;

    public WallpaperPreferenceController(Context context, String key) {
@@ -49,6 +51,9 @@ public class WallpaperPreferenceController extends BasePreferenceController {
        mWallpaperClass = mContext.getString(R.string.config_wallpaper_picker_class);
        mStylesAndWallpaperClass =
                mContext.getString(R.string.config_styles_and_wallpaper_picker_class);
        mWallpaperActionName = mContext.getString(R.string.config_wallpaper_picker_action);
        mStylesAndWallpaperActionName =
                mContext.getString(R.string.config_styles_and_wallpaper_picker_action);
        mWallpaperLaunchExtra = mContext.getString(R.string.config_wallpaper_picker_launch_extra);
    }

@@ -72,6 +77,10 @@ public class WallpaperPreferenceController extends BasePreferenceController {
        return areStylesAvailable() ? mStylesAndWallpaperClass : mWallpaperClass;
    }

    public String getComponentActionName() {
        return areStylesAvailable() ? mStylesAndWallpaperActionName : mWallpaperActionName;
    }

    public String getKeywords() {
        StringBuilder sb = new StringBuilder(mContext.getString(R.string.keywords_wallpaper));
        if (areStylesAvailable()) {
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ public class WallpaperSuggestionActivity extends StyleSuggestionActivityBase imp
                    ComponentName component = controller.getComponentName();
                    data.intentTargetPackage = component.getPackageName();
                    data.intentTargetClass = component.getClassName();
                    data.intentAction = Intent.ACTION_MAIN;
                    data.intentAction = controller.getComponentActionName();
                    data.key = SUPPORT_SEARCH_INDEX_KEY;
                    data.keywords = controller.getKeywords();
                    result.add(data);