mirror of
https://github.com/appium/appium.git
synced 2026-02-13 05:19:47 -06:00
don't unfreezerotation, it actually cancels the rotation (fix #1280)
This commit is contained in:
@@ -16,17 +16,17 @@ import com.android.uiautomator.core.UiDevice;
|
||||
|
||||
/**
|
||||
* This handler is used to get or set the orientation of the device.
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class Orientation extends CommandHandler {
|
||||
|
||||
/*
|
||||
* @param command The {@link AndroidCommand} used for this handler.
|
||||
*
|
||||
*
|
||||
* @return {@link AndroidCommandResult}
|
||||
*
|
||||
*
|
||||
* @throws JSONException
|
||||
*
|
||||
*
|
||||
* @see io.appium.android.bootstrap.CommandHandler#execute(io.appium.android.
|
||||
* bootstrap.AndroidCommand)
|
||||
*/
|
||||
@@ -53,7 +53,7 @@ public class Orientation extends CommandHandler {
|
||||
|
||||
/**
|
||||
* Returns the current rotation
|
||||
*
|
||||
*
|
||||
* @return {@link AndroidCommandResult}
|
||||
*/
|
||||
private AndroidCommandResult getRotation() {
|
||||
@@ -82,7 +82,7 @@ public class Orientation extends CommandHandler {
|
||||
|
||||
/**
|
||||
* Set the desired rotation
|
||||
*
|
||||
*
|
||||
* @param orientation
|
||||
* The rotation desired (LANDSCAPE or PORTRAIT)
|
||||
* @return {@link AndroidCommandResult}
|
||||
@@ -122,8 +122,6 @@ public class Orientation extends CommandHandler {
|
||||
return getSuccessResult("Already in portrait mode.");
|
||||
}
|
||||
}
|
||||
// Make sure to un-freeze the device rotation
|
||||
d.unfreezeRotation();
|
||||
current = OrientationEnum.fromInteger(d.getDisplayRotation());
|
||||
if (current != desired) {
|
||||
return getErrorResult("Set the orientation, but app refused to rotate.");
|
||||
|
||||
@@ -12,6 +12,7 @@ var path = require('path')
|
||||
describeWd('orientation', function(h) {
|
||||
it('should rotate screen to landscape', function(done) {
|
||||
h.driver.setOrientation("LANDSCAPE", function(err) {
|
||||
should.not.exist(err);
|
||||
var next = function() {
|
||||
h.driver.getOrientation(function(err, orientation) {
|
||||
orientation.should.equal("LANDSCAPE");
|
||||
|
||||
Reference in New Issue
Block a user