mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 766904 - Make sure unlockOrientation() is a no-op if the orientation wasn't locked. r=blassey
This commit is contained in:
parent
fb4c641aae
commit
94eb49d211
@ -36,6 +36,8 @@ public class GeckoScreenOrientationListener
|
||||
static public final short eScreenOrientation_LandscapeSecondary = 8;
|
||||
static public final short eScreenOrientation_Landscape = 12;
|
||||
|
||||
static private final short kDefaultScreenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
|
||||
|
||||
private short mOrientation;
|
||||
private OrientationEventListenerImpl mListener = null;
|
||||
|
||||
@ -150,6 +152,7 @@ public class GeckoScreenOrientationListener
|
||||
break;
|
||||
default:
|
||||
Log.e(LOGTAG, "Unexpected value received! (" + aOrientation + ")");
|
||||
return;
|
||||
}
|
||||
|
||||
GeckoApp.mAppContext.setRequestedOrientation(orientation);
|
||||
@ -157,7 +160,11 @@ public class GeckoScreenOrientationListener
|
||||
}
|
||||
|
||||
public void unlockScreenOrientation() {
|
||||
GeckoApp.mAppContext.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
|
||||
if (GeckoApp.mAppContext.getRequestedOrientation() == kDefaultScreenOrientation) {
|
||||
return;
|
||||
}
|
||||
|
||||
GeckoApp.mAppContext.setRequestedOrientation(kDefaultScreenOrientation);
|
||||
updateScreenOrientation();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user