FileDocCategorySizeDatePackage
MonkeyFlipEvent.javaAPI DocAndroid 1.5 API2171Wed May 06 22:41:08 BST 2009com.android.commands.monkey

MonkeyFlipEvent

public class MonkeyFlipEvent extends MonkeyEvent
monkey keyboard flip event

Fields Summary
private static final byte[]
FLIP_0
private static final byte[]
FLIP_1
private final boolean
mKeyboardOpen
Constructors Summary
public MonkeyFlipEvent(boolean keyboardOpen)


       
        super(EVENT_TYPE_FLIP);
        mKeyboardOpen = keyboardOpen;
    
Methods Summary
public intinjectEvent(android.view.IWindowManager iwm, android.app.IActivityManager iam, int verbose)

        if (verbose > 0) {
            System.out.println(":Sending Flip keyboardOpen=" + mKeyboardOpen);
        }

        // inject flip event
        try {
            FileOutputStream f = new FileOutputStream("/dev/input/event0");
            f.write(mKeyboardOpen ? FLIP_0 : FLIP_1);
            f.close();
            return MonkeyEvent.INJECT_SUCCESS;
        } catch (IOException e) {
            System.out.println("Got IOException performing flip" + e);
            return MonkeyEvent.INJECT_FAIL;
        }