Load defeault wallpaper based on device's CMF color am: 758c663e8f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13628026

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I52654a22aa5f9562ba8ab060369494f7d6018dd6
This commit is contained in:
Ching-Sung Li
2021-02-21 15:27:38 +00:00
committed by Automerger Merge Worker

View File

@@ -117,6 +117,9 @@ public class WallpaperManager {
private static final String PROP_LOCK_WALLPAPER = "ro.config.lock_wallpaper"; private static final String PROP_LOCK_WALLPAPER = "ro.config.lock_wallpaper";
/** {@hide} */ /** {@hide} */
private static final String PROP_WALLPAPER_COMPONENT = "ro.config.wallpaper_component"; private static final String PROP_WALLPAPER_COMPONENT = "ro.config.wallpaper_component";
/** {@hide} */
private static final String VALUE_CMF_COLOR =
android.os.SystemProperties.get("ro.boot.hardware.color");
/** /**
* Activity Action: Show settings for choosing wallpaper. Do not use directly to construct * Activity Action: Show settings for choosing wallpaper. Do not use directly to construct
@@ -2064,7 +2067,11 @@ public class WallpaperManager {
return null; return null;
} else { } else {
whichProp = PROP_WALLPAPER; whichProp = PROP_WALLPAPER;
defaultResId = com.android.internal.R.drawable.default_wallpaper; final int defaultColorResId = context.getResources().getIdentifier(
"default_wallpaper_" + VALUE_CMF_COLOR, "drawable", "android");
defaultResId =
defaultColorResId == 0 ? com.android.internal.R.drawable.default_wallpaper
: defaultColorResId;
} }
final String path = SystemProperties.get(whichProp); final String path = SystemProperties.get(whichProp);
if (!TextUtils.isEmpty(path)) { if (!TextUtils.isEmpty(path)) {