RK3568 android 11忽略 应用设置的强制方向

在客户定制开发过程中发现客户的apk不随着我们系统设置的旋转方向而旋转,在app内自己设置了方向,导致进入应用之后,会有一个旋转的过程,经过代码查找最终找到修改地方
修改位置

frameworks\base\services\core\java\com\android\server\wm\DisplayContent.java

修改内容如下

@Override
    int getOrientation() {
        // add code start
    +  if(true)return SCREEN_ORIENTATION_USER;
       // add code end
        final WindowManagerPolicy policy = mWmService.mPolicy;


        if (mIgnoreRotationForApps) {
            return SCREEN_ORIENTATION_USER;
        }


        if (mWmService.mDisplayFrozen) {
            if (mLastWindowForcedOrientation != SCREEN_ORIENTATION_UNSPECIFIED) {
                if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Display id=" + mDisplayId
                        + " is frozen, return " + mLastWindowForcedOrientation);
                // If the display is frozen, some activities may be in the middle of restarting, and
                // thus have removed their old window. If the window has the flag to hide the lock
                // screen, then the lock screen can re-appear and inflict its own orientation on us.
                // Keep the orientation stable until this all settles down.
                return mLastWindowForcedOrientation;
            } else if (policy.isKeyguardLocked()) {
                // Use the last orientation the while the display is frozen with the keyguard
                // locked. This could be the keyguard forced orientation or from a SHOW_WHEN_LOCKED
                // window. We don't want to check the show when locked window directly though as
                // things aren't stable while the display is frozen, for example the window could be
                // momentarily unavailable due to activity relaunch.
                if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Display id=" + mDisplayId
                        + " is frozen while keyguard locked, return " + mLastOrientation);
                return mLastOrientation;
            }
        } else {
            final int orientation = mAboveAppWindowsContainers.getOrientation();
            if (orientation != SCREEN_ORIENTATION_UNSET) {
                return orientation;
            }
        }


        // Top system windows are not requesting an orientation. Start searching from apps.
        return mTaskStackContainers.getOrientation();
    }
  • 12
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
rk3568是一款基于ARM Cortex-A55架构的64位高性能嵌入式处理器,属于RK系列中的一员。它支持Android 11操作系统和多种外设接口,包括摄像头接口。然而,在使用rk3568处理器时,摄像头默认旋转方向具体是怎么确定的呢? 首先,需要明确的是,RK3568处理器主要由四个核心部分组成,包括CPU、GPU、ISP和VPU。其中,ISP(Image Signal Processor)是用于处理相机数据的。一般情况下,系统会在启动时读取ISP设置,并将其应用到整个系统中。 在Android 11系统上,系统开发人员可以通过修改源代码来确定RK3568处理器摄像头默认旋转方向。源代码中有一个名为“android.hardware.camera2”的API,它提供了与相机相关的所有设置。其中,“android.hardware.camera2.CameraCharacteristics”类可以查询相机支持的所有特性。“android.hardware.camera2.CaptureRequest”类可以设置相机参数,例如曝光时间、ISO、焦距、闪光灯等。 通过这些API,开发人员可以获取和修改摄像头旋转方向设置。例如,在设置曝光时间时,可以将“CaptureRequest.JPEG_ORIENTATION”参数设置为90度或270度,这将会使得相机拍摄的照片或视频自动旋转90度或270度。这样就可以根据具体需求来设置摄像头默认旋转方向,以达到最佳效果。 综上所述,rk3568处理器摄像头默认旋转方向可以通过修改源代码来确定,通过API可以查询摄像头支持的所有特性、设置相机参数等。在使用rk3568处理器时,开发人员应该仔细阅读官方文档,并根据具体需求来对相机参数进行调整,以达到最佳效果。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值