Sha256: 9a884f6c5c3e2fe49f1a894e1519845a636449a5e98a42c63bc25a954400a202

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

package com.amplify.honeydew_server.actions;

import com.amplify.honeydew_server.Action;
import com.amplify.honeydew_server.Result;
import com.android.uiautomator.core.UiDevice;
import com.android.uiautomator.core.UiObject;
import com.android.uiautomator.core.UiObjectNotFoundException;
import com.android.uiautomator.core.UiSelector;

import java.util.Map;

public class Unlock extends Action {
    public Unlock(UiDevice uiDevice) {
        super(uiDevice);
    }

    @Override
    public Result execute(Map<String, Object> arguments) throws UiObjectNotFoundException {
        UiObject uiObject = new UiObject(new UiSelector().description("Slide area."));
        uiObject = isUiObjectAvailable(uiObject, arguments) ? uiObject : new UiObject(new UiSelector().className("android.view.View"));
        try {
            if (isUiObjectAvailable(uiObject, arguments)) {
                uiObject.swipeRight(100);
            }
        } catch (UiObjectNotFoundException e) {
            // The device is unlocked already?"
        }
        getUiDevice().pressHome();
        return Result.OK;
    }
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
honeydew-0.17.0 server/src/main/java/com/amplify/honeydew_server/actions/Unlock.java
honeydew-0.16.0 server/src/main/java/com/amplify/honeydew_server/actions/Unlock.java
honeydew-0.15.0 server/src/main/java/com/amplify/honeydew_server/actions/Unlock.java