1.自定义壁纸
默认壁纸是default_wallpaper,在/frameworks/base/core/res/res,找到drawable-sw720dp-nodpi 、drawable-sw600dp-nodpi、drawable-nodpi的地方中有default_wallpaper.png,然后把自定义的壁纸(custom_wallpaper.png)也拷贝到相应的地方。
2.修改默认壁纸
加载壁纸的类frameworks/base/core/java/android/app/WallpaperManager.java ,custom_wallpaper是自定义壁纸的图片名字。
/**
* Open stream representing the default static image wallpaper.
*
* If the device defines no default wallpaper of the requested kind,
* {@code null} is returned.
*
* @hide
*/
public static InputStream openDefaultWallpaper(Context context, @SetWallpaperFlags int which) {
final String whichProp;
final int defaultResId;
if (which == FLAG_LOCK) {
/* Factory-default lock wallpapers are not yet supported
whichProp = PROP_LOCK_WALLPAPER;
defau