Gravity sensor related issue: Isolated to the Gravity sensor.
Solutions:
1. If the issue occurs in a single app, please uninstall the app before trying the next step.
2. Install "sensor list" app to check whether Gravity sensor works or not;
3. Open [Settings] - [Display] - [auto-rotate screen] to check whether the auto-rotate screen is turned on.