Android - Disconnecting a USB OTG Keyboard while logging in cancels the login flow and returns to home screen. #1172

Closed
opened 2025-11-26 22:41:08 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @SergeantConfused on GitHub (Jan 2, 2021).

Originally assigned to: @eliykat on GitHub.

Describe the Bug

If you use an external keyboard connected via USB OTG to enter your email and master password in the Android client, and then unplug it to connect your YubiKey, the application would go back to the first screen showing 3 buttons to Log in, Create account, or Enterprise Single Sign-On.

Steps To Reproduce

  1. Connect a keyboard via USB OTG to your Android device.
  2. Open your Bitwarden application.
  3. Enter your email and master password using the keyboard.
  4. Once you're asked to use your YubiKey, please disconnect your USB OTG keyboard.

Expected Result

To remain on the same page.

Actual Result

I'm returned to the first screen, and the login flow is cancelled.

Screenshots or Videos

N/A.

Environment

  • Device: Samsung Note 10+.
  • Operating system: Android 10.
  • Build Version: 2.7.2 (3300).
  • Is this a Beta release? N.

Additional Context

N/A.

Originally created by @SergeantConfused on GitHub (Jan 2, 2021). Originally assigned to: @eliykat on GitHub. ## Describe the Bug If you use an external keyboard connected via USB OTG to enter your email and master password in the Android client, and then unplug it to connect your YubiKey, the application would go back to the first screen showing 3 buttons to Log in, Create account, or Enterprise Single Sign-On. ## Steps To Reproduce 1. Connect a keyboard via USB OTG to your Android device. 2. Open your Bitwarden application. 3. Enter your email and master password using the keyboard. 4. Once you're asked to use your YubiKey, please disconnect your USB OTG keyboard. ## Expected Result To remain on the same page. ## Actual Result I'm returned to the first screen, and the login flow is cancelled. ## Screenshots or Videos N/A. ## Environment - Device: Samsung Note 10+. - Operating system: Android 10. - Build Version: 2.7.2 (3300). - Is this a Beta release? N. ## Additional Context N/A.
Author
Owner

@fpdragon commented on GitHub (Jan 4, 2021):

I debugged into it a little bit and I noticed that the method MainActivity.OnPause() and OnCreate() is triggered.
This brought me to:
Stack Overflow

"Alternatively, you can tell Android that your app will handle "keyboard" configuration changes and it will not restart your activities when the keyboard connects/disconnects. "

I am no expert in Xamarin but I guess we have to add something like:
<activity android:configChanges="keyboard" />
somehow to the AndroidManifest.xml?! O.o
Here is the Android Java description:
Click

Maybe this could help. Right now I am too confused to do it myself. xD

@fpdragon commented on GitHub (Jan 4, 2021): I debugged into it a little bit and I noticed that the method MainActivity.OnPause() and OnCreate() is triggered. This brought me to: [Stack Overflow](https://stackoverflow.com/questions/41420025/android-app-fires-oncreate-whenever-bluetooth-keyboard-connects-disconnects) "Alternatively, you can tell Android that your app will handle "keyboard" configuration changes and it will not restart your activities when the keyboard connects/disconnects. " I am no expert in Xamarin but I guess we have to add something like: `<activity android:configChanges="keyboard" />` somehow to the AndroidManifest.xml?! O.o Here is the Android Java description: [Click](https://developer.android.com/guide/topics/resources/runtime-changes.html#RetainingAnObject) Maybe this could help. Right now I am too confused to do it myself. xD
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#1172