Add intent extra when launching WallpaperPicker from SUW and Settings

- Add extra to these intents to help WallpaperPicker log the launch
 source

Bug: 154781896
Test: make SettingsRoboTests
Change-Id: Ifb0ed22ab8ebfbb3c2ad24e9b7bad80007162b6e
This commit is contained in:
Wesley.CW Wang
2020-09-08 15:48:37 +08:00
committed by Wesley Wang
parent a6575f9bb8
commit ff0e65c7f7
5 changed files with 34 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ import android.content.Intent;
import androidx.annotation.VisibleForTesting;
import com.android.settings.R;
import com.android.settings.display.WallpaperPreferenceController;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.search.Indexable;
@@ -40,11 +41,18 @@ public class WallpaperSuggestionActivity extends StyleSuggestionActivityBase imp
private static final String WALLPAPER_FLAVOR_EXTRA = "com.android.launcher3.WALLPAPER_FLAVOR";
private static final String WALLPAPER_FOCUS = "focus_wallpaper";
private static final String WALLPAPER_ONLY = "wallpaper_only";
private static final String LAUNCHED_SUW = "app_launched_suw";
private String mWallpaperLaunchExtra;
@Override
protected void addExtras(Intent intent) {
if (WizardManagerHelper.isAnySetupWizard(intent)) {
intent.putExtra(WALLPAPER_FLAVOR_EXTRA, WALLPAPER_ONLY);
mWallpaperLaunchExtra =
getResources().getString(R.string.config_wallpaper_picker_launch_extra);
intent.putExtra(mWallpaperLaunchExtra, LAUNCHED_SUW);
} else {
intent.putExtra(WALLPAPER_FLAVOR_EXTRA, WALLPAPER_FOCUS);
}