AirtestProject / AirtestProject/Airtest

touch屏幕位置不准确

Đang mở
#914 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
9.6k
Fork
1.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

(请尽量按照下面提示内容填写,有助于我们快速定位和解决问题,感谢配合。否则直接关闭。)

**(重要!问题分类)**
* 测试开发环境AirtestIDE使用问题 -> https://github.com/AirtestProject/AirtestIDE/issues
* 控件识别、树状结构、poco库报错 -> https://github.com/AirtestProject/Poco/issues
* 图像识别、设备控制相关问题 -> 按下面的步骤

**描述问题bug**
手机运行一段时间后,
airtest/core/android/minicap.py
get_display_info()方法获取到的非实际分辨率错误,导致点击屏幕位置错误
实际分辨率为1080X2340,但是yosemite输入法的cur=1080x1920,且在第一个(当前屏是游戏非输入法)

`root@MacBook-Pro / % adb shell dumpsys window displays
WINDOW MANAGER DISPLAY CONTENTS (dumpsys window displays)
Display: mDisplayId=62
init=1080x1920 1dpi cur=1080x1920 app=1080x1920 rng=1080x1080-1920x1920
deferred=false mLayoutNeeded=false mTouchExcludeRegion=SkRegion()
mFreeFormWindowShowed=false

mLayoutSeq=9
mDeferredRotationPauseCount=0
mCurrentFocus=null
mFocusedApp=null

displayId=62
mWallpaperTarget=null
mLastWallpaperX=-1.0 mLastWallpaperY=-1.0

mSystemGestureExclusion=

Application tokens in top down Z order:

DockedStackDividerController
mLastVisibility=false
mMinimizedDock=false
mAdjustedForIme=false
mAdjustedForDivider=false

PinnedStackController
defaultBounds=[552,1623][1080,1920]
mDefaultMinSize=297
mDefaultStackGravity=85
mDefaultAspectRatio=1.777778
movementBounds=[0,0][1080,1920]
mIsImeShowing=false
mImeHeight=0
mIsShelfShowing=false
mShelfHeight=0
mReentrySnapFraction=-1.0
mIsMinimized=false
mAspectRatio=1.777778
mMinAspectRatio=0.41841003
mMaxAspectRatio=2.39
mActions=[]
mDisplayInfo=DisplayInfo{"ScreenRecorder-display, displayId 62", uniqueId "virtual:**com.netease.nie.yosemite,**10257,ScreenRecorder-display,0", app 1080 x 1920, real 1080 x 1920, largest app 1920 x 1920, smallest app 1080 x 1080, mode 63, defaultMode 63, modes [{id=63, width=1080, height=1920, fps=60.0}], colorMode 0, supportedColorModes [0], hdrCapabilities null, rotation 0, density 1 (1.0 x 1.0) dpi, layerStack 62, appVsyncOff 0, presDeadline 16666666, type VIRTUAL, state ON, owner com.netease.nie.yosemite (uid 10257), FLAG_PRESENTATION, removeMode 0}

DisplayFrames w=1080 h=1920 r=0
mStable=[0,0][1080,1920]
mStableFullscreen=[0,0][1080,1920]
mDock=[0,0][1080,1920]
mCurrent=[0,0][1080,1920]
mSystem=[0,0][1080,1920]
mContent=[0,0][1080,1920]
mVoiceContent=[0,0][1080,1920]
mOverscan=[0,0][1080,1920]
mRestrictedOverscan=[0,0][1080,1920]
mRestricted=[0,0][1080,1920]
mUnrestricted=[0,0][1080,1920]
mDisplayInfoOverscan=[0,0][0,0]
mRotatedDisplayInfoOverscan=[0,0][0,0]
mDisplayCutout=WmDisplayCutout{DisplayCutout{insets=Rect(0, 0 - 0, 0) boundingRect={Bounds=[Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0)]}}, mFrameSize=null}

DisplayPolicy mCarDockEnablesAccelerometer=true mDeskDockEnablesAccelerometer=true
mDockMode=EXTRA_DOCK_STATE_UNDOCKED mLidState=LID_ABSENT
mAwake=true mScreenOnEarly=true mScreenOnFully=true
mKeyguardDrawComplete=false mWindowManagerDrawComplete=false
mHdmiPlugged=false
mShowingDream=false mDreamingLockscreen=false mDreamingSleepToken=null
mTopIsFullscreen=false mForceStatusBar=false mForceStatusBarFromKeyguard=false
mForceShowSystemBarsFromExternal=false
mAllowLockscreenWhenOn=false
Looper state:
Looper (android.ui, tid 19) {bf5781c}
(Total messages: 0, polling=true, quitting=false)
Dump time: 2021-06-03 13:53:47.706 GMT+08:00
Package: system_server
Current looper: Looper (android.ui, tid=1736)
History of long time messages on Looper (android.ui, tid=1736):

DisplayRotation
mCurrentAppOrientation=SCREEN_ORIENTATION_UNSPECIFIED
mLandscapeRotation=ROTATION_90 mSeascapeRotation=ROTATION_270
mPortraitRotation=ROTATION_0 mUpsideDownRotation=ROTATION_180
mSupportAutoRotation=true

mCarDockRotation=-1 mDeskDockRotation=-1
mUserRotationMode=USER_ROTATION_FREE mUserRotation=ROTATION_0 mAllowAllRotations=unknown
mDemoHdmiRotation=ROTATION_90 mDemoHdmiRotationLock=false mUndockedHdmiRotation=-1
mLidOpenRotation=-1
mFixedToUserRotation=false

WindowInsetsStateController
InsetsState
Control map:
Display: mDisplayId=0
init=1080x2340 440dpi cur=1080x2340 app=1080x2135 rng=1080x1005-2135x2135
deferred=false mLayoutNeeded=false mTouchExcludeRegion=SkRegion((0,0,1080,2340))
mFreeFormWindowShowed=false

mLayoutSeq=17265
mDeferredRotationPauseCount=0
mCurrentFocus=Window{fcf0a63 u0 com.xd.WuLaLaTest/com.unity3d.player.UnityPlayerActivity}
mFocusedApp=AppWindowToken{292d0da token=Token{fa62a85 ActivityRecord{53625ce u0 com.xd.WuLaLaTest/com.unity3d.player.UnityPlayerActivity t4678}}}
mLastStatusBarVisibility=0x970e

displayId=0
mWallpaperTarget=null
mLastWallpaperX=1.0 mLastWallpaperY=0.0

mSystemGestureExclusion=

Application tokens in top down Z order:
mStackId=236
mDeferRemoval=false
mBounds=[0,0][1080,2340]
taskId=4678
mBounds=[0,0][1080,2340]
mdr=false
appTokens=[AppWindowToken{292d0da token=Token{fa62a85 ActivityRecord{53625ce u0 com.xd.WuLaLaTest/com.unity3d.player.UnityPlayerActivity t4678}}}]
mDisplayedBounds=[0,0][0,0]
Activity #0 AppWindowToken{292d0da token=Token{fa62a85 ActivityRecord{53625ce u0 com.xd.WuLaLaTest/com.unity3d.player.UnityPlayerActivity t4678}}}
windows=[Window{fcf0a63 u0 com.xd.WuLaLaTest/com.unity3d.player.UnityPlayerActivity}]
windowType=2 hidden=false hasVisible=true
app=true mVoiceInteraction=false
component=com.xd.WuLaLaTest/com.unity3d.player.UnityPlayerActivity
task={taskId=4678 appTokens=[AppWindowToken{292d0da token=Token{fa62a85 ActivityRecord{53625ce u0 com.xd.WuLaLaTest/com.unity3d.player.UnityPlayerActivity t4678}}}] mdr=false}
mFillsParent=true mOrientation=1
hiddenRequested=false mClientHidden=false reportedDrawn=true reportedVisible=true
mNumInterestingWindows=1 mNumDrawnWindows=1 inPendingTransaction=false allDrawn=true lastAllDrawn=true mIsCastMode=false)
startingData=null removed=false firstWindowDrawn=true mIsExiting=false
mMiuiConfigFlag=1
mMiuiConfigFlag=1
mStackId=0
mDeferRemoval=false
mBounds=[0,0][1080,2340]
taskId=1
mBounds=[0,0][1080,2340]
mdr=false
appTokens=[AppWindowToken{fe7b86b token=Token{880a1ba ActivityRecord{417064f u0 com.miui.home/.launcher.Launcher t1}}}]
mDisplayedBounds=[0,0][0,0]
Activity #0 AppWindowToken{fe7b86b token=Token{880a1ba ActivityRecord{417064f u0 com.miui.home/.launcher.Launcher t1}}}
windows=[Window{465355a u0 com.miui.home/com.miui.home.launcher.Launcher}, Window{8c47d6 u0 LauncherOverlayWindow:com.miui.personalassistant}]
windowType=2 hidden=true hasVisible=true
app=true mVoiceInteraction=false
component=com.miui.home/.launcher.Launcher
task={taskId=1 appTokens=[AppWindowToken{fe7b86b token=Token{880a1ba ActivityRecord{417064f u0 com.miui.home/.launcher.Launcher t1}}}] mdr=false}
mFillsParent=true mOrientation=1
hiddenRequested=true mClientHidden=true reportedDrawn=false reportedVisible=false
mAppStopped=true
mNumInterestingWindows=1 mNumDrawnWindows=1 inPendingTransaction=false allDrawn=true lastAllDrawn=true mIsCastMode=false)
startingData=null removed=false firstWindowDrawn=true mIsExiting=false
mMiuiConfigFlag=1
mMiuiConfigFlag=1

homeStack=Stack=0

DockedStackDividerController
mLastVisibility=false
mMinimizedDock=false
mAdjustedForIme=false
mAdjustedForDivider=false

PinnedStackController
defaultBounds=[508,1869][1036,2166]
mDefaultMinSize=297
mDefaultStackGravity=85
mDefaultAspectRatio=1.777778
movementBounds=[44,119][1036,2166]
mIsImeShowing=false
mImeHeight=0
mIsShelfShowing=false
mShelfHeight=0
mReentrySnapFraction=-1.0
mIsMinimized=false
mAspectRatio=1.777778
mMinAspectRatio=0.41841003
mMaxAspectRatio=2.39
mActions=[]
mDisplayInfo=DisplayInfo{"内置屏幕, displayId 0", uniqueId "local:19260674575326081", app 1080 x 2135, real 1080 x 2340, largest app 2135 x 2135, smallest app 1080 x 1005, mode 1, defaultMode 1, modes [{id=1, width=1080, height=2340, fps=60.000004}], colorMode 0, supportedColorModes [0, 7, 9], hdrCapabilities android.view.Display$HdrCapabilities@58609a7b, rotation 0, density 440 (403.411 x 404.326) dpi, layerStack 0, appVsyncOff 1000000, presDeadline 16666666, type BUILT_IN, address {port=129, model=0x446d7b42325b}, state ON, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS, removeMode 0}

DisplayFrames w=1080 h=2340 r=0
mStable=[0,75][1080,2210]
mStableFullscreen=[0,0][1080,2210]
mDock=[0,0][1080,2340]
mCurrent=[0,0][1080,2340]
mSystem=[0,0][1080,2340]
mContent=[0,0][1080,2340]
mVoiceContent=[0,0][1080,2340]
mOverscan=[0,0][1080,2340]
mRestrictedOverscan=[0,0][1080,2340]
mRestricted=[0,0][1080,2340]
mUnrestricted=[0,0][1080,2340]
mDisplayInfoOverscan=[0,0][0,0]
mRotatedDisplayInfoOverscan=[0,0][0,0]
mDisplayCutout=WmDisplayCutout{DisplayCutout{insets=Rect(0, 75 - 0, 0) boundingRect={Bounds=[Rect(0, 0 - 0, 0), Rect(463, 0 - 617, 75), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0)]}}, mFrameSize=1080x2340}

DisplayPolicy mCarDockEnablesAccelerometer=true mDeskDockEnablesAccelerometer=true
mDockMode=EXTRA_DOCK_STATE_UNDOCKED mLidState=LID_ABSENT
mAwake=true mScreenOnEarly=true mScreenOnFully=true
mKeyguardDrawComplete=true mWindowManagerDrawComplete=true
mHdmiPlugged=false
mLastSystemUiFlags=0x970e mResettingSystemUiFlags=0x0 mForceClearedSystemUiFlags=0x0
mShowingDream=false mDreamingLockscreen=false mDreamingSleepToken=null
mStatusBar=Window{dc9b1c u0 StatusBar} isStatusBarKeyguard=false
mNavigationBar=Window{c4aed44 u0 NavigationBar}
mNavBarOpacityMode=0
mNavigationBarCanMove=true
mNavigationBarPosition=4
mFocusedWindow=Window{fcf0a63 u0 com.xd.WuLaLaTest/com.unity3d.player.UnityPlayerActivity}
mFocusedApp=Token{fa62a85 ActivityRecord{53625ce u0 com.xd.WuLaLaTest/com.unity3d.player.UnityPlayerActivity t4678}}
mTopFullscreenOpaqueWindowState=Window{fcf0a63 u0 com.xd.WuLaLaTest/com.unity3d.player.UnityPlayerActivity}
mTopFullscreenOpaqueOrDimmingWindowState=Window{fcf0a63 u0 com.xd.WuLaLaTest/com.unity3d.player.UnityPlayerActivity}
mTopIsFullscreen=true mForceStatusBar=false mForceStatusBarFromKeyguard=false
mForceShowSystemBarsFromExternal=false
mAllowLockscreenWhenOn=false
BarController.StatusBar
mState=WINDOW_STATE_HIDDEN
mTransientBar=TRANSIENT_BAR_NONE
mContentFrame=Rect(0, 0 - 1080, 75)
BarController.NavigationBar
mState=WINDOW_STATE_HIDDEN
mTransientBar=TRANSIENT_BAR_NONE
mContentFrame=Rect(0, 2210 - 1080, 2340)
Looper state:
Looper (android.ui, tid 19) {bf5781c}
(Total messages: 0, polling=true, quitting=false)
Dump time: 2021-06-03 13:53:47.707 GMT+08:00
Package: system_server
Current looper: Looper (android.ui, tid=1736)
History of long time messages on Looper (android.ui, tid=1736):

DisplayRotation
mCurrentAppOrientation=SCREEN_ORIENTATION_PORTRAIT
mLandscapeRotation=ROTATION_90 mSeascapeRotation=ROTATION_270
mPortraitRotation=ROTATION_0 mUpsideDownRotation=ROTATION_180
mSupportAutoRotation=true
WindowOrientationListener
mEnabled=true
mCurrentRotation=ROTATION_0
mSensorType=null
mSensor={Sensor name="device_orient Wakeup", vendor="xiaomi", version=1, type=27, maxRange=1.0, resolution=1.0, power=0.001, minDelay=0}
mRate=2
OrientationSensorJudge
mDesiredRotation=-1
mProposedRotation=-1
mTouching=false
mTouchEndedTimestampNanos=856858656663535

mCarDockRotation=-1 mDeskDockRotation=-1
mUserRotationMode=USER_ROTATION_FREE mUserRotation=ROTATION_0 mAllowAllRotations=false
mDemoHdmiRotation=ROTATION_90 mDemoHdmiRotationLock=false mUndockedHdmiRotation=-1
mLidOpenRotation=-1
mFixedToUserRotation=false

InputConsumers:
name=pip_input_consumer pid=2237 user=UserHandle{0}

WindowInsetsStateController
InsetsState
InsetsSource type=TYPE_UNKNOWN_10 frame=[0,0][0,0] visible=false
InsetsSource type=TYPE_BOTTOM_TAPPABLE_ELEMENT frame=[0,2210][1080,2340] visible=false
InsetsSource type=TYPE_TOP_TAPPABLE_ELEMENT frame=[0,0][1080,75] visible=false
InsetsSource type=TYPE_RIGHT_GESTURES frame=[1080,0][1080,2340] visible=false
InsetsSource type=TYPE_LEFT_GESTURES frame=[0,0][0,2340] visible=false
InsetsSource type=TYPE_BOTTOM_GESTURES frame=[0,2210][1080,2340] visible=false
InsetsSource type=TYPE_TOP_GESTURES frame=[0,0][1080,75] visible=false
InsetsSource type=TYPE_SIDE_BAR_1 frame=[0,2210][1080,2340] visible=false
InsetsSource type=TYPE_TOP_BAR frame=[0,0][1080,75] visible=false
Control map:`

**复现步骤**
手机运行一段时间后,adb shell dumpsys window displays获取到(yosemite输入法)的分辨率异常

**预期效果**
获取到分辨率为1080x2340

**python 版本:** `python3.7`

**airtest 版本:** `1.1.7`

**设备:**
- 型号: [小米9]
- 系统: [e.g. Android 8.1]
- 分辨率:1080x2340

**其他相关环境信息**
重启手机后yosemite输入法分辨率正常

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.