lbryio / lbry-android

The LBRY Android app
MIT License
2.43k stars 113 forks source link

App reloads when device is connected to phone #1191

Open keikari opened 3 years ago

keikari commented 3 years ago
## The Issue When connecting/disconnecting a wireless USB keyboard receiver on android's micro-USB port, while the screen is on, the app reloads. (Green screen with text LBRY). User reported about same behaviour happening when connecting/disconnecting to Bluetooth headset or to a car. I wasn't able to reproduce issue with my Bluetooth headsets. ### Steps to reproduce 1. Have an android device that supports USB-OTG and USB keyboard (some Bluetooth devices may work too) 2. Start the app 3. Connect/disconnect the choice of device to the phone, while the screen is on and app is active. 4. App reloads ### Expected behaviour When connecting a device to the phone, the app should just keep doing what it was doing, without reloading, ### Actual behaviour When connecting a device to the phone, the app reloads. ## System Configuration - Device: Samsung Galaxy j5 2016 User reporting similar issue with Bluetooth had: LG wing - Android version: Android 10 User reporting similar issue with Bluetooth had: Android 10 - App version: 0.17.0 ## Anything Else

Sounds similar to this issue https://stackoverflow.com/questions/23311748/my-webview-reloads-when-bluetooth-disconnects-or-reconnects If the above is the fix, probably adding also "uiMode" will fix issues when connecting to car. (I wasn't able to build app, so couldn't test)

Screenshots

Internal Use

Acceptance Criteria

1. 2. 3.

Definition of Done

tlundgren commented 3 years ago

Have you tried with the F-Droid repository?

I could not build the app, either - the download of a certain dependency failed, and I could not get the file manually either, but in F-Droid the version is different, and downloads normally. Note that in F-Droid the version of the app is nevertheless 0.17.0, which is the one currently available in Google Play Store.

It may be useful to, at least, run some initial tests.

keikari commented 3 years ago

Good idea, I was able to build f-droid version. My keyboard also had trackpad so adding just "keyboard" didn't fixed it.

Adding these navigation|touchscreen|keyboard|uiMode to the L29 on https://github.com/lbryio/lbry-fdroid/blob/master/app/src/main/AndroidManifest.xml#L29 fixed it. I can connect/disconnect my keyboard and app doesn't reload. All of those probably weren't necessary for me.

This may not be a proper fix, so I'll just leave this in here for now.