apache / apache/cordova-plugin-screen-orientation
Orientation not working on Android
- Dominant language
- JavaScript
- Stars
- 219
- Forks
- 234
- PR merge metrics
- No merged PRs in 30d
Description
# Bug Report
## Problem
Since a few weeks we noticed that the orientation suddenly didn't allow unlocking anymore in our app.
### What is expected to happen?
After calling unlock(), the app should use the sensor for the right orientation.
### What does actually happen?
When calling unlock(), it was going back to forced portrait.
### Environment, Platform, Device
Tried on multiple android devices.
### Version information
- @capacitor/*: 2.4.0
- Android build: (minSdkVersion = 21, compileSdkVersion = 29, targetSdkVersion = 29)
- Android version: 10
I've made a fix which we are using now, which can be found [here](https://github.com/florisdh/cordova-plugin-screen-orientation/commit/4fc347e30e70125ff6a5b5a6302e23ea8c60e957).
- Based on the [3.0.2](https://github.com/apache/cordova-plugin-screen-orientation/releases/tag/3.0.2) tag since the master branch didn't work for us
Contributor guide
Research direction
Start by reproducing unlock() on Android 10 with the reported Capacitor 2.4.0 and SDK settings, then compare the behavior with the linked 3.0.2-based fix. Done means unlocking returns control to the sensor so the app no longer remains forced to portrait.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, javascript
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100