I dont want to disable it so we are testing one application in which we need to change the pattern in between the flow to test the flow completely.I even tried this but it did not work:
Integer x_topLeftCorner=257;
Integer y_topLeftCorner=1235;
Integer x_topRightCorner=572;
Integer y_topRightCorner=1235;
Integer x_bottomLeftCorner= 260;
Integer y_bottomLeftCorner=1438;
Integer x_bottomRightCorner=532;
Integer y_bottomRightCorner=1504;
//Use coordinates to draw the security pattern and unlock the screen
TouchAction obj = new TouchAction(MBase.getDriver());
obj.press(x_topLeftCorner,y_topLeftCorner).moveTo(x_topRightCorner,y_topRightCorner).moveTo(x_bottomLeftCorner,y_bottomLeftCorner).moveTo(x_bottomRightCorner,y_bottomRightCorner).release().perform();