Specifies nav destination when opening shortcuts.
Doing this will open the correct screen when clicking on "Shortcuts" under Settings > Display > Lock screen. Fix: 258471384 Test: manually verified that clicking on it opens the wallpaper picker experience with the correct page showing. Change-Id: I627bcb9c9fac7a834f1c9d9cb36b73a6c8817af5
This commit is contained in:
@@ -13754,8 +13754,8 @@
|
|||||||
<string name="lockscreen_double_line_clock_summary">Show double-line clock when available</string>
|
<string name="lockscreen_double_line_clock_summary">Show double-line clock when available</string>
|
||||||
<!-- Lockscreen double-line clock toggle [CHAR LIMIT=60] -->
|
<!-- Lockscreen double-line clock toggle [CHAR LIMIT=60] -->
|
||||||
<string name="lockscreen_double_line_clock_setting_toggle">Double-line clock</string>
|
<string name="lockscreen_double_line_clock_setting_toggle">Double-line clock</string>
|
||||||
<!-- Lock screen buttons preference [CHAR LIMIT=60] -->
|
<!-- Lock screen shortcuts preference [CHAR LIMIT=60] -->
|
||||||
<string name="lockscreen_quick_affordances_title">Buttons</string>
|
<string name="lockscreen_quick_affordances_title">Shortcuts</string>
|
||||||
<!-- Summary for the lock screen button preference [CHAR LIMIT=60] -->
|
<!-- Summary for the lock screen button preference [CHAR LIMIT=60] -->
|
||||||
<plurals name="lockscreen_quick_affordances_summary">
|
<plurals name="lockscreen_quick_affordances_summary">
|
||||||
<item quantity="zero">None</item>
|
<item quantity="zero">None</item>
|
||||||
|
@@ -50,13 +50,13 @@ public class CustomizableLockScreenQuickAffordancesPreferenceController extends
|
|||||||
final Preference preference = screen.findPreference(getPreferenceKey());
|
final Preference preference = screen.findPreference(getPreferenceKey());
|
||||||
if (preference != null) {
|
if (preference != null) {
|
||||||
preference.setOnPreferenceClickListener(preference1 -> {
|
preference.setOnPreferenceClickListener(preference1 -> {
|
||||||
// TODO(b/258471384): open the buttons destination within wallpaper picker.
|
|
||||||
final Intent intent = new Intent(Intent.ACTION_SET_WALLPAPER);
|
final Intent intent = new Intent(Intent.ACTION_SET_WALLPAPER);
|
||||||
final String packageName =
|
final String packageName =
|
||||||
mContext.getString(R.string.config_wallpaper_picker_package);
|
mContext.getString(R.string.config_wallpaper_picker_package);
|
||||||
if (!TextUtils.isEmpty(packageName)) {
|
if (!TextUtils.isEmpty(packageName)) {
|
||||||
intent.setPackage(packageName);
|
intent.setPackage(packageName);
|
||||||
}
|
}
|
||||||
|
intent.putExtra("destination", "quick_affordances");
|
||||||
mContext.startActivity(intent);
|
mContext.startActivity(intent);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
@@ -102,6 +102,8 @@ 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("destination"))
|
||||||
|
.isEqualTo("quick_affordances");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Reference in New Issue
Block a user