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:
committed by
Wesley Wang
parent
a6575f9bb8
commit
ff0e65c7f7
@@ -211,4 +211,19 @@ public class WallpaperPreferenceControllerTest {
|
||||
.getNextStartedActivityForResult().intent.getComponent().getClassName())
|
||||
.isEqualTo(mContext.getString(R.string.config_styles_and_wallpaper_picker_class));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void handlePreferenceTreeClick_launchSourceExtra() {
|
||||
mShadowPackageManager.setResolveInfosForIntent(
|
||||
mWallpaperIntent, Lists.newArrayList());
|
||||
mShadowPackageManager.setResolveInfosForIntent(
|
||||
mStylesAndWallpaperIntent, Lists.newArrayList());
|
||||
Preference preference = new Preference(mContext);
|
||||
preference.setKey(TEST_KEY);
|
||||
|
||||
mController.handlePreferenceTreeClick(preference);
|
||||
|
||||
assertThat(Shadows.shadowOf(mContext).getNextStartedActivityForResult()
|
||||
.intent.hasExtra("com.android.wallpaper.LAUNCH_SOURCE")).isTrue();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user