1、frameworks\base\core\res\res\drawable-nodpi 或者 drawable-sw600dp-nodpi 或者drawable-sw700dp-nodpi
添加default_wallpaper_landscape.jpg文件
2、frameworks\base\core\res\res\values\symbols.xml
<java-symbol type="drawable" name="default_wallpaper" />
++<java-symbol type="drawable" name="default_wallpaper_landscape" /><!--添加-->
3、frameworks\base\core\java\Android\app\WallpaperManager.java
++import android.content.res.Configuration;
private Bitmap getDefaultWallpaperLocked(Context context) {try {
//wangrui
InputStream is = null;
if(context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT){
is = context.getResources().openRawResource(
com.android.internal.R.drawable.default_wallpaper);
}else{
is = context.getResources().openRawResource(
com.android.internal.R.drawable.default_wallpaper_landscape);
}
}
}
4、frameworks\base\packages\SystemUI\src\com\android\systemui\ImageWallpaper.java
void drawFrameLocked() {
// Load bitmap if it is not yet loaded or if it was loaded at a different size
if(true){ // (mBackground == null || surfaceDimensionsChanged) { //wangrui
if (DEBUG) {
Log.d(TAG, "Reloading bitmap: mBackground, bgw, bgh, dw, dh = " +
mBackground + ", " +
((mBackground == null) ? 0 : mBackground.getWidth()) + ", " +
((mBackground == null) ? 0 : mBackground.getHeight()) + ", " +
dw + ", " + dh);
}
updateWallpaperLocked();
if (mBackground == null) {
if (DEBUG) {
Log.d(TAG, "Unable to load bitmap");
}
return;
}
if (DEBUG) {
if (dw != mBackground.getWidth() || dh != mBackground.getHeight()) {
Log.d(TAG, "Surface != bitmap dimensions: surface w/h, bitmap w/h: " +
dw + ", " + dh + ", " + mBackground.getWidth() + ", " +
mBackground.getHeight());
}
}
}
}