icomic ipad怎么调整横屏

今天看啥 热点:
android4.4如何开机横屏
软件环境:android4.4
硬件平台:marvell
之前调试过在android4.0上将屏幕开机旋转90度,找到了契合点,调整起来还是相对简单,只需设置一个名称为ro.sf.hwrotation = 90即可,android的surface系统显示的时候会读取该系统属性的值,从而将显示界面旋转,但是android4.4的surfaceflinger机制做了调整,自始至终没有发现对该属性的处理判断,可能有其他的暗门,我暂时没发现,因此就把4.0判断属性的那一套移植了过来,具体改动如下:
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -384,6 +384,11 @@ status_t DisplayDevice::orientationToTransfrom(
int orientation, int w, int h, Transform* tr)
uint32_t flags = 0;
+ char property[PROPERTY_VALUE_MAX];
+ if (property_get(&ro.sf.hwrotation&, property, NULL) & 0) {
+ if (atoi(property) == 90)
+ orientation = DisplayState::eOrientation90;
switch (orientation) {
case DisplayState::eOrientationDefault:
flags = Transform::ROT_0;
@@ -411,6 +416,7 @@ void DisplayDevice::setProjection(int orientation,
const int w = mDisplayW
const int h = mDisplayH
+ char property[PROPERTY_VALUE_MAX];
Transform R;
DisplayDevice::orientationToTransfrom(orientation, w, h, &R);
@@ -418,7 +424,12 @@ void DisplayDevice::setProjection(int orientation,
if (!frame.isValid()) {
// the destination frame can be invalid if it has never been set,
// in that case we assume the whole display frame.
- frame = Rect(w, h);
+ if (property_get(&ro.sf.hwrotation&, property, NULL) & 0) {
+ if (atoi(property) == 90)
+ frame = Rect(h, w);
+ } else {
+ frame = Rect(w, h);
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -674,6 +674,7 @@ status_t SurfaceFlinger::getDisplayInfo(const sp& display, DisplayInfo*
const HWComposer& hwc(getHwComposer());
float xdpi = hwc.getDpiX(type);
float ydpi = hwc.getDpiY(type);
+ char property[PROPERTY_VALUE_MAX];
// TODO: Not sure if display density should handled by SF any longer
class Density {
@@ -718,8 +719,15 @@ status_t SurfaceFlinger::getDisplayInfo(const sp& display, DisplayInfo*
info-&orientation = 0;
- info-&w = hwc.getWidth(type);
- info-&h = hwc.getHeight(type);
+ if (property_get(&ro.sf.hwrotation&, property, NULL) & 0) {
+ if (atoi(property) == 90) {
+ info-&w = hwc.getHeight(type);
+ info-&h = hwc.getWidth(type);
+ } else {
+ info-&w = hwc.getWidth(type);
+ info-&h = hwc.getHeight(type);
这两个文件做完相应的修改之后,问题来了,开机以及后续的一系列显示确实进入了横屏模式,但是触摸屏却依然没有旋转过来,上层对touch点位的处理还是按竖屏模式处理的。。。接着尝试修改了surface的不少地方企图扭转touch点位,均告失败,最终选择了一个能解决问题但未必最优的方案,修改Input系统的处理。改动如下:
--- a/services/input/InputReader.cpp
+++ b/services/input/InputReader.cpp
@@ -42,6 +42,7 @@
#include &InputReader.h&
@@ -55,12 @@ void TouchInputMapper::configureSurface(nsecs_t when, bool* outResetNeeded) {
int32_t naturalPhysicalWidth, naturalPhysicalH
int32_t naturalPhysicalLeft, naturalPhysicalT
int32_t naturalDeviceWidth, naturalDeviceH
+ char property[PROPERTY_VALUE_MAX];
+ if (property_get(&ro.sf.hwrotation&, property, NULL) & 0) {
+ if (atoi(property) == 90)
+ mViewport.orientation = DISPLAY_ORIENTATION_90;
switch (mViewport.orientation) {
case DISPLAY_ORIENTATION_90:
naturalLogicalWidth = mViewport.logicalBottom - mViewport.logicalT
@@ -53,11 @@ void TouchInputMapper::cookPointerData() {
// X, Y, and the bounding box for coverage information
// Adjust coords for surface orientation.
float x, y, left, top, right,
+ char property[PROPERTY_VALUE_MAX];
+ if (property_get(&ro.sf.hwrotation&, property, NULL) & 0) {
+ if (atoi(property) == 90)
+ mSurfaceOrientation = DISPLAY_ORIENTATION_90;
switch (mSurfaceOrientation) {
case DISPLAY_ORIENTATION_90:
至此,触摸屏旋转成功。
本人是本着遇到问题解决问题的原则,也许4.4有类似4.0的关卡可以一步属性设置即可,只是本人没有发现这道关,上述提供的方案仅供参考以及笔者作为记录之用,稳定性还有待考究,本人未做全面的测试。有问题的同仁可以和我探讨,有更好方案的朋友还望不吝赐教。谢谢~~~
相关搜索:
相关阅读:
相关频道:
Android教程最近更新平板装的windows10,怎样设置自动横屏啊,每次横屏都要进设置,这样真的很烦啊!_百度知道
平板装的windows10,怎样设置自动横屏啊,每次横屏都要进设置,这样真的很烦啊!
些小板很多会出现这个问题,除了进设置操作外,比较方便的就是从任务通知抽屉中找到&#8226,从这里不需要打开也能调整屏幕方向了;英特尔核心显卡控制面板,貌似因为atom系列的显卡驱动的缘故
其他类似问题
为您推荐:
其他2条回答
右侧边缘向中间滑动,打开通知中心,在通知中心可以看到旋转锁定的按钮
直接锁定横屏
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁电脑桌面纵屏和横屏的调整! - 绿盟文章
有时候在你不知不觉的时候电脑的屏幕就会设置乱了,还有出现屏幕方向出错的问题,
下面我们就来看看如何解决这些问题。
1、我们可以先试试(ctrl+alt+方向键来调整),这个快捷键一般都是显卡驱动里面设置的。
2、还可以在桌面右键找到“图形选项”里面的“旋转”来调整桌面的°C数,调整成0°。
3、在桌面右键找到“屏幕分辨率”里面的方向选项,选择“横向”就能恢复正常了。
文章来自绿盟()转载请注明来路。
上一篇文章:iphone 恒屏和自动旋转& [声明:摘自他人,感谢作者]
IPhone的自动旋转功能一共有3中方法:
阅读(...) 评论()Iphone4发信息横屏,怎么设置不横屏???_百度知道
Iphone4发信息横屏,怎么设置不横屏???
我的手机:苹果,iPhone 4问题类型:系统设置
双击HOME 向右滑动 音乐左边那个圆形状的标志 按一下就不会横屏了
其他类似问题
为您推荐:
其他2条回答
按两下HOME键
向左滑动状态栏
在音乐旁边有个锁屏的
按下就好了
在设置选项里找到自动调整屏幕方向选项 取消
您可能关注的推广回答者:
iphone4的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 icomic ipad 的文章

 

随机推荐