Search in sources :

Example 1 with MtpEvent

use of android.mtp.MtpEvent in project platform_frameworks_base by android.

the class MtpManagerTest method testEventObjectAdded.

public void testEventObjectAdded() throws Exception {
    while (true) {
        getInstrumentation().show("Please take a photo by using connected MTP device.");
        final CancellationSignal signal = new CancellationSignal();
        MtpEvent event = mManager.readEvent(mUsbDevice.getDeviceId(), signal);
        if (event.getEventCode() != MtpConstants.EVENT_OBJECT_ADDED) {
            continue;
        }
        assertTrue(event.getObjectHandle() != 0);
        break;
    }
}
Also used : CancellationSignal(android.os.CancellationSignal) MtpEvent(android.mtp.MtpEvent)

Example 2 with MtpEvent

use of android.mtp.MtpEvent in project android_frameworks_base by ResurrectionRemix.

the class MtpManagerTest method testEventObjectAdded.

public void testEventObjectAdded() throws Exception {
    while (true) {
        getInstrumentation().show("Please take a photo by using connected MTP device.");
        final CancellationSignal signal = new CancellationSignal();
        MtpEvent event = mManager.readEvent(mUsbDevice.getDeviceId(), signal);
        if (event.getEventCode() != MtpConstants.EVENT_OBJECT_ADDED) {
            continue;
        }
        assertTrue(event.getObjectHandle() != 0);
        break;
    }
}
Also used : CancellationSignal(android.os.CancellationSignal) MtpEvent(android.mtp.MtpEvent)

Example 3 with MtpEvent

use of android.mtp.MtpEvent in project android_frameworks_base by AOSPA.

the class MtpManagerTest method testEventObjectAdded.

public void testEventObjectAdded() throws Exception {
    while (true) {
        getInstrumentation().show("Please take a photo by using connected MTP device.");
        final CancellationSignal signal = new CancellationSignal();
        MtpEvent event = mManager.readEvent(mUsbDevice.getDeviceId(), signal);
        if (event.getEventCode() != MtpConstants.EVENT_OBJECT_ADDED) {
            continue;
        }
        assertTrue(event.getObjectHandle() != 0);
        break;
    }
}
Also used : CancellationSignal(android.os.CancellationSignal) MtpEvent(android.mtp.MtpEvent)

Example 4 with MtpEvent

use of android.mtp.MtpEvent in project android_frameworks_base by DirtyUnicorns.

the class MtpManagerTest method testEventObjectAdded.

public void testEventObjectAdded() throws Exception {
    while (true) {
        getInstrumentation().show("Please take a photo by using connected MTP device.");
        final CancellationSignal signal = new CancellationSignal();
        MtpEvent event = mManager.readEvent(mUsbDevice.getDeviceId(), signal);
        if (event.getEventCode() != MtpConstants.EVENT_OBJECT_ADDED) {
            continue;
        }
        assertTrue(event.getObjectHandle() != 0);
        break;
    }
}
Also used : CancellationSignal(android.os.CancellationSignal) MtpEvent(android.mtp.MtpEvent)

Example 5 with MtpEvent

use of android.mtp.MtpEvent in project android_frameworks_base by crdroidandroid.

the class MtpManagerTest method testEventObjectAdded.

public void testEventObjectAdded() throws Exception {
    while (true) {
        getInstrumentation().show("Please take a photo by using connected MTP device.");
        final CancellationSignal signal = new CancellationSignal();
        MtpEvent event = mManager.readEvent(mUsbDevice.getDeviceId(), signal);
        if (event.getEventCode() != MtpConstants.EVENT_OBJECT_ADDED) {
            continue;
        }
        assertTrue(event.getObjectHandle() != 0);
        break;
    }
}
Also used : CancellationSignal(android.os.CancellationSignal) MtpEvent(android.mtp.MtpEvent)

Aggregations

MtpEvent (android.mtp.MtpEvent)5 CancellationSignal (android.os.CancellationSignal)5