Press and hold Back and Recent button to disable Screen Pinning

Hi, I am writing a test case for an Android device running Android 9 (Pie). There is a feature in Settings > Security & location called Screen Pinning, once this is enabled, the app will stay displayed at all times. Pressing Back or Home does not work unless the pinned app is disabled. To disable the Screen Pinning, the user has to press and hold both the Back button and the Recent button.

Does anyone know of a way to do this?

I have followed the steps here: https://docs.katalon.com/katalon-studio/docs/handle_multi_touch_action.html#script-mode but this details how to press at multiple locations based on x and y co-ordinates whereas these buttons are considered below the x and y range.

Here is my code so far:

AppiumDriver<MobileElement> driver = MobileDriverFactory.getDriver()
backButton = driver.longPressKey(new KeyEvent(AndroidKey.BACK))
homeButton = driver.longPressKey(new KeyEvent(AndroidKey.HOME))
MultiTouchAction multiTouch = new MultiTouchAction(driver)
TouchAction action1 = new TouchAction(driver)
TouchAction action2 = new TouchAction(driver)

action1.press(backButton).waitAction(3000).release()
action2.press(homeButton).waitAction(3000).release()
multiTouch.add(action1).add(action2).perform()

The error I’m seeing is:
Reason:
java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:882)
at io.appium.java_client.TouchAction$ActionParameter.(TouchAction.java:227)
at io.appium.java_client.TouchAction.press(TouchAction.java:63)

I assume there is an issue with the line action1.press(backButton) as the example in the Katalon Documents shows two arguments sent in the press command (x and y position)

Hope this explains it well. Looking forward to any advice or guidance.