android icon indicating copy to clipboard operation
android copied to clipboard

biometric prompt sometimes appearts twice

Open regevbr opened this issue 2 years ago • 7 comments

Home Assistant Android version: beta-2000-2e0700f7-full Android version: 11 Phone model: OnePlus 8T Home Assistant version: core-2022.2.0b5 Last working Home Assistant release (if known): unknown Description of problem:

I have a fingerprint lock setting set. Occasionally (but noticeable) when I open the application, I get the blurred screen and the biometric prompt created at https://github.com/home-assistant/android/blob/be3b414fa97e6b83eb5e5f40e3fd9ef701b63363/app/src/main/java/io/homeassistant/companion/android/webview/WebViewActivity.kt#L877 After I perform a successful login with my fingerprint, the blur is disabled, and then the prompt appears again immediately (with the same title, which means it has to originate from the same line of code above). At this point, I can click outside of the prompt to make it go away, or I can authenticate again, in any case, I gain access to the app (as I mentioned, the blur is already gone)

**Traceback:**
01-31 23:33:01.798 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:01.798 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:01.806 28623 28623 V ViewRootImpl: The specified message queue synchronization  barrier token has not been posted or has already been removed
01-31 23:33:01.806 28623 28050 E sqlite3_android: ONEPLUS_NAME_PARTS_MATCH SQLITE_OK
01-31 23:33:01.836 28623 28623 W Choreographer: Already have a pending vsync event.  There should only be one at a time.
01-31 23:33:01.838 28623 28623 D UrlRepository: localUrl is: false and usesInternalSsid is: true
01-31 23:33:01.838 28623 28623 D UrlRepository: Using external URL
01-31 23:33:01.838 28623 28623 D UrlRepository: localUrl is: false and usesInternalSsid is: true
01-31 23:33:01.840 28623 31162 D UrlRepository: localUrl is: false and usesInternalSsid is: true
01-31 23:33:01.848 28623 28623 D DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@e11493f[LaunchActivity]
01-31 23:33:01.849 28623 28623 D ViewRootImpl[LaunchActivity]: windowFocusChanged hasFocus=true inTouchMode=true
01-31 23:33:01.870 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:01.870 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:01.874 28623 28623 D PhoneWindow: setNavigationBarColor: ff111111
01-31 23:33:01.876 28623 28623 I System.out: recordForce value 5
01-31 23:33:01.876 28623 28623 D WebviewActivity: Current webview package com.google.android.webview and version 97.0.4692.98
01-31 23:33:01.879 28623 28050 E sqlite3_android: ONEPLUS_NAME_PARTS_MATCH SQLITE_OK
01-31 23:33:01.900 28623 28623 V ViewRootImpl: The specified message queue synchronization  barrier token has not been posted or has already been removed
01-31 23:33:01.903 28623 28623 D ViewRootImpl[LaunchActivity]: windowFocusChanged hasFocus=false inTouchMode=true
01-31 23:33:01.907 28623 28623 D OpScreenModeManager: setRefreshRate parent com.google.android.exoplayer2.ui.AspectRatioFrameLayout{ae823da V.E...... ......I. 0,0-0,0 #7f0a00e6 app:id/exo_content_frame} parent width 0 parent height 0 mRatio 1.2
01-31 23:33:01.907 28623 28623 D OpScreenModeManager: setRefreshRate view android.view.SurfaceView{780e985 G.E...... ......I. 0,0-0,0} viewRate 0 width 0 height 0
01-31 23:33:01.920 28623 28623 W Choreographer: Already have a pending vsync event.  There should only be one at a time.
01-31 23:33:01.929 28623 28623 D DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@697eee8[WebViewActivity]
01-31 23:33:01.929 28623 28623 D ViewRootImpl[WebViewActivity]: windowFocusChanged hasFocus=true inTouchMode=true
01-31 23:33:01.931 28623 28050 E sqlite3_android: ONEPLUS_NAME_PARTS_MATCH SQLITE_OK
01-31 23:33:01.932 28623 31162 D SensorWorker: Updating all Sensors.
01-31 23:33:01.934 28623 28689 I WM-Processor: Moving WorkSpec (f18e0887-2907-4035-93bd-3541a5de7d6a) to the foreground
01-31 23:33:01.947 28623 28623 I WM-SystemFgDispatcher: Started foreground service Intent { act=ACTION_START_FOREGROUND cmp=io.homeassistant.companion.android/androidx.work.impl.foreground.SystemForegroundService (has extras) }
01-31 23:33:01.948 28623 28623 D UrlRepository: localUrl is: false and usesInternalSsid is: true
01-31 23:33:01.948 28623 28623 D UrlRepository: Using external URL
01-31 23:33:01.954 28623 28050 E sqlite3_android: ONEPLUS_NAME_PARTS_MATCH SQLITE_OK
01-31 23:33:02.041 28623 28623 D ViewRootImpl[WebViewActivity]: windowFocusChanged hasFocus=false inTouchMode=true
01-31 23:33:02.116 28623 17282 D LocBroadcastReceiver: High accuracy mode disabled, because bluetooth device(s) (false) not connected
01-31 23:33:02.158 28623 16295 D NextAlarm: Next alarm is scheduled by com.oneplus.deskclock with trigger time 1643697000000
01-31 23:33:02.185 28623 16295 D SensorReceiver: Nothing to update
01-31 23:33:02.185 28623 28691 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=f18e0887-2907-4035-93bd-3541a5de7d6a, tags={ io.homeassistant.companion.android.sensors.SensorWorker } ]
01-31 23:33:02.277 28623 28623 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = false
01-31 23:33:02.356 28623  9518 D WebviewActivity: External bus {"type":"config/get","id":1}
01-31 23:33:02.356 28623 28623 D WebviewActivity: externalBus({"id":1,"type":"result","success":true,"result":{"hasSettingsScreen":true,"canWriteTag":true,"hasExoPlayer":true}});
01-31 23:33:02.375 28623 28623 D UrlRepository: localUrl is: false and usesInternalSsid is: true
01-31 23:33:02.375 28623 28623 D UrlRepository: Using external URL
01-31 23:33:02.378 28623 28623 D WebviewActivity: Callback null
01-31 23:33:02.378 28623 28623 D WebviewActivity: Color from webview is "#101e24-SPACER-#111111"
01-31 23:33:02.378 28623 28623 D WebviewActivity: Color from webview is "#101e24-SPACER-#111111"
01-31 23:33:02.379 28623 16295 D WebViewPresenterImpl: Try getting color from webview color "#101e24".
01-31 23:33:02.379 28623 16295 I WebViewPresenterImpl: Found color -15720924.
01-31 23:33:02.379 28623 16295 D WebViewPresenterImpl: Try getting color from webview color "#111111".
01-31 23:33:02.379 28623 16295 I WebViewPresenterImpl: Found color -15658735.
01-31 23:33:02.381 28623 28623 D PhoneWindow: setNavigationBarColor: ff111111
01-31 23:33:02.569 28623  9518 D WebviewActivity: External bus {"type":"connection-status","payload":{"event":"connected"},"id":2}
01-31 23:33:02.569 28623 28623 E WebViewPresenterImpl: Issue getting version/notifying of security issue.
01-31 23:33:02.569 28623 28623 E WebViewPresenterImpl: java.lang.NumberFormatException: For input string: "0b4"
01-31 23:33:02.569 28623 28623 E WebViewPresenterImpl: 	at java.lang.Integer.parseInt(Integer.java:615)
01-31 23:33:02.569 28623 28623 E WebViewPresenterImpl: 	at java.lang.Integer.parseInt(Integer.java:650)
01-31 23:33:02.569 28623 28623 E WebViewPresenterImpl: 	at io.homeassistant.companion.android.webview.WebViewPresenterImpl$checkSecurityVersion$1.invokeSuspend(WebViewPresenterImpl.kt:77)
01-31 23:33:02.569 28623 28623 E WebViewPresenterImpl: 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
01-31 23:33:02.569 28623 28623 E WebViewPresenterImpl: 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
01-31 23:33:02.569 28623 28623 E WebViewPresenterImpl: 	at android.os.Handler.handleCallback(Handler.java:938)
01-31 23:33:02.569 28623 28623 E WebViewPresenterImpl: 	at android.os.Handler.dispatchMessage(Handler.java:99)
01-31 23:33:02.569 28623 28623 E WebViewPresenterImpl: 	at android.os.Looper.loop(Looper.java:233)
01-31 23:33:02.569 28623 28623 E WebViewPresenterImpl: 	at android.app.ActivityThread.main(ActivityThread.java:8030)
01-31 23:33:02.569 28623 28623 E WebViewPresenterImpl: 	at java.lang.reflect.Method.invoke(Native Method)
01-31 23:33:02.569 28623 28623 E WebViewPresenterImpl: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
01-31 23:33:02.569 28623 28623 E WebViewPresenterImpl: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
01-31 23:33:02.786 28623  9225 I 111     :  OptJank - continuously drops frames:4
01-31 23:33:02.798 28623  9518 D WebviewActivity: External bus {"type":"theme-update","id":3}
01-31 23:33:02.870 28623  9225 I 111     :  OptJank - continuously drops frames:4
01-31 23:33:02.891 28623 28623 D WebviewActivity: Color from webview is "rgba(63, 36, 75, 0.4)-SPACER-#2c2c2e"
01-31 23:33:02.891 28623 28623 D WebviewActivity: Color from webview is "rgba(63, 36, 75, 0.4)-SPACER-#2c2c2e"
01-31 23:33:02.892 28623 16295 D WebViewPresenterImpl: Try getting color from webview color "rgba(63, 36, 75, 0.4)".
01-31 23:33:02.892 28623 16295 W WebViewPresenterImpl: Could not get color from webview.
01-31 23:33:02.892 28623 16295 W WebViewPresenterImpl: java.lang.IllegalArgumentException: Unknown color
01-31 23:33:02.892 28623 16295 W WebViewPresenterImpl: 	at android.graphics.Color.parseColor(Color.java:1400)
01-31 23:33:02.892 28623 16295 W WebViewPresenterImpl: 	at io.homeassistant.companion.android.webview.WebViewPresenterImpl.parseColorWithRgb(WebViewPresenterImpl.kt:212)
01-31 23:33:02.892 28623 16295 W WebViewPresenterImpl: 	at io.homeassistant.companion.android.webview.WebViewPresenterImpl.access$parseColorWithRgb(WebViewPresenterImpl.kt:25)
01-31 23:33:02.892 28623 16295 W WebViewPresenterImpl: 	at io.homeassistant.companion.android.webview.WebViewPresenterImpl$parseWebViewColor$2.invokeSuspend(WebViewPresenterImpl.kt:187)
01-31 23:33:02.892 28623 16295 W WebViewPresenterImpl: 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
01-31 23:33:02.892 28623 16295 W WebViewPresenterImpl: 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
01-31 23:33:02.892 28623 16295 W WebViewPresenterImpl: 	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
01-31 23:33:02.892 28623 16295 W WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
01-31 23:33:02.892 28623 16295 W WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
01-31 23:33:02.892 28623 16295 W WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
01-31 23:33:02.892 28623 16295 W WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
01-31 23:33:02.892 28623 16295 W WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
01-31 23:33:02.892 28623 16295 W WebViewPresenterImpl: Couldn't get color.
01-31 23:33:02.902 28623 16295 D WebViewPresenterImpl: Try getting color from webview color "#2c2c2e".
01-31 23:33:02.904 28623 16295 I WebViewPresenterImpl: Found color -13882322.
01-31 23:33:02.909 28623  9225 I 111     :  OptJank - continuously drops frames:4
01-31 23:33:02.913 28623 28623 E WebviewActivity: Cannot set status bar color 0. Skipping coloring...
01-31 23:33:02.913 28623 28623 D PhoneWindow: setNavigationBarColor: ff2c2c2e
01-31 23:33:02.946 28623  9225 I 111     :  OptJank - continuously drops frames:4
01-31 23:33:02.986 28623  9225 I 111     :  OptJank - continuously drops frames:4
01-31 23:33:03.044 28623  9225 I 111     :  OptJank - continuously drops frames:4
01-31 23:33:03.128 28623  9225 I 111     :  OptJank - high percentage:1
01-31 23:33:03.159 28623  9225 I 111     :  OptJank - continuously drops frames:4
01-31 23:33:03.202 28623  9225 I 111     :  OptJank - continuously drops frames:4
01-31 23:33:03.277 28623  9225 I 111     :  OptJank - continuously drops frames:4
01-31 23:33:03.471 28623 28623 D WebviewActivity: Authentication successful, unlocking app
01-31 23:33:03.478 28623 28623 D DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@697eee8[WebViewActivity]
01-31 23:33:03.479 28623 28623 D ViewRootImpl[WebViewActivity]: windowFocusChanged hasFocus=true inTouchMode=true
01-31 23:33:03.483 28623 28623 D UrlRepository: localUrl is: false and usesInternalSsid is: true
01-31 23:33:03.483 28623 28623 D UrlRepository: Using external URL
01-31 23:33:04.584 28623 28050 E sqlite3_android: ONEPLUS_NAME_PARTS_MATCH SQLITE_OK
01-31 23:33:04.591 28623 28050 E sqlite3_android: ONEPLUS_NAME_PARTS_MATCH SQLITE_OK
01-31 23:33:04.600 28623 28623 D ViewRootImpl[WebViewActivity]: windowFocusChanged hasFocus=false inTouchMode=true
01-31 23:33:04.675 28623 16295 D SensorWorker: Updating all Sensors.
01-31 23:33:04.678 28623 28691 I WM-Processor: Moving WorkSpec (5d425038-61a8-4d81-add4-96785fb1481c) to the foreground
01-31 23:33:04.691 28623 28623 I WM-SystemFgDispatcher: Started foreground service Intent { act=ACTION_START_FOREGROUND cmp=io.homeassistant.companion.android/androidx.work.impl.foreground.SystemForegroundService (has extras) }
01-31 23:33:04.794 28623 28623 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = false
01-31 23:33:04.814 28623 28623 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
01-31 23:33:04.827 28623 31162 D LocBroadcastReceiver: High accuracy mode disabled, because bluetooth device(s) (false) not connected
01-31 23:33:04.845 28623 16295 D NextAlarm: Next alarm is scheduled by com.oneplus.deskclock with trigger time 1643697000000
01-31 23:33:04.865 28623 16295 D SensorReceiver: Nothing to update
01-31 23:33:04.866 28623 28658 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=5d425038-61a8-4d81-add4-96785fb1481c, tags={ io.homeassistant.companion.android.sensors.SensorWorker } ]
01-31 23:33:05.326 28623 28623 D OpScreenModeManager: setRefreshRate parent com.google.android.exoplayer2.ui.AspectRatioFrameLayout{ae823da V.E...... ......I. 0,0-0,0 #7f0a00e6 app:id/exo_content_frame} parent width 0 parent height 0 mRatio 1.2
01-31 23:33:05.327 28623 28623 D OpScreenModeManager: setRefreshRate view android.view.SurfaceView{780e985 G.E...... ......I. 0,0-0,0} viewRate 0 width 0 height 0
01-31 23:33:06.114 28623 28623 V ViewRootImpl: The specified message queue synchronization  barrier token has not been posted or has already been removed
01-31 23:33:06.128 28623 28050 E sqlite3_android: ONEPLUS_NAME_PARTS_MATCH SQLITE_OK
01-31 23:33:06.136 28623 28050 E sqlite3_android: ONEPLUS_NAME_PARTS_MATCH SQLITE_OK
01-31 23:33:06.156 28623 28623 W Choreographer: Already have a pending vsync event.  There should only be one at a time.
01-31 23:33:06.158 28623 28623 D UrlRepository: localUrl is: false and usesInternalSsid is: true
01-31 23:33:06.158 28623 28623 D UrlRepository: Using external URL
01-31 23:33:06.159 28623 28623 D UrlRepository: localUrl is: false and usesInternalSsid is: true
01-31 23:33:06.163 28623 16295 D UrlRepository: localUrl is: false and usesInternalSsid is: true
01-31 23:33:06.178 28623 28623 D DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@3af78db[LaunchActivity]
01-31 23:33:06.179 28623 28623 D ViewRootImpl[LaunchActivity]: windowFocusChanged hasFocus=true inTouchMode=true
01-31 23:33:06.204 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:06.204 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:06.208 28623 28623 D PhoneWindow: setNavigationBarColor: ff111111
01-31 23:33:06.210 28623 28623 I System.out: recordForce value 5
01-31 23:33:06.210 28623 28623 D WebviewActivity: Current webview package com.google.android.webview and version 97.0.4692.98
01-31 23:33:06.212 28623 28050 E sqlite3_android: ONEPLUS_NAME_PARTS_MATCH SQLITE_OK
01-31 23:33:06.214 28623 28050 E sqlite3_android: ONEPLUS_NAME_PARTS_MATCH SQLITE_OK
01-31 23:33:06.234 28623 28623 V ViewRootImpl: The specified message queue synchronization  barrier token has not been posted or has already been removed
01-31 23:33:06.237 28623 28623 D ViewRootImpl[LaunchActivity]: windowFocusChanged hasFocus=false inTouchMode=true
01-31 23:33:06.244 28623 28623 D OpScreenModeManager: setRefreshRate parent com.google.android.exoplayer2.ui.AspectRatioFrameLayout{8d1e013 V.E...... ......I. 0,0-0,0 #7f0a00e6 app:id/exo_content_frame} parent width 0 parent height 0 mRatio 1.2
01-31 23:33:06.244 28623 28623 D OpScreenModeManager: setRefreshRate view android.view.SurfaceView{7b17f02 G.E...... ......I. 0,0-0,0} viewRate 0 width 0 height 0
01-31 23:33:06.259 28623 28623 W Choreographer: Already have a pending vsync event.  There should only be one at a time.
01-31 23:33:06.267 28623 28623 D DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@4c26c49[WebViewActivity]
01-31 23:33:06.268 28623 28623 D ViewRootImpl[WebViewActivity]: windowFocusChanged hasFocus=true inTouchMode=true
01-31 23:33:06.270 28623 16295 D SensorWorker: Updating all Sensors.
01-31 23:33:06.272 28623 28689 I WM-Processor: Moving WorkSpec (4527c91f-d3ff-41e2-940b-5bf601e09ad9) to the foreground
01-31 23:33:06.275 28623 28623 D UrlRepository: localUrl is: false and usesInternalSsid is: true
01-31 23:33:06.275 28623 28623 D UrlRepository: Using external URL
01-31 23:33:06.297 28623 28623 I WM-SystemFgDispatcher: Started foreground service Intent { act=ACTION_START_FOREGROUND cmp=io.homeassistant.companion.android/androidx.work.impl.foreground.SystemForegroundService (has extras) }
01-31 23:33:06.354 28623 28623 D ViewRootImpl[WebViewActivity]: windowFocusChanged hasFocus=false inTouchMode=true
01-31 23:33:06.378 28623 28623 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = false
01-31 23:33:06.436 28623 17282 D LocBroadcastReceiver: High accuracy mode disabled, because bluetooth device(s) (false) not connected
01-31 23:33:06.440 28623 28623 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
01-31 23:33:06.479 28623 16295 D NextAlarm: Next alarm is scheduled by com.oneplus.deskclock with trigger time 1643697000000
01-31 23:33:06.508 28623 16295 D SensorReceiver: Nothing to update
01-31 23:33:06.509 28623 28658 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=4527c91f-d3ff-41e2-940b-5bf601e09ad9, tags={ io.homeassistant.companion.android.sensors.SensorWorker } ]
01-31 23:33:06.552 28623  9518 D WebviewActivity: External bus {"type":"config/get","id":1}
01-31 23:33:06.552 28623 28623 D WebviewActivity: externalBus({"id":1,"type":"result","success":true,"result":{"hasSettingsScreen":true,"canWriteTag":true,"hasExoPlayer":true}});
01-31 23:33:06.566 28623 28623 D UrlRepository: localUrl is: false and usesInternalSsid is: true
01-31 23:33:06.566 28623 28623 D UrlRepository: Using external URL
01-31 23:33:06.567 28623 28623 D WebviewActivity: Callback null
01-31 23:33:06.567 28623 28623 D WebviewActivity: Color from webview is "#101e24-SPACER-#111111"
01-31 23:33:06.567 28623 28623 D WebviewActivity: Color from webview is "#101e24-SPACER-#111111"
01-31 23:33:06.567 28623 16295 D WebViewPresenterImpl: Try getting color from webview color "#101e24".
01-31 23:33:06.567 28623 16295 I WebViewPresenterImpl: Found color -15720924.
01-31 23:33:06.567 28623 16295 D WebViewPresenterImpl: Try getting color from webview color "#111111".
01-31 23:33:06.567 28623 16295 I WebViewPresenterImpl: Found color -15658735.
01-31 23:33:06.568 28623 28623 D PhoneWindow: setNavigationBarColor: ff111111
01-31 23:33:06.695 28623  9518 D WebviewActivity: External bus {"type":"connection-status","payload":{"event":"connected"},"id":2}
01-31 23:33:06.695 28623 28623 E WebViewPresenterImpl: Issue getting version/notifying of security issue.
01-31 23:33:06.695 28623 28623 E WebViewPresenterImpl: java.lang.NumberFormatException: For input string: "0b4"
01-31 23:33:06.695 28623 28623 E WebViewPresenterImpl: 	at java.lang.Integer.parseInt(Integer.java:615)
01-31 23:33:06.695 28623 28623 E WebViewPresenterImpl: 	at java.lang.Integer.parseInt(Integer.java:650)
01-31 23:33:06.695 28623 28623 E WebViewPresenterImpl: 	at io.homeassistant.companion.android.webview.WebViewPresenterImpl$checkSecurityVersion$1.invokeSuspend(WebViewPresenterImpl.kt:77)
01-31 23:33:06.695 28623 28623 E WebViewPresenterImpl: 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
01-31 23:33:06.695 28623 28623 E WebViewPresenterImpl: 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
01-31 23:33:06.695 28623 28623 E WebViewPresenterImpl: 	at android.os.Handler.handleCallback(Handler.java:938)
01-31 23:33:06.695 28623 28623 E WebViewPresenterImpl: 	at android.os.Handler.dispatchMessage(Handler.java:99)
01-31 23:33:06.695 28623 28623 E WebViewPresenterImpl: 	at android.os.Looper.loop(Looper.java:233)
01-31 23:33:06.695 28623 28623 E WebViewPresenterImpl: 	at android.app.ActivityThread.main(ActivityThread.java:8030)
01-31 23:33:06.695 28623 28623 E WebViewPresenterImpl: 	at java.lang.reflect.Method.invoke(Native Method)
01-31 23:33:06.695 28623 28623 E WebViewPresenterImpl: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
01-31 23:33:06.695 28623 28623 E WebViewPresenterImpl: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
01-31 23:33:06.747 28623  9518 D WebviewActivity: External bus {"type":"theme-update","id":3}
01-31 23:33:06.750 28623 28623 D WebviewActivity: Color from webview is "rgba(63, 36, 75, 0.4)-SPACER-#2c2c2e"
01-31 23:33:06.750 28623 28623 D WebviewActivity: Color from webview is "rgba(63, 36, 75, 0.4)-SPACER-#2c2c2e"
01-31 23:33:06.750 28623 16295 D WebViewPresenterImpl: Try getting color from webview color "rgba(63, 36, 75, 0.4)".
01-31 23:33:06.750 28623 16295 W WebViewPresenterImpl: Could not get color from webview.
01-31 23:33:06.750 28623 16295 W WebViewPresenterImpl: java.lang.IllegalArgumentException: Unknown color
01-31 23:33:06.750 28623 16295 W WebViewPresenterImpl: 	at android.graphics.Color.parseColor(Color.java:1400)
01-31 23:33:06.750 28623 16295 W WebViewPresenterImpl: 	at io.homeassistant.companion.android.webview.WebViewPresenterImpl.parseColorWithRgb(WebViewPresenterImpl.kt:212)
01-31 23:33:06.750 28623 16295 W WebViewPresenterImpl: 	at io.homeassistant.companion.android.webview.WebViewPresenterImpl.access$parseColorWithRgb(WebViewPresenterImpl.kt:25)
01-31 23:33:06.750 28623 16295 W WebViewPresenterImpl: 	at io.homeassistant.companion.android.webview.WebViewPresenterImpl$parseWebViewColor$2.invokeSuspend(WebViewPresenterImpl.kt:187)
01-31 23:33:06.750 28623 16295 W WebViewPresenterImpl: 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
01-31 23:33:06.750 28623 16295 W WebViewPresenterImpl: 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
01-31 23:33:06.750 28623 16295 W WebViewPresenterImpl: 	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
01-31 23:33:06.750 28623 16295 W WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
01-31 23:33:06.750 28623 16295 W WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
01-31 23:33:06.750 28623 16295 W WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
01-31 23:33:06.750 28623 16295 W WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
01-31 23:33:06.750 28623 16295 W WebViewPresenterImpl: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
01-31 23:33:06.750 28623 16295 W WebViewPresenterImpl: Couldn't get color.
01-31 23:33:06.750 28623 16295 D WebViewPresenterImpl: Try getting color from webview color "#2c2c2e".
01-31 23:33:06.751 28623 16295 I WebViewPresenterImpl: Found color -13882322.
01-31 23:33:06.751 28623 28623 E WebviewActivity: Cannot set status bar color 0. Skipping coloring...
01-31 23:33:06.751 28623 28623 D PhoneWindow: setNavigationBarColor: ff2c2c2e
01-31 23:33:06.899 28623  9225 I 111     :  OptJank - continuously drops frames:4
01-31 23:33:06.931 28623  9225 I 111     :  OptJank - continuously drops frames:4
01-31 23:33:07.077 28623  9225 I 111     :  OptJank - continuously drops frames:4
01-31 23:33:07.077 28623  9225 I 111     :  OptJank - high percentage:0.75
01-31 23:33:07.165 28623  9225 I 111     :  OptJank - continuously drops frames:4
01-31 23:33:07.271 28623 28638 W System  : A resource failed to call destroy. 
01-31 23:33:07.271 28623 28638 W System  : A resource failed to call destroy. 
01-31 23:33:07.642 28623  9225 I 111     :  OptJank - continuously drops frames:4
01-31 23:33:07.708 28623 28623 D DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@4c26c49[WebViewActivity]
01-31 23:33:07.709 28623 28623 D ViewRootImpl[WebViewActivity]: windowFocusChanged hasFocus=true inTouchMode=true
01-31 23:33:07.762 28623 28623 D WebviewActivity: Authentication successful, unlocking app
01-31 23:33:07.764 28623 28623 D UrlRepository: localUrl is: false and usesInternalSsid is: true
01-31 23:33:07.764 28623 28623 D UrlRepository: Using external URL
01-31 23:33:07.774 28623  9225 I 111     :  OptJank - continuously drops frames:4
01-31 23:33:07.882 28623 28623 D ViewRootImpl[WebViewActivity]: windowFocusChanged hasFocus=false inTouchMode=true
01-31 23:33:07.933 28623  9225 I 111     :  OptJank - high percentage:0.7
01-31 23:33:09.513 28623 28623 D DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@4c26c49[WebViewActivity]
01-31 23:33:09.513 28623 28623 D ViewRootImpl[WebViewActivity]: windowFocusChanged hasFocus=true inTouchMode=true
01-31 23:33:09.516 28623 28623 D UrlRepository: localUrl is: false and usesInternalSsid is: true
01-31 23:33:09.516 28623 28623 D UrlRepository: Using external URL
01-31 23:33:14.741 28623  9518 D WebviewActivity: External bus {"type":"config_screen/show","id":4}
01-31 23:33:14.752 28623 28050 E sqlite3_android: ONEPLUS_NAME_PARTS_MATCH SQLITE_OK
01-31 23:33:14.767 28623 28623 D UrlRepository: Using external URL
01-31 23:33:14.767 28623 28623 I chatty  : uid=10241(io.homeassistant.companion.android) identical 2 lines
01-31 23:33:14.767 28623 28623 D UrlRepository: Using external URL
01-31 23:33:14.771 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.774 28623 28050 E sqlite3_android: ONEPLUS_NAME_PARTS_MATCH SQLITE_OK
01-31 23:33:14.775 28623 28623 V ViewRootImpl: The specified message queue synchronization  barrier token has not been posted or has already been removed
01-31 23:33:14.778 28623 28623 D ViewRootImpl[WebViewActivity]: windowFocusChanged hasFocus=false inTouchMode=true
01-31 23:33:14.807 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.810 28623 28623 I chatty  : uid=10241(io.homeassistant.companion.android) identical 42 lines
01-31 23:33:14.810 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.813 28623 28623 W Choreographer: Already have a pending vsync event.  There should only be one at a time.
01-31 23:33:14.815 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.817 28623 28623 I chatty  : uid=10241(io.homeassistant.companion.android) identical 14 lines
01-31 23:33:14.817 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.817 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.817 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.817 28623 28623 I chatty  : uid=10241(io.homeassistant.companion.android) identical 3 lines
01-31 23:33:14.817 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.827 28623 28623 D DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@6b87d8b[SettingsActivity]
01-31 23:33:14.827 28623 28623 D ViewRootImpl[SettingsActivity]: windowFocusChanged hasFocus=true inTouchMode=true
01-31 23:33:14.838 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.839 28623 28623 I chatty  : uid=10241(io.homeassistant.companion.android) identical 20 lines
01-31 23:33:14.839 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.842 28623 28050 E sqlite3_android: ONEPLUS_NAME_PARTS_MATCH SQLITE_OK
01-31 23:33:14.843 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.845 28623 28623 I chatty  : uid=10241(io.homeassistant.companion.android) identical 20 lines
01-31 23:33:14.845 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.847 28623 28050 E sqlite3_android: ONEPLUS_NAME_PARTS_MATCH SQLITE_OK
01-31 23:33:14.848 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.848 28623 28623 I chatty  : uid=10241(io.homeassistant.companion.android) identical 2 lines
01-31 23:33:14.848 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.848 28623 16295 D SensorWorker: Updating all Sensors.
01-31 23:33:14.849 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.850 28623 28623 I chatty  : uid=10241(io.homeassistant.companion.android) identical 11 lines
01-31 23:33:14.850 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.850 28623 28689 I WM-Processor: Moving WorkSpec (f1eed858-d2ee-463d-bc46-45aa7cb6b240) to the foreground
01-31 23:33:14.850 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.850 28623 28623 I chatty  : uid=10241(io.homeassistant.companion.android) identical 3 lines
01-31 23:33:14.850 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:14.856 28623 28623 I WM-SystemFgDispatcher: Started foreground service Intent { act=ACTION_START_FOREGROUND cmp=io.homeassistant.companion.android/androidx.work.impl.foreground.SystemForegroundService (has extras) }
01-31 23:33:14.898 28623 28623 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = false
01-31 23:33:14.905 28623 28623 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
01-31 23:33:14.910 28623 31162 D LocBroadcastReceiver: High accuracy mode disabled, because bluetooth device(s) (false) not connected
01-31 23:33:14.926 28623 16295 D NextAlarm: Next alarm is scheduled by com.oneplus.deskclock with trigger time 1643697000000
01-31 23:33:14.939 28623 16295 D SensorReceiver: Nothing to update
01-31 23:33:14.940 28623 28691 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=f1eed858-d2ee-463d-bc46-45aa7cb6b240, tags={ io.homeassistant.companion.android.sensors.SensorWorker } ]
01-31 23:33:15.075 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:15.076 28623 28623 I chatty  : uid=10241(io.homeassistant.companion.android) identical 12 lines
01-31 23:33:15.077 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:15.077 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:15.078 28623 28623 I chatty  : uid=10241(io.homeassistant.companion.android) identical 5 lines
01-31 23:33:15.078 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:15.078 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:15.079 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:15.081 28623 28623 I chatty  : uid=10241(io.homeassistant.companion.android) identical 20 lines
01-31 23:33:15.081 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:16.008 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:16.057 28623 28623 I chatty  : uid=10241(io.homeassistant.companion.android) identical 10 lines
01-31 23:33:16.057 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:16.066 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:16.743 28623 28623 I chatty  : uid=10241(io.homeassistant.companion.android) identical 96 lines
01-31 23:33:16.743 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:17.678 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:18.117 28623 28623 I chatty  : uid=10241(io.homeassistant.companion.android) identical 28 lines
01-31 23:33:18.117 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:18.124 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:18.218 28623 28623 I chatty  : uid=10241(io.homeassistant.companion.android) identical 105 lines
01-31 23:33:18.218 28623 28623 E mpanion.androi: Invalid ID 0x00000000.
01-31 23:33:18.242 28623 16295 D LogcatReader: Read logcat for pid 28623

Additional information:

I looked at the logs (See above traceback), and the strange thing is, that when it happens, and I use my fingerprint in the second appearance, the logline from https://github.com/home-assistant/android/blob/be3b414fa97e6b83eb5e5f40e3fd9ef701b63363/app/src/main/java/io/homeassistant/companion/android/webview/WebViewActivity.kt#L859 doesn't appear twice, which baffles me... I tried to look online and I ran roughly through the code and I can't see how this scenario is even possible... In the attached logs above, the first appearance of Authentication successful, unlocking app marks an authentication that didn't have the second appearance in it. The second appearance of Authentication successful, unlocking app is the time I opened the app and the issue happened. Please ping me if you need any more information.

regevbr avatar Feb 01 '22 09:02 regevbr

I cannot reproduce this issue, what do you have set for Session TimeOut when you enabled Lock app ? Is it on the default 0 or did you change it? Also is this device running a custom ROM?

dshokouhi avatar Feb 01 '22 13:02 dshokouhi

session timeout is set to 600 device is running a stock ROM Please see attached screen recording first try works great, second time you can see the issue (for some reason it shows blank until I log in)

https://user-images.githubusercontent.com/5775519/151980631-58a6d344-7e4b-49e5-993d-392ad08cf37b.mp4

regevbr avatar Feb 01 '22 13:02 regevbr

still cant reproduce when its set to 600 on my end, I only see the prompt once even when I follow the steps in the video. Its really strange how the prompt is missing the text like that and that it takes up the whole screen instead of partially like on my Pixel. Just out of curiosity does this still happen when you use the default theme instead of this custom one?

Edit: I see now the prompt looks like that because of the screen recording on the prompt, I see similar behavior when I take a screenshot.

dshokouhi avatar Feb 01 '22 13:02 dshokouhi

it does show the text and takes half the screen, but the recorder for some reason blacks out the screen (only in the recording) I can't even take a screenshot when the prompt is shown to prove it to you - the os blocks it haha Just tried with the default theme and it happens again :-(

regevbr avatar Feb 01 '22 14:02 regevbr

I've had this same issue for a while now. I can't remember since which version this has been going on, but from memory at least in December I have had this issue. (always up to date on the latest stable release of what is in the play store)

I'm on a Galaxy S10 btw.

RoboMagus avatar Feb 14 '22 15:02 RoboMagus

I've had this same issue for a while now. I can't remember since which version this has been going on, but from memory at least in December I have had this issue. (always up to date on the latest stable release of what is in the play store)

I'm on a Galaxy S10 btw.

Im glad I'm not alone on this!

regevbr avatar Feb 14 '22 22:02 regevbr

Pixel 6/Android 12L same issue.

*version beta-2218-e4c069f7-full

04-02 11:41:36.003 29685 29871 D WebviewActivity: External bus {"type":"connection-status","payload":{"event":"connected"},"id":2}
04-02 11:41:36.004 29685 29685 E WebViewPresenterImpl: Issue getting version/notifying of security issue.
04-02 11:41:36.004 29685 29685 E WebViewPresenterImpl: java.lang.NumberFormatException: For input string: "0b1"
04-02 11:41:36.004 29685 29685 E WebViewPresenterImpl:  at java.lang.Integer.parseInt(Integer.java:615)
04-02 11:41:36.004 29685 29685 E WebViewPresenterImpl:  at java.lang.Integer.parseInt(Integer.java:650)
04-02 11:41:36.004 29685 29685 E WebViewPresenterImpl:  at io.homeassistant.companion.android.webview.WebViewPresenterImpl$checkSecurityVersion$1.invokeSuspend(WebViewPresenterImpl.kt:77)
04-02 11:41:36.004 29685 29685 E WebViewPresenterImpl:  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
04-02 11:41:36.004 29685 29685 E WebViewPresenterImpl:  at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
04-02 11:41:36.004 29685 29685 E WebViewPresenterImpl:  at android.os.Handler.handleCallback(Handler.java:938)
04-02 11:41:36.004 29685 29685 E WebViewPresenterImpl:  at android.os.Handler.dispatchMessage(Handler.java:99)
04-02 11:41:36.004 29685 29685 E WebViewPresenterImpl:  at android.os.Looper.loopOnce(Looper.java:201)
04-02 11:41:36.004 29685 29685 E WebViewPresenterImpl:  at android.os.Looper.loop(Looper.java:288)
04-02 11:41:36.004 29685 29685 E WebViewPresenterImpl:  at android.app.ActivityThread.main(ActivityThread.java:7870)
04-02 11:41:36.004 29685 29685 E WebViewPresenterImpl:  at java.lang.reflect.Method.invoke(Native Method)
04-02 11:41:36.004 29685 29685 E WebViewPresenterImpl:  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
04-02 11:41:36.004 29685 29685 E WebViewPresenterImpl:  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
04-02 11:41:36.045 29685 29871 D WebviewActivity: External bus {"type":"theme-update","id":3}
04-02 11:41:36.046 29685 29685 D WebviewActivity: Color from webview is "#101e24-SPACER-#111111"
04-02 11:41:36.046 29685 29685 D WebviewActivity: Color from webview is "#101e24-SPACER-#111111"
04-02 11:41:36.046 29685 29867 D WebViewPresenterImpl: Try getting color from webview color "#101e24".
04-02 11:41:36.047 29685 29867 I WebViewPresenterImpl: Found color -15720924.
04-02 11:41:36.047 29685 29867 D WebViewPresenterImpl: Try getting color from webview color "#111111".
04-02 11:41:36.047 29685 29867 I WebViewPresenterImpl: Found color -15658735.
04-02 11:41:37.114 29685 29685 D WebviewActivity: Authentication successful, unlocking app
04-02 11:41:37.133 29685 29685 D UrlRepository: localUrl is: true and usesInternalSsid is: true
04-02 11:41:37.134 29685 29685 D UrlRepository: Using internal URL
04-02 11:41:38.970 29685 29685 D UrlRepository: localUrl is: true and usesInternalSsid is: true
04-02 11:41:38.971 29685 29685 D UrlRepository: Using internal URL
04-02 11:41:40.882 29685 29685 W Choreographer: Frame time is 0.006928 ms in the future!  Check that graphics HAL is generating vsync timestamps using the correct timebase.
04-02 11:41:43.530 29685 29871 D WebviewActivity: External bus {"type":"config_screen/show","id":4}
04-02 11:41:43.560 29685 29685 D UrlRepository: Using external URL
04-02 11:41:43.560 29685 29685 D UrlRepository: Using external URL
04-02 11:41:43.560 29685 29685 D UrlRepository: Using internal URL
04-02 11:41:43.560 29685 29685 D UrlRepository: Using internal URL
04-02 11:41:43.568 29685 29685 I ContentCaptureHelper: Setting logging level to OFF
04-02 11:41:43.622 29685 29685 E mpanion.androi: Invalid ID 0x00000000.
04-02 11:41:43.622 29685 29685 W TextView: onProvideContentCaptureStructure(): calling assumeLayout()
04-02 11:41:43.622 29685 29685 E mpanion.androi: Invalid ID 0x00000000.
04-02 11:41:43.622 29685 29685 E mpanion.androi: Invalid ID 0x00000000.
04-02 11:41:43.622 29685 29685 E mpanion.androi: Invalid ID 0x00000000.
04-02 11:41:43.622 29685 29685 E mpanion.androi: Invalid ID 0x00000000.
04-02 11:41:43.622 29685 29685 E mpanion.androi: Invalid ID 0x00000000.
04-02 11:41:43.623 29685 29685 W TextView: onProvideContentCaptureStructure(): calling assumeLayout()
04-02 11:41:43.623 29685 29685 E mpanion.androi: Invalid ID 0x00000000.
04-02 11:41:43.623 29685 29685 E mpanion.androi: Invalid ID 0x00000000.
04-02 11:41:43.623 29685 29685 W TextView: onProvideContentCaptureStructure(): calling assumeLayout()
04-02 11:41:43.623 29685 29685 E mpanion.androi: Invalid ID 0x00000000.
04-02 11:41:43.623 29685 29685 E mpanion.androi: Invalid ID 0x00000000.
04-02 11:41:43.623 29685 29685 E mpanion.androi: Invalid ID 0x00000000.
04-02 11:41:43.623 29685 29685 W TextView: onProvideContentCaptureStructure(): calling assumeLayout()
04-02 11:41:43.623 29685 29685 E mpanion.androi: Invalid ID 0x00000000.
04-02 11:41:43.623 29685 29685 W TextView: onProvideContentCaptureStructure(): calling assumeLayout()
04-02 11:41:43.645 29685 29685 E mpanion.androi: Invalid ID 0x00000000.
04-02 11:41:43.645 29685 29685 E mpanion.androi: Invalid ID 0x00000000.
04-02 11:41:43.647 29685 29867 D SensorWorker: Updating all Sensors.
04-02 11:41:43.647 29685 29765 I WM-Processor: Moving WorkSpec (b21495cf-85aa-473d-9558-4d9616a6cb83) to the foreground
04-02 11:41:43.651 29685 29685 I WM-SystemFgDispatcher: Started foreground service Intent { act=ACTION_START_FOREGROUND cmp=io.homeassistant.companion.android/androidx.work.impl.foreground.SystemForegroundService (has extras) }
04-02 11:41:43.673 29685 29867 D SensorReceiver: Nothing to update

leroyloren avatar Apr 02 '22 09:04 leroyloren

Just wanted to check in and see if this is still an issue for those experiencing it on the latest app version.

dshokouhi avatar Dec 22 '22 04:12 dshokouhi

To be perfectly honest - I got used to it so much that I didn't notice if it was fixed or not :-) I just run a couple of checks and it seems to have been fixed, but I think that the behavior was sporadic to begin with. I will close the issue for now and report back if something changes.

regevbr avatar Dec 22 '22 08:12 regevbr

I've found that this occasionally stil occurs. So I would not call it 'fixed'.

Though since the biometric bypass on home networks was implemented interaction with the biometric prompt was reduced a lot, which just makes it a lot less annoying.

RoboMagus avatar Dec 22 '22 08:12 RoboMagus

At this point the only thing I can think of is to add a log statement here to see if the double prompt is actually coming from us or not. If we only see 1 log line here then I would assume the bug is in the library or the device.

https://github.com/home-assistant/android/blob/master/app/src/main/java/io/homeassistant/companion/android/webview/WebViewActivity.kt#L992

dshokouhi avatar Dec 22 '22 17:12 dshokouhi

Been experiencing the same issue here for awhile. On both my old S22+ and now on my Pixel 7 Pro.

CZonin avatar Jan 04 '23 13:01 CZonin

Is this still an issue on the latest version of the app? A lot of this was reworked due to multiserver support and dependency updates.

jpelgrom avatar Jul 25 '23 21:07 jpelgrom

Didn't noticed it for a long while now so I guess it is solved :-)

regevbr avatar Jul 26 '23 07:07 regevbr

Just wanted to mention that this seems to be happening again.

CZonin avatar Aug 29 '23 17:08 CZonin

Then it's not just me

RoboMagus avatar Aug 29 '23 18:08 RoboMagus

re-opening, can someone please get updated logs? I think we have had a bit of changes in this area since logs were last shown so would be good to see if anything changed.

dshokouhi avatar Aug 29 '23 18:08 dshokouhi

I managed to reproduce for logging purposes, but when attempting to export the log from the companion app I just get null saved to the file somehow. And for sharing to google keep I get a message that states that this type of file format is not supported.

I recall both methods to have worked previously though... Any advice on this?

I'm on version 2023.8.2.

Edit: Mailing the log to myself seemed to work. I've trimmed the log to roughly the occurence of the duplicate biometric prompt. Notable is that the second time the UI is not blurred. Hope this log snippet helps out: ~~Link removed~~

RoboMagus avatar Aug 29 '23 19:08 RoboMagus

hmm dont see anything helpful there, might need to add some more logging around when we show the dialog in the activity 🤔

dshokouhi avatar Aug 29 '23 19:08 dshokouhi

You said that you managed to reproduce the issue - can you describe how you reproduced it? If it is relatively easy or there is a specific set of circumstances that create it, that might be enough information to fix it.

jpelgrom avatar Aug 29 '23 19:08 jpelgrom

Indeed. I had managed to reproduce it 3 times since yesterday. It's a finicky thing though as I'm trying again now and am unable to do so 🤔.

But I believe the duplicate biometric prompt to be best reproducible after having fully closed the app (i.e. cold starting it). Then upon the first popup of the biometric prompt quickly validate it (before the UI is fully loaded). Then shortly after the UI is loaded a new biometric prompt may appear. This time without the blurring.

Currently building a test app with additional logging on this branch: biometric_prompt_logging. To see if that could provide more insight.

RoboMagus avatar Aug 30 '23 11:08 RoboMagus

Even with additional logging there's hardly anything to go on. One thing that might be worth mentioning is that the secondary biometric prompt does not seem to be attached to anything somehow. When pressing the return button and thus canceling the authenticator I would expect the app to close, but the only logline following the canceled prompt is the following:

08-30 20:40:14.170 24508 24719 I BiometricPrompt: onError: 10, 0

Without being followed by anything related to the callback handling of authenticationResult (Or any logging by authenticationResult handlers of other activities for that matter). I'm not well acquainted with the ins and outs of Android but in the event of an orphaned callback I would expect some form of error logging. But none of that is present either.

RoboMagus avatar Aug 30 '23 19:08 RoboMagus

So when you added logging here where we actually open the biometric prompt you only saw 1 log line to show the actual prompt?

https://github.com/home-assistant/android/blob/master/app/src/main/java/io/homeassistant/companion/android/webview/WebViewActivity.kt#L1052

dshokouhi avatar Aug 30 '23 19:08 dshokouhi

also I wonder if its a bug in the library that we may be hitting if we dont see our log lines show up twice as expected. Looking at the issue tracker my search doesnt show anything but there are quite a bit of bugs. Maybe if we dont see our own logging there could be logging from the library to show where it got called from again.

https://issuetracker.google.com/issues?q=status:open%20componentid:559537

dshokouhi avatar Aug 30 '23 19:08 dshokouhi

So when you added logging here where we actually open the biometric prompt you only saw 1 log line to show the actual prompt?

The logging for unlockAppIfNeeded does show up 3 times, one of which it's unlocked and twice where it seems to find itself locked.

...
08-30 20:40:09.892 24508 24508 I ViewRootImpl@1546730[LaunchActivity]: Relayout returned: old=(0,0,1080,2280) new=(0,0,1080,2280) req=(1080,2280)8 dur=5 res=0x5 s={false 0} ch=true fn=4
08-30 20:40:09.932 24508 24508 D InsetsSourceConsumer: ensureControlAlpha: for ITYPE_NAVIGATION_BAR on io.homeassistant.companion.android.debug/io.homeassistant.companion.android.webview.WebViewActivity
08-30 20:40:09.932 24508 24508 D InsetsSourceConsumer: ensureControlAlpha: for ITYPE_STATUS_BAR on io.homeassistant.companion.android.debug/io.homeassistant.companion.android.webview.WebViewActivity
08-30 20:40:09.934 24508 24508 I ViewRootImpl@1546730[LaunchActivity]: stopped(true) old=false
08-30 20:40:09.947 24508 24553 D OpenGLRenderer: setSurface called with nullptr
08-30 20:40:09.947 24508 24508 I ViewRootImpl@1546730[LaunchActivity]: dispatchDetachedFromWindow
08-30 20:40:09.955 24508 24508 D InputTransport: Input channel destroyed: '480e121', fd=101
08-30 20:40:09.955 24508 24508 I ViewRootImpl@36ed57b[WebViewActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
08-30 20:40:09.957 24508 24508 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
08-30 20:40:09.959 24508 24508 D WebViewPresenterImpl: WebViewPresenter::isAppLocked(). serverId: 1
08-30 20:40:09.960 24508 24508 D AuthRepo: AuthenticationRepository::isLockEnabled(). raw: true
08-30 20:40:09.960 24508 24508 D IntegrationRepository: isAppLocked(): true. (ServerId: 1, LockEnabled: true, appActive: false, expireMillis: 0, currentMillis: 1693420809960)
08-30 20:40:09.960 24508 24508 D WebviewActivity: unlockAppIfNeeded() appLocked: true
... [chromium / renderscript spam]
--------- beginning of system
08-30 20:40:11.251 24508 24528 I BiometricPrompt: onAuthenticationSucceeded: 2
08-30 20:40:11.609 24508 24669 D RenderScript: [RS-DIAG] Launching GPU kernel intrinsic : id(5) 153 0x6f195364b0
08-30 20:40:11.610 24508 24669 D RenderScript: [RS-DIAG] Launching GPU kernel intrinsic : id(5) 154 0x6f195364b0
08-30 20:40:11.651 24508 24508 I ViewRootImpl@36ed57b[WebViewActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
08-30 20:40:11.659 24508 24508 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
08-30 20:40:11.661 24508 24508 D WebViewPresenterImpl: WebViewPresenter::isAppLocked(). serverId: 1
08-30 20:40:11.662 24508 24508 D AuthRepo: AuthenticationRepository::isLockEnabled(). raw: true
08-30 20:40:11.662 24508 24508 D IntegrationRepository: isAppLocked(): true. (ServerId: 1, LockEnabled: true, appActive: false, expireMillis: 0, currentMillis: 1693420811662)
08-30 20:40:11.662 24508 24508 D WebviewActivity: unlockAppIfNeeded() appLocked: true
08-30 20:40:11.676 24508 24508 D InputMethodManager: startInputInner - Id : 0
08-30 20:40:11.676 24508 24508 I InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
08-30 20:40:11.682 24508 24508 D WebviewActivity: Authentication successful, unlocking app: Webview
08-30 20:40:11.683 24508 24508 D IntegrationRepository: setAppActive(): true
... [chromium spam]
08-30 20:40:14.170 24508 24719 I BiometricPrompt: onError: 10, 0
08-30 20:40:14.202 24508 24508 D InsetsSourceConsumer: ensureControlAlpha: for ITYPE_NAVIGATION_BAR on io.homeassistant.companion.android.debug/io.homeassistant.companion.android.webview.WebViewActivity
08-30 20:40:14.204 24508 24508 D InsetsSourceConsumer: ensureControlAlpha: for ITYPE_STATUS_BAR on io.homeassistant.companion.android.debug/io.homeassistant.companion.android.webview.WebViewActivity
08-30 20:40:14.221 24508 24508 I ViewRootImpl@36ed57b[WebViewActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
...

I should look back in old logs if this --------- beginning of system line shows up there as well as that strikes me as out of place when all runs well.

RoboMagus avatar Aug 30 '23 19:08 RoboMagus

The logging for unlockAppIfNeeded does show up 3 times,

Interesting then that means we are probably getting notified about multiple window focus changes which may be causing an edge case?

https://github.com/home-assistant/android/blob/a9b7dfdb6875366f67a8c167c0c83167bb95f2ef/app/src/main/java/io/homeassistant/companion/android/webview/WebViewActivity.kt#L1030-L1033

Maybe we need to add a check to see if the prompt is shown to prevent multiple calls from being sent?

The only other location we call this method seems less likely to be the cause

https://github.com/home-assistant/android/blob/a9b7dfdb6875366f67a8c167c0c83167bb95f2ef/app/src/main/java/io/homeassistant/companion/android/webview/WebViewPresenterImpl.kt#L134-L141

dshokouhi avatar Aug 30 '23 19:08 dshokouhi

From my previous testing it seems that the switchActiveServer is not involved in this issue, so it must be all in the webview activity.

I'll add a check to see if an unlock is already in progress to the onWindowFocusChanged logging to see what's going on there. However the underlying problem i believe would be that shortly after unlocking the app, somehow the integrationrepository isAppLocked() function will return true again. It'd be interesting to find out what's causing that to happen.

RoboMagus avatar Aug 31 '23 07:08 RoboMagus

After some more tinkering and a whole lot of logs it turns out that while the biometric prompt is open (or perhaps when its closing after success) another window focus changed event can happen. Though in regular operation multiple onWindowFocusChanged calls have been observed, this is correctly handled as after an unlock the applock state is seen correctly and no additional biometric prompt is shown. However when this occurs during the unlocking the app will report to be still locked and hence may trigger another biometric prompt. This all seems to indicate some form of a race condition in the asynchronous handling of Androids app lifecycle I guess.

I've added a flag to the WebviewActivity that indicates when there is a pending unlock happening which is checked before triggering the biometric prompt. After checking the logs after a day of testing, this looks like a working fix for this issue.

I'll open up a clean PR after removing all the redundant test logging.

RoboMagus avatar Sep 04 '23 12:09 RoboMagus

app: 2023.10.2-full android: 9

Behavior wasn't changed to me: if you didn’t hit the first biometrics appearing, you will have to wait for the second one. It happens only when I start the app first time. Didn't have experience in reporting bugs for android, so point me please how I can grab logs, etc

mpc-hc64_eTJnSHpkM2

ech0-py avatar Oct 22 '23 09:10 ech0-py