1.设置屏幕方向为横屏
修改device/rockchip/common/BoardConfig.mk
SF_PRIMARY_DISPLAY_ORIENTATIO参数值
diff --git a/device/rockchip/common/BoardConfig.mk b/device/rockchip/common/BoardConfig.mk
index b930d2b1bb..eafa6b95f3 100755
--- a/device/rockchip/common/BoardConfig.mk
+++ b/device/rockchip/common/BoardConfig.mk
@@ -162,7 +162,7 @@ DEVICE_HAVE_LIBRKVPU ?= true
# For Recovery Rotation
TARGET_RECOVERY_DEFAULT_ROTATION ?= ROTATION_NONE
# For Surface Flinger Rotation
-SF_PRIMARY_DISPLAY_ORIENTATION ?= 0
+SF_PRIMARY_DISPLAY_ORIENTATION :=270
2.设置屏幕分辨率
在控制台输入
wm size 1920x1080
或
修改device/rockchip/rk3588/rk3588_s/rk3588_s.mk
增加PRODUCT_PROPERTY_OVERRIDES += ro.config.size_override参数值
diff --git a/device/rockchip/rk3588/rk3588_s/rk3588_s.mk b/device/rockchip/rk3588/rk3588_s/rk3588_s.mk
index 27aba9b716..c2cdea4414 100644
--- a/device/rockchip/rk3588/rk3588_s/rk3588_s.mk
+++ b/device/rockchip/rk3588/rk3588_s/rk3588_s.mk
@@ -38,7 +38,8 @@ PRODUCT_AAPT_PREF_CONFIG := mdpi
#
## add Rockchip properties
#
-PRODUCT_PROPERTY_OVERRIDES += ro.sf.lcd_density=320
+PRODUCT_PROPERTY_OVERRIDES += ro.config.size_override=1920,1080
+PRODUCT_PROPERTY_OVERRIDES += ro.sf.lcd_density=240
PRODUCT_PROPERTY_OVERRIDES += ro.wifi.sleep.power.down=true
PRODUCT_PROPERTY_OVERRIDES += persist.wifi.sleep.delay.ms=0
3.设置屏幕密度
在控制台输入
wm density 240
或
修改device/rockchip/rk3588/rk3588_s/rk3588_s.mk
修改PRODUCT_PROPERTY_OVERRIDES += ro.sf.lcd_density参数值
4.问题
屏幕密度值由320改为240后,底下导航栏会变成显示一个任务栏,现象如下图:
首先屏蔽底下任务栏显示,修改packages/apps/Launcher3/src/com/android/launcher3/config/FeatureFlags.java中的ENABLE_TASKBAR的初始值为false。
diff --git a/packages/apps/Launcher3/src/com/android/launcher3/config/FeatureFlags.java b/packages/apps/Launcher3/src/com/android/launcher3/config/FeatureFlags.java
index 2d31aa4687..15eadff831 100644
--- a/packages/apps/Launcher3/src/com/android/launcher3/config/FeatureFlags.java
+++ b/packages/apps/Launcher3/src/com/android/launcher3/config/FeatureFlags.java
@@ -191,7 +191,7 @@ public final class FeatureFlags {
+ "predictions to be updated while they are visible to the user.");
public static final BooleanFlag ENABLE_TASKBAR = getDebugFlag(
- "ENABLE_TASKBAR", true, "Allows a system Taskbar to be shown on larger devices.");
+ "ENABLE_TASKBAR", false, "Allows a system Taskbar to be shown on larger devices.");
此时导航栏也不再显示,原因是frameworks\base\packages\SystemUI\src\com\android\systemui\navigationbar\NavigationBarController.java中的函数initializeTaskbarIfNecessary判断设备为平板以后,会调用removeNavigationBar(mContext.getDisplayId());移除导航栏显示。文章来源:https://www.toymoban.com/news/detail-609717.html
/** @return {@code true} if taskbar is enabled, false otherwise */
private boolean initializeTaskbarIfNecessary() {
if (mIsTablet) {
// Remove navigation bar when taskbar is showing
removeNavigationBar(mContext.getDisplayId());
mTaskbarDelegate.init(mContext.getDisplayId());
} else {
mTaskbarDelegate.destroy();
}
return mIsTablet;
}
frameworks\base\packages\SystemUI\shared\src\com\android\systemui\shared\recents\utilities\Utilities.java中的public static boolean isTablet(Context context)函数,当屏幕的(最小边长度*160/dpi值)< 600,就会判断为设备是平板设备,将其返回值改为false就可以显示导航栏了。文章来源地址https://www.toymoban.com/news/detail-609717.html
diff --git a/frameworks/base/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/Utilities.java b/frameworks/base/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/Utilities.java
index 8d98a7540a..665098941f 100644
--- a/frameworks/base/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/Utilities.java
+++ b/frameworks/base/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/Utilities.java
@@ -127,7 +127,7 @@ public class Utilities {
float smallestWidth = dpiFromPx(Math.min(bounds.width(), bounds.height()),
context.getResources().getConfiguration().densityDpi);
- return smallestWidth >= TABLET_MIN_DPS;
+ return false;
}
到了这里,关于[RK3588 Android12]设置屏幕方向、分辨率和密度的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!