Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0592a1f4 authored by Austin Wang's avatar Austin Wang Committed by Android (Google) Code Review
Browse files

Merge "Try default wallpaper component if no device color" into main

parents 4dcf2722 818135e5
Loading
Loading
Loading
Loading
+11 −14
Original line number Diff line number Diff line
@@ -2929,11 +2929,7 @@ public class WallpaperManager {
        ComponentName cn = null;
        String[] cmfWallpaperMap = context.getResources().getStringArray(
                com.android.internal.R.array.default_wallpaper_component_per_device_color);
        if (cmfWallpaperMap == null || cmfWallpaperMap.length == 0) {
            Log.d(TAG, "No CMF wallpaper config");
            return getDefaultWallpaperComponent(context);
        }

        if (cmfWallpaperMap != null && cmfWallpaperMap.length > 0) {
            for (String entry : cmfWallpaperMap) {
                String[] cmfWallpaper;
                if (!TextUtils.isEmpty(entry)) {
@@ -2945,12 +2941,13 @@ public class WallpaperManager {
                    }
                }
            }
        }

        if (!isComponentExist(context, cn)) {
            cn = null;
        }

        return cn;
        return cn == null ? getDefaultWallpaperComponent(context) : cn;
    }

    private static boolean isComponentExist(Context context, ComponentName cn) {