void unlockEmulator ( AndroidDebugBridge androidDebugBridge ) { if ( emulatorUnlock ) { IDevice myEmulator = findExistingEmulator ( Arrays . asList ( androidDebugBridge . getDevices ( ) ) ) ; int devicePort = extractPortFromDevice ( myEmulator ) ; if ( devicePort == - 1 ) { getLog ( ) . info ( "Unable to retrieve port to unlock emulator " + DeviceHelper . getDescriptiveName ( myEmulator ) ) ; } else { getLog ( ) . info ( "Unlocking emulator " + DeviceHelper . getDescriptiveName ( myEmulator ) ) ; sendEmulatorCommand ( devicePort , "event send EV_KEY:KEY_SOFT1:1" ) ; sendEmulatorCommand ( devicePort , "event send EV_KEY:KEY_SOFT1:0" ) ; sendEmulatorCommand ( devicePort , "event send EV_KEY:KEY_SOFT1:1" ) ; sendEmulatorCommand ( devicePort , "event send EV_KEY:KEY_SOFT1:0" ) ; } } }
Unlocks the emulator .