Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for app restart when BT keyboard is connected in some devices #1718

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

5r1m
Copy link
Contributor

@5r1m 5r1m commented Jun 20, 2024

Platforms affected

From API 13

Motivation and Context

To avoid app restart on connecting/disconnecting BT keyboard in some devices. Issue is faced by many and is also described here: https://stackoverflow.com/questions/25735227/bluetooth-keyboard-will-cause-activity-destroy-and-recreate/27238892#27238892

There is no easy way to extend this using config's.

Description

In some devices (especially pixel) connecting with BT keyboard is resulting in application being restarted. The existing "keyboard" seems to be not sufficient as in this case it was triggering "navigation" change.

Testing

Tested on problematic devices by connecting and disconnecting keyboards

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

…avigation" as application is restarted when BT keyboard is connected in some devices

In some devices (especially pixel) connecting with BT keyboard is resulting in application being restarted. The existing "keyboard" seems to be not sufficient as in this case it was triggering "navigation" change.

https://stackoverflow.com/questions/25735227/bluetooth-keyboard-will-cause-activity-destroy-and-recreate/27238892#27238892
@5r1m 5r1m changed the title Update AndroidManifest.xml by extending android:configChanges with "navigation" as application is restarted when BT keyboard is connected in some devices Fix for app restart when BT keyboard is connected in some devices Jun 20, 2024
Copy link
Contributor

@breautek breautek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@breautek breautek added this to the 13.0.1 milestone Jun 20, 2024
@breautek breautek added the bug label Jun 20, 2024
@breautek
Copy link
Contributor

If there are no objections I'll merge sometime next week. Or earlier if I have other green votes.

I do not believe this is a breaking change.

https://developer.android.com/guide/topics/manifest/activity-element#config states:

TA change to the navigation type (trackball or D-pad). Normally, this does not happen.

For the "navigation". Cordova apps primarily operate in the webview, the webview should be able to handle input changes dynamically.

Copy link
Member

@dpogue dpogue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@breautek breautek merged commit 3503bfa into apache:master Jun 24, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants