Show Styles & Wallpaper in Settings

Show "Styles & Wallpaper" in Settings based on whether the ThemePicker
component is availalable. Also update dashboard summary for display.

Bug: 129874298
Test: m RunSettingsRoboTests
Change-Id: Id7e0bb9cbc689bb9e637919a10a7d1006397afab
This commit is contained in:
Amin Shaikh
2019-04-08 15:39:07 -04:00
parent d50bb09876
commit 2a9911e3a0
7 changed files with 156 additions and 52 deletions

View File

@@ -36,11 +36,15 @@ public class TopLevelDisplayPreferenceController extends BasePreferenceControlle
@Override
public CharSequence getSummary() {
if (new WallpaperPreferenceController(mContext, "dummy_key").isAvailable()) {
return mContext.getText(R.string.display_dashboard_summary);
final WallpaperPreferenceController controller =
new WallpaperPreferenceController(mContext, "dummy_key");
if (controller.isAvailable()) {
return mContext.getText(
controller.areStylesAvailable()
? R.string.display_dashboard_summary_with_style
: R.string.display_dashboard_summary);
} else {
return mContext.getText(R.string.display_dashboard_nowallpaper_summary);
}
}
}