Platform: RK3288
OS: Android 7.1.2
Kernel: v4.4.143
问题:
客户在横屏系统设置中导入一张1920*1080的壁纸,显示不正常,如下图壁纸效果与原图的对比效果;
方法:
在system.prop上添加下面的节点
ro.wallpaper.fixsize=true
添加这个节点之后,显示效果会模糊,原因是代码里做了处理,采用scale保存位图,直接去掉这个机制将needScale置成false,即直接用copy的方式生成位图文件,不用去scale再保存位图。
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
old mode 100644
new mode 100755
index 2d21311..ad75bd6
--- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
+++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
@@ -368,8 +368,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {}// scale if the crop height winds up not matching the recommended metrics
- needScale = (wallpaper.height != cropHint.height());
-
+ //needScale = (wallpaper.height != cropHint.height());
+ needScale= false;if (DEBUG) {Slog.v(TAG, "crop: w=" + cropHint.width() + " h=" + cropHint.height());Slog.v(TAG, "dims: w=" + wallpaper.width + " h=" + wallpaper.height);
原理:
ro.wallpaper.fixsize这个节点应该是RK这边导入的,可以通过追这个节点的代码查看具体的实现方式;