20231201将RK3399的挖掘机开发板在Andorid12系统下的强制横屏

20231201将RK3399的挖掘机开发板在Andorid12系统下的强制横屏
2023/12/1 22:54


【不完美的地方:修改之后不满屏】
百度:rk3399 android12 横屏 不满屏
Android 显示不满屏 build.prop

20231201将RK3399的挖掘机开发板在Andorid12系统下的强制横屏_第1张图片

20231201将RK3399的挖掘机开发板在Andorid12系统下的强制横屏_第2张图片20231201将RK3399的挖掘机开发板在Andorid12系统下的强制横屏_第3张图片


https://blog.csdn.net/weixin_39966398/article/details/105595184?spm=1001.2101.3001.6650.3&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-3-105595184-blog-85927833.235%5Ev38%5Epc_relevant_anti_t3&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-3-105595184-blog-85927833.235%5Ev38%5Epc_relevant_anti_t3&utm_relevant_index=4
https://blog.csdn.net/weixin_39966398/article/details/105595184
[RK3399][Android9.0]强制旋转主屏幕方向

风之空响  于 2020-04-18 11:16:39 发布

测试平台
Platform: RK3399pro
OS: Android 9.0

需求
强制旋转主屏幕方向

解决方案
7.1.1之前旋转方向我们可以通过修改build.prop里的ro.sf.hwrotation=0属性实现,但是当9.0时此属性设置无效.
查看device/rockchip/common/device.mk下的代码发现

# ConfigStoreHAL, for HWRotation, set SF_PRIMARY_DISPLAY_ORIENTATION to change it.
PRODUCT_PACKAGES += \
    [email protected]

按照说明使用SF_PRIMARY_DISPLAY_ORIENTATION可以设置HWRotation方向,那么在device/rockchip/common/BoardConfig.mk添加代码

SF_PRIMARY_DISPLAY_ORIENTATION := 270
编译后实现旋转效果

接着我们看一下这个宏定义的生效流程

hardware/interfaces/configstore/1.1/default/surfaceflinger.mk
ifneq ($(SF_PRIMARY_DISPLAY_ORIENTATION),)
    LOCAL_CFLAGS += -DPRIMARY_DISPLAY_ORIENTATION=$(SF_PRIMARY_DISPLAY_ORIENTATION)
endif

----------->
hardware/interfaces/configstore/1.1/default/SurfaceFlingerConfigs.cpp


Return SurfaceFlingerConfigs::primaryDisplayOrientation(
    primaryDisplayOrientation_cb _hidl_cb) {
    using ::android::hardware::configstore::V1_1::DisplayOrientation;

   .....
    int orientation = 0;
#ifdef PRIMARY_DISPLAY_ORIENTATION
    specified = true;
    orientation = PRIMARY_DISPLAY_ORIENTATION;
#endif


Z:\rk_android12_220722\device\rockchip\rk3399\BoardConfig.mk
SF_PRIMARY_DISPLAY_ORIENTATION := 0

#
# Copyright 2014 The Android Open-Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Use the non-open-source parts, if they're present
-include vendor/rockchip/rk3399/BoardConfigVendor.mk

CURRENT_SDK_VERSION := RK3399_ANDROID10.0_MID_V1.0

TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
TARGET_CPU_ABI := arm64-v8a
TARGET_CPU_ABI2 :=
TARGET_CPU_VARIANT := cortex-a53
TARGET_CPU_SMP := true

TARGET_2ND_ARCH := arm
TARGET_2ND_ARCH_VARIANT := armv7-a-neon
TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_CPU_VARIANT := cortex-a15

PRODUCT_KERNEL_ARCH := arm64
PRODUCT_KERNEL_DTS ?= rk3399-sapphire-excavator-edp-avb
PRODUCT_KERNEL_CONFIG ?= rockchip_defconfig
PRODUCT_UBOOT_CONFIG ?= rk3399

SF_PRIMARY_DISPLAY_ORIENTATION := 0

修改为:
#SF_PRIMARY_DISPLAY_ORIENTATION := 0
SF_PRIMARY_DISPLAY_ORIENTATION := 90

20231201将RK3399的挖掘机开发板在Andorid12系统下的强制横屏_第4张图片

20231201将RK3399的挖掘机开发板在Andorid12系统下的强制横屏_第5张图片


修改这里无效:
Z:\rk_android12_220722\device\rockchip\common\BoardConfig.mk
# GPU configration
TARGET_BOARD_PLATFORM_GPU ?= mali-t760
GRAPHIC_MEMORY_PROVIDER ?= ump
USE_OPENGL_RENDERER ?= true
TARGET_DISABLE_TRIPLE_BUFFERING ?= false
TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK ?= false

DEVICE_HAVE_LIBRKVPU ?= true

#rotate screen to 0, 90, 180, 270
#0:   ROTATION_NONE      ORIENTATION_0  : 0
#90:  ROTATION_RIGHT     ORIENTATION_90 : 90
#180: ROTATION_DOWN    ORIENTATION_180: 180
#270: ROTATION_LEFT    ORIENTATION_270: 270
# For Recovery Rotation
TARGET_RECOVERY_DEFAULT_ROTATION ?= ROTATION_NONE
# For Surface Flinger Rotation
SF_PRIMARY_DISPLAY_ORIENTATION ?= 0

修改为:
# For Surface Flinger Rotation
SF_PRIMARY_DISPLAY_ORIENTATION ?= 0
#SF_PRIMARY_DISPLAY_ORIENTATION ?= 90


参考资料:
https://it.cha138.com/php/show-53727.html
rk3288 android7副屏旋转显示异常与满屏修改


https://blog.csdn.net/u014674293/article/details/93171462?spm=1001.2101.3001.6650.2&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-2-93171462-blog-85927833.235%5Ev38%5Epc_relevant_anti_t3&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-2-93171462-blog-85927833.235%5Ev38%5Epc_relevant_anti_t3&utm_relevant_index=3
https://blog.csdn.net/u014674293/article/details/93171462
[AndroidO] [RK3399] -- 修改屏幕默认横屏

BestW2Y  于 2019-06-21 14:50:14 发布

修改屏幕默认横屏需要修改Android属性 build.prop 文件, 而build.prop文件可以通过buildinfo.sh文件生成, 所以这里我们修改buildinfo.sh 文件即可, 修改如下:

diff --git a/build/make/tools/buildinfo.sh b/build/make/tools/buildinfo.sh
index 4698c43..5210383 100755
--- a/build/make/tools/buildinfo.sh
+++ b/build/make/tools/buildinfo.sh
@@ -59,6 +59,5 @@ if [ -n "$BUILD_THUMBPRINT" ] ; then
   echo "ro.build.thumbprint=$BUILD_THUMBPRINT"
 fi
 echo "ro.build.characteristics=$TARGET_AAPT_CHARACTERISTICS"
-echo "ro.sf.hwrotation=270"
 
 echo "# end build properties"
总结:  

1. ro.sf.hwrotation 设置屏幕角度 可设置为0,90,180,279, 默认为竖屏;

2. Android的build.prop文件是在Android编译时刻收集的各种property(LCD density/语言/编译时间, etc.),编译完成之后, 文件生成在out/target/product//system/目录下, 记录了系统的设置和改变;

3. 在Android运行时刻可以通过property_get()[c/c++域] / SystemProperties_get*()[Java域]读取这些属性值;

4. Android 的各种属性property都是在各种makefile文件中定义的;

5. buildinfo.sh 脚本就是专门用于生成build.prop文件,build.prop的生成是由make系统解析build/core/Makefile完成,并把系统默认的system.prop以及定制的system.prop中的设定追加到build.prop文件中;

6. Makefile中调用build/tools/buildinfo.sh执行脚本,并输出到build.prop中, 详细的build.prop生成分析请查看:

博客:  [Android基础] -- Android属性之build.prop生成过程分析 ! ! !

你可能感兴趣的:(杂质,杂质)