airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
200 stars 11 forks source link

[ISSUE] Focus issue using StageText #3330

Open bobaoapae opened 2 months ago

bobaoapae commented 2 months ago

After latest AIR update, using contentType on StageText cause focus issue on some devices when the autofill promp appers on the screen.

Check video, this don't happen on all devices, and even same devices (same model) I can't reproduce all time.

I have one device that i can use to test if @ajwfrost has any clue about that.

https://github.com/airsdk/Adobe-Runtime-Support/assets/33332428/f0cf0299-0b56-4c58-871a-d18cef60561b

bobaoapae commented 1 month ago

Hey @ajwfrost I'm able to reproduce this now. Something changed on the focus logic and it's causing issue when the fill prompt appers, even without using contentType.

This issue only happen with the auto fill enabled and using some old keyboard that don't support new google auto fill on keyboard, this way a popup it's show over the app to select the combination of username/password for the app. When this popup appers Air application trigger resize/focus events that cause the popup to be hidden but this also hide the keyboard.

bobaoapae commented 1 month ago
07-24 14:53:53.155 I/InputDispatcher( 2725): Delivering key to (13970): action: 0x1 (0), f=0x0, m=0x0, d=0, '25e5dcd'
07-24 14:53:53.162 I/ViewRootImpl@4b900eb[AIRAppEntry](13970): ViewPostIme key 1
07-24 14:53:53.165 I/InputDispatcher( 2725): Delivering key to (13970): action: 0x1 (0), f=0x0, m=0x0, d=0, '25e5dcd'
07-24 14:53:53.165 I/ViewRootImpl@4b900eb[AIRAppEntry](13970): ViewPostIme key 107-24 14:53:57.680 I/InputDispatcher( 2725): Delivering touch to (13970): action: 0x0, f=0x0, d=0, '25e5dcd', t=1 +(0,1080)07-24 14:53:57.680 I/ViewRootImpl@4b900eb[AIRAppEntry](13970): ViewPostIme pointer 0
07-24 14:53:57.681 D/AIRWindowSurfaceView(13970): *** *** onFocusChanged: AIR
07-24 14:53:57.696 D/MyAneExtensionContext(13970): TextInputNativeWrapper:focusChange: focusIn
07-24 14:53:57.697 D/InputMethodManager(13970): startInputInner - Id : 0
07-24 14:53:57.697 I/InputMethodManager(13970): startInputInner - mService.startInputOrWindowGainedFocus
07-24 14:53:57.699 D/CompatibilityChangeReporter(13970): Compat change id reported: 163400105; UID 10704; state: ENABLED
07-24 14:53:57.713 I/AssistStructure(13970): Flattened final assist data: 744 bytes, containing 1 windows, 3 views
07-24 14:53:57.808 I/ViewRootImpl@4b900eb[AIRAppEntry](13970): ViewPostIme pointer 1
07-24 14:53:57.809 I/IMM_LC  (13970): showSoftInput(View,I)
07-24 14:53:57.809 I/IMM_LC  (13970): ssi() - flag : 0 view : br.com.redesurftank.android reason = SHOW_SOFT_INPUT
07-24 14:53:57.809 I/InputDispatcher( 2725): Delivering touch to (13970): action: 0x1, f=0x0, d=0, '25e5dcd', t=1 +(0,1080)
07-24 14:53:57.825 W/OnBackInvokedCallback(13970): OnBackInvokedCallback is not enabled for the application.
07-24 14:53:57.825 W/OnBackInvokedCallback(13970): Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
07-24 14:53:57.832 D/InsetsController(13970): onStateChanged: InsetsState: {mDisplayFrame=Rect(0, 0 - 2340, 1080), mDisplayCutout=DisplayCutout{insets=Rect(81, 0 - 0, 0) waterfall=Insets{left=0, top=0, right=0, bottom=0} boundingRect={Bounds=[Rect(0, 512 - 81, 568), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0)]} cutoutPathParserInfo={CutoutPathParserInfo{displayWidth=1080 displayHeight=2340 physicalDisplayWidth=1080 physicalDisplayHeight=2340 density={3.0} cutoutSpec={M 0,0 H -9.333333333333333‬ V 27 H 9.333333333333333‬ V 0 H 0 Z @dp} rotation={1} scale={1.0} physicalPixelDisplaySizeRatio={1.0}}}}, mRoundedCorners=RoundedCorners{[RoundedCorner{position=TopLeft, radius=102, center=Point(102, 102)}, RoundedCorner{position=TopRight, radius=102, center=Point(2238, 102)}, RoundedCorner{position=BottomRight, radius=102, center=Point(2238, 978)}, RoundedCorner{position=BottomLeft, radius=102, center=Point(102, 978)}]}  mRoundedCornerFrame=Rect(0, 0 - 2340, 1080), mPrivacyIndicatorBounds=PrivacyIndicatorBounds {static bounds=Rect(2076, 0 - 2208, 72) rotation=1}, mSources= { InsetsSource: {mType=ITYPE_STATUS_BAR, mFrame=[0,0][2340,72], mVisible=false, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_NAVIGATION_BAR, mFrame=[2196,0][2340,1080], mVisible=false, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_LEFT_GESTURES, mFrame=[0,0][81,1080], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_RIGHT_GESTURES, mFrame=[2340,0][2340,1080], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_TOP_MANDATORY_GESTURES, mFrame=[0,0][2340,72], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_BOTTOM_MANDATORY_GESTURES, mFrame=[2196,0][2340,1080], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_LEFT_DISPLAY_CUTOUT, mFrame=[0,0][81,1080], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_TOP_DISPLAY_CUTOUT, mFrame=[0,0][2340,-100000], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_RIGHT_DISPLAY_CUTOUT, mFrame=[100000,0][2340,1080], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_BOTTOM_DISPLAY_CUTOUT, mFrame=[0,100000][2340,1080], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_TOP_TAPPABLE_ELEMENT, mFrame=[0,0][2340,72], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_BOTTOM_TAPPABLE_ELEMENT, mFrame=[2196,0][2340,1080], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_IME, mFrame=[81,1023][2196,1080], mVisible=false, mInsetsRoundedCornerFrame=false} } host=br.com.redesurftank.android/br.com.redesurftank.android.AIRAppEntry from=android.view.ViewRootImpl$ViewRootHandler.handleMessageImpl:6736
07-24 14:53:57.832 I/ViewRootImpl@4b900eb[AIRAppEntry](13970): Resizing android.view.ViewRootImpl@2cce6f4: frame = [0,0][2340,1080] reportDraw = false forceLayout = false syncSeqId = 0
07-24 14:53:57.833 D/InsetsController(13970): onStateChanged: InsetsState: {mDisplayFrame=Rect(0, 0 - 2340, 1080), mDisplayCutout=DisplayCutout{insets=Rect(81, 0 - 0, 0) waterfall=Insets{left=0, top=0, right=0, bottom=0} boundingRect={Bounds=[Rect(0, 512 - 81, 568), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0)]} cutoutPathParserInfo={CutoutPathParserInfo{displayWidth=1080 displayHeight=2340 physicalDisplayWidth=1080 physicalDisplayHeight=2340 density={3.0} cutoutSpec={M 0,0 H -9.333333333333333‬ V 27 H 9.333333333333333‬ V 0 H 0 Z @dp} rotation={1} scale={1.0} physicalPixelDisplaySizeRatio={1.0}}}}, mRoundedCorners=RoundedCorners{[RoundedCorner{position=TopLeft, radius=102, center=Point(102, 102)}, RoundedCorner{position=TopRight, radius=102, center=Point(2238, 102)}, RoundedCorner{position=BottomRight, radius=102, center=Point(2238, 978)}, RoundedCorner{position=BottomLeft, radius=102, center=Point(102, 978)}]}  mRoundedCornerFrame=Rect(0, 0 - 2340, 1080), mPrivacyIndicatorBounds=PrivacyIndicatorBounds {static bounds=Rect(2076, 0 - 2208, 72) rotation=1}, mSources= { InsetsSource: {mType=ITYPE_STATUS_BAR, mFrame=[0,0][2340,72], mVisible=false, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_NAVIGATION_BAR, mFrame=[2196,0][2340,1080], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_LEFT_GESTURES, mFrame=[0,0][81,1080], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_RIGHT_GESTURES, mFrame=[2340,0][2340,1080], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_TOP_MANDATORY_GESTURES, mFrame=[0,0][2340,72], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_BOTTOM_MANDATORY_GESTURES, mFrame=[2196,0][2340,1080], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_LEFT_DISPLAY_CUTOUT, mFrame=[0,0][81,1080], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_TOP_DISPLAY_CUTOUT, mFrame=[0,0][2340,-100000], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_RIGHT_DISPLAY_CUTOUT, mFrame=[100000,0][2340,1080], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_BOTTOM_DISPLAY_CUTOUT, mFrame=[0,100000][2340,1080], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_TOP_TAPPABLE_ELEMENT, mFrame=[0,0][2340,72], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_BOTTOM_TAPPABLE_ELEMENT, mFrame=[2196,0][2340,1080], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_IME, mFrame=[81,1023][2196,1080], mVisible=false, mInsetsRoundedCornerFrame=false} } host=br.com.redesurftank.android/br.com.redesurftank.android.AIRAppEntry from=android.view.ViewRootImpl$ViewRootHandler.handleMessageImpl:6723
07-24 14:53:57.833 I/ViewRootImpl@4b900eb[AIRAppEntry](13970): handleResized, msg = 4 frames=ClientWindowFrames{frame=[0,0][2340,1080] display=[0,0][2340,1080] parentFrame=[0,0][0,0] parentClippedByDisplayCutout=false} forceNextWindowRelayout=false displayId=0 resizeMode=-1 frameChanged=false displayFrameChanged=false configChanged=false displayChanged=false
07-24 14:53:57.833 I/MyAneExtensionContext(13970): onSystemUiVisibilityChange: 5
07-24 14:53:57.833 I/ViewRootImpl@4b900eb[AIRAppEntry](13970): Resizing android.view.ViewRootImpl@2cce6f4: frame = [0,0][2340,1080] reportDraw = false forceLayout = false syncSeqId = 0
07-24 14:53:57.836 I/MyAneExtensionContext(13970): onApplyWindowInsets: androidx.core.view.WindowInsetsCompat@dcf850cf
07-24 14:53:57.836 I/ViewRootImpl@4b900eb[AIRAppEntry](13970): handleResized, msg = 4 frames=ClientWindowFrames{frame=[0,0][2340,1080] display=[0,0][2340,1080] parentFrame=[0,0][0,0] parentClippedByDisplayCutout=false} forceNextWindowRelayout=false displayId=0 resizeMode=-1 frameChanged=false displayFrameChanged=false configChanged=false displayChanged=false
07-24 14:53:57.855 I/ViewRootImpl@4b900eb[AIRAppEntry](13970): MSG_WINDOW_FOCUS_CHANGED 0 0
07-24 14:53:57.855 D/AIRWindowSurfaceView(13970): *** *** onFocusChanged: AIR
07-24 14:53:57.856 D/MyAneExtensionContext(13970): TextInputNativeWrapper:focusChange: focusOut
07-24 14:53:57.857 D/MyAneExtensionContext(13970): TextInputNativeWrapper:focusChange: possible focus issue due to auto fill
07-24 14:53:57.857 D/AIRWindowSurfaceView(13970): showSoftKeyboard show: false

relevant logs from logcat

bobaoapae commented 1 month ago

https://github.com/user-attachments/assets/a49fc6b3-ef20-4052-89bb-15988c8832ae

Video from pixel 8 android 14.

I can reproduce on s23 ultra android 13/14 also.

bobaoapae commented 1 month ago

The pop up that show the password autofill option cause AIR to lose focus.

bobaoapae commented 1 month ago

Manually edditing AndroidActivityWrapper

from

public void onWindowFocusChanged(boolean hasFocus) {
       sendOnFocusListener(hasFocus);
}

to

public void onWindowFocusChanged(boolean hasFocus) {
}

fix the issue, but i suspect this change broken the new features added about focus/activate/deactivate on NativeWindow for android.

check video bellow:

https://github.com/user-attachments/assets/fe6776fb-5b9d-42ff-bb38-0ba686e290c9

bobaoapae commented 1 month ago

@ajwfrost can you take a look? I'm unable to use new releases with that issue. I will have to manually edit the .jar file to "fix" this problem.

bobaoapae commented 3 weeks ago

https://github.com/user-attachments/assets/3c639b08-fb8f-4356-b3eb-3c6750032314