嵌入式爱好者

嵌入式爱好者 门户 知识库 查看内容

Android 12 系统横屏时,开机动画有一段时间显示不全

2024-8-30 15:04| 发布者: 金色田野的灿烂| 查看: 98| 评论: 0

类目:  >  知识库     文档编号: 1505

android12由于系统默认方向为竖屏,平板电脑要横屏显示。系统在开机时,有时因为旋转,会出现动画只显示一部分,如下图:

修改如下:

diff --git a/device/rockchip/rk3588/BoardConfig.mk b/device/rockchip/rk3588/BoardConfig.mk

index b25ebb6a6e..c71120e04d 100644

--- a/device/rockchip/rk3588/BoardConfig.mk

+++ b/device/rockchip/rk3588/BoardConfig.mk

@@ -29,7 +29,7 @@ PRODUCT_KERNEL_CONFIG ?= OK3588-Android_defconfig

 PRODUCT_BOOT_DEVICE := fe2e0000.mmc

 PRODUCT_SDMMC_DEVICE := fe2c0000.mmc

 

-SF_PRIMARY_DISPLAY_ORIENTATION := 0

+SF_PRIMARY_DISPLAY_ORIENTATION := 90

 

 # Disable emulator for "make dist" until there is a 64-bit qemu kernel

 BUILD_EMULATOR := false

diff --git a/frameworks/native/services/su**ceflinger/DisplayDevice.cpp b/frameworks/native/services/su**ceflinger/DisplayDevice.cpp

index 4445eea604..a3cc781ec5 100644

--- a/frameworks/native/services/su**ceflinger/DisplayDevice.cpp

+++ b/frameworks/native/services/su**ceflinger/DisplayDevice.cpp

@@ -262,13 +262,15 @@ void DisplayDevice::setProjection(ui::Rotation orientation, Rect layerStackSpace

     if (!orientedDisplaySpaceRect.isValid()) {

         // The destination frame can be invalid if it has never been set,

         // in that case we assume the whole display size.

-        orientedDisplaySpaceRect = getCompositionDisplay()->getState().displaySpace.bounds;

+         orientedDisplaySpaceRect = getCompositionDisplay()->getState().displaySpace.bounds;

+         orientedDisplaySpaceRect = Rect(orientedDisplaySpaceRect.bottom, orientedDisplaySpaceRect.right);

     }

 

     if (layerStackSpaceRect.isEmpty()) {

         // The layerStackSpaceRect can be invalid if it has never been set, in that case

         // we assume the whole framebuffer size.

         layerStackSpaceRect = getCompositionDisplay()->getState().framebufferSpace.bounds;

+        layerStackSpaceRect = Rect(layerStackSpaceRect.bottom, layerStackSpaceRect.right);

         if (orientation == ui::ROTATION_90 || orientation == ui::ROTATION_270) {

             std::swap(layerStackSpaceRect.right, layerStackSpaceRect.bottom);

         }

diff --git a/frameworks/native/services/su**ceflinger/Su**ceFlinger.cpp b/frameworks/native/services/su**ceflinger/Su**ceFlinger.cpp

index 894c47fb91..5ae5a7c1bf 100755

--- a/frameworks/native/services/su**ceflinger/Su**ceFlinger.cpp

+++ b/frameworks/native/services/su**ceflinger/Su**ceFlinger.cpp

@@ -437,9 +437,10 @@ Su**ceFlinger::Su**ceFlinger(Factory& factory) : Su**ceFlinger(factory, SkipI

             internalDisplayOrientation = ui::ROTATION_270;

             break;

     }

-    ALOGV("Internal Display Orientation: %s", toCString(internalDisplayOrientation));

+    //ALOGV("Internal Display Orientation: %s", toCString(internalDisplayOrientation));

 

     mInternalDisplayPrimaries = sysprop::getDisplayNativePrimaries();

+    ALOGV("Internal Display Orientation: %s", toCString(internalDisplayOrientation));

 

     // debugging stuff...

     char value[PROPERTY_VALUE_MAX];

@@ -2786,8 +2787,14 @@ sp<DisplayDevice> Su**ceFlinger::setupNewDisplayDeviceInternal(

     }

 

     display->setLayerStack(state.layerStack);

-    display->setProjection(state.orientation, state.layerStackSpaceRect,

-                           state.orientedDisplaySpaceRect);

+  //  display->setProjection(state.orientation, state.layerStackSpaceRect,

+    if(!mBootFinished){

+        display->setProjection(ui::ROTATION_0, state.layerStackSpaceRect,

+                     state.orientedDisplaySpaceRect);

+    }else{

+        display->setProjection(state.orientation, state.layerStackSpaceRect,

+                       state.orientedDisplaySpaceRect);

+   }

     display->setDisplayName(state.displayName);

 

     return display;

@@ -2958,8 +2965,15 @@ void Su**ceFlinger::processDisplayChanged(const wp<IBinder>& displayToken,

         if ((currentState.orientation != drawingState.orientation) ||

             (currentState.layerStackSpaceRect != drawingState.layerStackSpaceRect) ||

             (currentState.orientedDisplaySpaceRect != drawingState.orientedDisplaySpaceRect)) {

-            display->setProjection(currentState.orientation, currentState.layerStackSpaceRect,

+ //    display->setProjection(currentState.orientation, currentState.layerStackSpaceRect,

+         ALOGV("%s currentState.orientation=%d", __FUNCTION__,currentState.orientation);

+ if(!mBootFinished){

+                display->setProjection(ui::ROTATION_0, currentState.layerStackSpaceRect,                  

+     currentState.orientedDisplaySpaceRect);

+ }else{

+                display->setProjection(currentState.orientation, currentState.layerStackSpaceRect,

                                    currentState.orientedDisplaySpaceRect);

+       }

             if (isDisplayActiveLocked(display)) {

                 mActiveDisplayTransformHint = display->getTransformHint();

             }






已解决

未解决

只是看看

最新评论

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-12-28 03:26

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

返回顶部