Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dmpatel151282/135f7e24ba2c95efb4feafb6d35f60f5 to your computer and use it in GitHub Desktop.
Save dmpatel151282/135f7e24ba2c95efb4feafb6d35f60f5 to your computer and use it in GitHub Desktop.
Open the following file from Android framework.
- /android/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
- Go to "computeForcedAppOrientationLocked" function.
- Add below code at appropriate place.
int req = getOrientationFromWindowsLocked();
if (req == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
req = getOrientationFromAppTokensLocked();
}
+req = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
return req;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment