Merge "Fixes nav stack issue." into udc-dev am: b5dda005fd
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23573917 Change-Id: I927dda740c8fb3a6e29c71a64863e21a7c87f857 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -60,6 +60,12 @@ public final class CustomizableLockScreenUtils {
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
static final String AFFORDANCE_NAME = "affordance_name";
|
static final String AFFORDANCE_NAME = "affordance_name";
|
||||||
|
|
||||||
|
@VisibleForTesting
|
||||||
|
static final String WALLPAPER_LAUNCH_SOURCE = "com.android.wallpaper.LAUNCH_SOURCE";
|
||||||
|
@VisibleForTesting
|
||||||
|
static final String LAUNCH_SOURCE_SETTINGS = "app_launched_settings";
|
||||||
|
|
||||||
|
|
||||||
private CustomizableLockScreenUtils() {}
|
private CustomizableLockScreenUtils() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -163,7 +169,14 @@ public final class CustomizableLockScreenUtils {
|
|||||||
* activity.
|
* activity.
|
||||||
*/
|
*/
|
||||||
public static Intent newIntent() {
|
public static Intent newIntent() {
|
||||||
return new Intent(Intent.ACTION_SET_WALLPAPER);
|
final Intent intent = new Intent(Intent.ACTION_SET_WALLPAPER);
|
||||||
|
// By adding the launch source here, we tell our destination (in this case, the wallpaper
|
||||||
|
// picker app) that it's been launched from within settings. That way, if we are in a
|
||||||
|
// multi-pane configuration (for example, for large screens), the wallpaper picker app can
|
||||||
|
// safely skip redirecting to the multi-pane version of its activity, as it's already opened
|
||||||
|
// within a multi-pane configuration context.
|
||||||
|
intent.putExtra(WALLPAPER_LAUNCH_SOURCE, LAUNCH_SOURCE_SETTINGS);
|
||||||
|
return intent;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isWallpaperPickerInstalled(Context context) {
|
private static boolean isWallpaperPickerInstalled(Context context) {
|
||||||
|
@@ -114,6 +114,9 @@ public class CustomizableLockScreenQuickAffordancesPreferenceControllerTest {
|
|||||||
assertThat(intentCaptor.getValue().getPackage()).isEqualTo(
|
assertThat(intentCaptor.getValue().getPackage()).isEqualTo(
|
||||||
mContext.getString(R.string.config_wallpaper_picker_package));
|
mContext.getString(R.string.config_wallpaper_picker_package));
|
||||||
assertThat(intentCaptor.getValue().getAction()).isEqualTo(Intent.ACTION_SET_WALLPAPER);
|
assertThat(intentCaptor.getValue().getAction()).isEqualTo(Intent.ACTION_SET_WALLPAPER);
|
||||||
|
assertThat(intentCaptor.getValue().getStringExtra(
|
||||||
|
CustomizableLockScreenUtils.WALLPAPER_LAUNCH_SOURCE)).isEqualTo(
|
||||||
|
CustomizableLockScreenUtils.LAUNCH_SOURCE_SETTINGS);
|
||||||
assertThat(intentCaptor.getValue().getStringExtra("destination"))
|
assertThat(intentCaptor.getValue().getStringExtra("destination"))
|
||||||
.isEqualTo("quick_affordances");
|
.isEqualTo("quick_affordances");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user