RK3399|[RK3399][Android7.1] 双屏显示副屏旋转90°patch
Platform: RK3399
OS: Android 7.1
Kernel: v4.4.83
描述:
主屏edp+副屏HDMI
标准的sdk不会默认有旋转副屏为横屏显示为竖屏的功能,添加如下patch即可实现,
但是因为是双屏同显,副屏显示会有画面被压缩的现象。
【RK3399|[RK3399][Android7.1] 双屏显示副屏旋转90°patch】Patch:
diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
index 7776d9f..b2aec0b 100755
--- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
@@ -419,6 +419,7 @@ final class LocalDisplayAdapter extends DisplayAdapter {
com.android.internal.R.string.display_manager_hdmi_display_name);
mInfo.touch = DisplayDeviceInfo.TOUCH_EXTERNAL;
mInfo.setAssumedDensityForExternalDisplay(phys.width, phys.height);
+mInfo.rotation=Surface.ROTATION_90;
// For demonstration purposes, allow rotation of the external display.
// In the future we might allow the user to configure this directly.
diff --git a/services/core/java/com/android/server/display/LogicalDisplay.java b/services/core/java/com/android/server/display/LogicalDisplay.java
index 58ddae4..288508f 100755
--- a/services/core/java/com/android/server/display/LogicalDisplay.java
+++ b/services/core/java/com/android/server/display/LogicalDisplay.java
@@ -258,6 +258,13 @@ final class LogicalDisplay {
mPrimaryDisplayDeviceInfo = deviceInfo;
mInfo = null;
+if(mDisplayId!=Display.DEFAULT_DISPLAY){
+mBaseDisplayInfo.appWidth = deviceInfo.height;
+mBaseDisplayInfo.appHeight = deviceInfo.width;
+mBaseDisplayInfo.logicalWidth = deviceInfo.height;
+mBaseDisplayInfo.logicalHeight = deviceInfo.width;
+}
+
}
}
@@ -314,6 +321,7 @@ final class LogicalDisplay {
int orientation = Surface.ROTATION_0;
if ((displayDeviceInfo.flags & DisplayDeviceInfo.FLAG_ROTATES_WITH_CONTENT) != 0) {
orientation = displayInfo.rotation;
+
}
// Apply the physical rotation of the display device itself.
@@ -359,6 +367,13 @@ final class LogicalDisplay {
mTempDisplayRect.right += mDisplayOffsetX;
mTempDisplayRect.top += mDisplayOffsetY;
mTempDisplayRect.bottom += mDisplayOffsetY;
+
+if(device.getDisplayDeviceInfoLocked().type!=Display.TYPE_BUILT_IN){
+mTempDisplayRect.left=0;
+mTempDisplayRect.right=physWidth;
+mTempDisplayRect.top=0;
+mTempDisplayRect.bottom=physHeight;
+}
device.setProjectionInTransactionLocked(orientation, mTempLayerStackRect, mTempDisplayRect);
}
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
old mode 100644
new mode 100755
推荐阅读
- windows|Windows 11 手机诞生,还是双屏的()
- RK3399|[RK3399][Android7.1] 调试笔记 --- 解决开关按键时产生的Pop声
- RK3288|RK3288 android7.1 mlx90640温度传感器调试
- RK3288|RK3288 Android7.1 RTC-pcf8563调试 待机唤醒
- Android|Android7.1 SurfaceFlinger实时显示帧率FPS/LCD帧数/Camera帧数
- 子类__I2C|[RK3399][Android7.1] 调试笔记 AM1805调试
- RK3288_Android7.1调试RTC总结(一)
- Android7.1使用Parcel和java通信读写问题
- [RK3399][Android7.1-tvbox] Ethernet:机器通过交换机连接路由器,重启路由器后,机器无法获取ip的问题
- 双屏/多显示器截屏