Back to project page android-sdk.
The source code is released under:
MIT License
If you think the Android project android-sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package io.relayr.api; //from www.ja va 2 s. c o m import com.google.gson.reflect.TypeToken; import javax.inject.Inject; import io.relayr.model.WebSocketConfig; import rx.Observable; import rx.Subscriber; import static io.relayr.api.MockBackend.APPS_DEVICES_START; public class MockSubscriptionApi implements SubscriptionApi { private final MockBackend mMockBackend; @Inject public MockSubscriptionApi(MockBackend mockBackend) { mMockBackend = mockBackend; } @Override public Observable<WebSocketConfig> subscribe(String appId, String deviceId) { return mMockBackend.createObservable(new TypeToken<WebSocketConfig>() { }, APPS_DEVICES_START); } @Override public Observable<Void> unSubscribe(String appId, String deviceId) { return Observable.create(new Observable.OnSubscribe<Void>() { @Override public void call(Subscriber<? super Void> subscriber) { subscriber.onNext(null); subscriber.onCompleted(); } }); } }