If you see your methods are not the same as mine, so yes, you are using deprecated methods, although they still work.
About opening Control Center in iOS. On some iPhones I’m not able to, dont know why, but although the swipe is performed, the control panel doesn’t open. But it depends on the iPhone and iOS you are using.
Just tested with iPhone5S - iOS11.2.5 and this works:
gestSwipeVerticalPercentage(1,0.4,0.5,2000);
public void gestSwipeVerticalPercentage(double startPercentage, double finalPercentage, double anchorPercentage, int duration) throws Exception {
Dimension size = driver.manage().window().getSize();
int anchor, startPoint, endPoint;
anchor = (int) (size.width * anchorPercentage);
startPoint = (int) (size.height * startPercentage);
endPoint = (int) (size.height * finalPercentage);
new TouchAction(driver).press(point(anchor, startPoint)).waitAction(waitOptions(Duration.ofMillis(duration)))
.moveTo(point(anchor, endPoint)).release().perform();
}