Skip to content

Commit

Permalink
Force landscape sensor orientation for landscape and reverse
Browse files Browse the repository at this point in the history
landscape requests
  • Loading branch information
loosethisskin committed Nov 27, 2013
1 parent 1e16a8d commit f5c558f
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -4977,6 +4977,13 @@ public int rotationForOrientationLw(int orientation, int lastRotation) {
return Surface.ROTATION_0;
}

if (mContext.getResources().getBoolean(com.android.internal.R.bool.config_reverseDefaultRotation)) {
if (orientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE
||orientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
orientation = ActivityInfo. SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
}
}

synchronized (mLock) {
int sensorRotation = mOrientationListener.getProposedRotation(); // may be -1
if (sensorRotation < 0) {
Expand Down

0 comments on commit f5c558f

Please sign in to comment.