Search in sources :

Example 1 with SendCallNotificationRequest

use of nodomain.freeyourgadget.gadgetbridge.service.devices.lefun.requests.SendCallNotificationRequest in project Gadgetbridge by Freeyourgadget.

the class LefunDeviceSupport method onSetCallState.

@Override
public void onSetCallState(CallSpec callSpec) {
    switch(callSpec.command) {
        case CallSpec.CALL_INCOMING:
            try {
                TransactionBuilder builder = performInitialized(SetTimeRequest.class.getSimpleName());
                SendCallNotificationRequest request = new SendCallNotificationRequest(this, builder);
                request.setCallNotification(callSpec);
                request.perform();
                performConnected(builder.getTransaction());
            } catch (IOException e) {
                GB.toast(getContext(), "Failed to send call notification", Toast.LENGTH_SHORT, GB.ERROR, e);
            }
            break;
    }
}
Also used : SetTimeRequest(nodomain.freeyourgadget.gadgetbridge.service.devices.lefun.requests.SetTimeRequest) TransactionBuilder(nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder) IOException(java.io.IOException) SendCallNotificationRequest(nodomain.freeyourgadget.gadgetbridge.service.devices.lefun.requests.SendCallNotificationRequest)

Aggregations

IOException (java.io.IOException)1 TransactionBuilder (nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder)1 SendCallNotificationRequest (nodomain.freeyourgadget.gadgetbridge.service.devices.lefun.requests.SendCallNotificationRequest)1 SetTimeRequest (nodomain.freeyourgadget.gadgetbridge.service.devices.lefun.requests.SetTimeRequest)1