1、frameworks\base\core\res\res\drawable-nodpi 或者 drawable-sw600dp-nodpi 或者drawable-sw700dp-nodpi
添加default_wallpaper_1.jpg文件
2、frameworks\base\core\res\res\values\symbols.xml
++3、frameworks\base\core\java\android\app\WallpaperManager.java
++import android.content.res.Configuration;
private InputStream openDefaultWallpaperRes(Context context) {
IWallpaperPlugin mWallpaperPlugin = null;
InputStream is = null;
/// M: Init mWallpaperPlugin for Operators @{
try {
mWallpaperPlugin = (IWallpaperPlugin)MediatekClassFactory.createInstance(
IPluginManager.class,
IPluginManager.CREATE_PLUGIN_OBJECT,
context,
IWallpaperPlugin.class.getName(),
null,
IPluginManager.CLASS);
} catch (Exception e) {
Log.e(TAG,"load IWallpaperPlugin exception: ", e);
}
/// @}
if (mWallpaperPlugin == null || mWallpaperPlugin.getPluginResources(context) == null) {
Xlog.d(TAG, “get the wallpaper image from the plug-in”);
++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_1);
++}
} else {
is = mWallpaperPlugin.getPluginResources(context).openRawResource(
mWallpaperPlugin.getPluginDefaultImage());
}
return is;
}
4、frameworks\base\packages\SystemUI\src\com\android\systemui\ImageWallpaper.java
// Load bitmap if it is not yet loaded or if it was loaded at a different size
//if (mBackground == null || surfaceDimensionsChanged) {//任何时候都执行
++if (true) {
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);
}
mWallpaperManager.forgetLoadedWallpaper();
updateWallpaperLocked();
————————————————
版权声明:本文为CSDN博主「Michael_LeePP」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u010916467/article/details/45247761
————————————————
版权声明:本文为CSDN博主「Michael_LeePP」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u010916467/article/details/45247761