Set an action name for wallpaer index am: 0f7b80f47f am: b0f9134441

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19394202

Change-Id: Idfbf2786117d7e264b1da6f1101da99db23b76c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Tsung-Mao Fang
2022-07-27 03:22:00 +00:00
committed by Automerger Merge Worker
3 changed files with 14 additions and 1 deletions

View File

@@ -49,6 +49,10 @@
<string name="config_wallpaper_picker_class" translatable="false">com.android.settings.Settings$WallpaperSettingsActivity</string> <string name="config_wallpaper_picker_class" translatable="false">com.android.settings.Settings$WallpaperSettingsActivity</string>
<!-- Fully-qualified class name for the styles & wallpaper picker activity. --> <!-- Fully-qualified class name for the styles & wallpaper picker activity. -->
<string name="config_styles_and_wallpaper_picker_class" translatable="false"></string> <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. --> <!-- Intent extra for wallpaper picker activity. -->
<string name="config_wallpaper_picker_launch_extra" translatable="false">com.android.wallpaper.LAUNCH_SOURCE</string> <string name="config_wallpaper_picker_launch_extra" translatable="false">com.android.wallpaper.LAUNCH_SOURCE</string>

View File

@@ -41,6 +41,8 @@ public class WallpaperPreferenceController extends BasePreferenceController {
private final String mWallpaperPackage; private final String mWallpaperPackage;
private final String mWallpaperClass; private final String mWallpaperClass;
private final String mStylesAndWallpaperClass; private final String mStylesAndWallpaperClass;
private final String mWallpaperActionName;
private final String mStylesAndWallpaperActionName;
private final String mWallpaperLaunchExtra; private final String mWallpaperLaunchExtra;
public WallpaperPreferenceController(Context context, String key) { public WallpaperPreferenceController(Context context, String key) {
@@ -49,6 +51,9 @@ public class WallpaperPreferenceController extends BasePreferenceController {
mWallpaperClass = mContext.getString(R.string.config_wallpaper_picker_class); mWallpaperClass = mContext.getString(R.string.config_wallpaper_picker_class);
mStylesAndWallpaperClass = mStylesAndWallpaperClass =
mContext.getString(R.string.config_styles_and_wallpaper_picker_class); 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); mWallpaperLaunchExtra = mContext.getString(R.string.config_wallpaper_picker_launch_extra);
} }
@@ -72,6 +77,10 @@ public class WallpaperPreferenceController extends BasePreferenceController {
return areStylesAvailable() ? mStylesAndWallpaperClass : mWallpaperClass; return areStylesAvailable() ? mStylesAndWallpaperClass : mWallpaperClass;
} }
public String getComponentActionName() {
return areStylesAvailable() ? mStylesAndWallpaperActionName : mWallpaperActionName;
}
public String getKeywords() { public String getKeywords() {
StringBuilder sb = new StringBuilder(mContext.getString(R.string.keywords_wallpaper)); StringBuilder sb = new StringBuilder(mContext.getString(R.string.keywords_wallpaper));
if (areStylesAvailable()) { if (areStylesAvailable()) {

View File

@@ -84,7 +84,7 @@ public class WallpaperSuggestionActivity extends StyleSuggestionActivityBase imp
ComponentName component = controller.getComponentName(); ComponentName component = controller.getComponentName();
data.intentTargetPackage = component.getPackageName(); data.intentTargetPackage = component.getPackageName();
data.intentTargetClass = component.getClassName(); data.intentTargetClass = component.getClassName();
data.intentAction = Intent.ACTION_MAIN; data.intentAction = controller.getComponentActionName();
data.key = SUPPORT_SEARCH_INDEX_KEY; data.key = SUPPORT_SEARCH_INDEX_KEY;
data.keywords = controller.getKeywords(); data.keywords = controller.getKeywords();
result.add(data); result.add(data);