diff --git a/src/main/java/ru/touchin/templates/DeviceUtils.java b/src/main/java/ru/touchin/templates/DeviceUtils.java index 3df2cb0..f05253f 100644 --- a/src/main/java/ru/touchin/templates/DeviceUtils.java +++ b/src/main/java/ru/touchin/templates/DeviceUtils.java @@ -37,6 +37,7 @@ import java.io.UnsupportedEncodingException; import java.util.UUID; import java.util.concurrent.TimeUnit; +import io.reactivex.Completable; import io.reactivex.Observable; import io.reactivex.ObservableEmitter; import ru.touchin.roboswag.core.log.Lc; @@ -212,6 +213,16 @@ public final class DeviceUtils { : processObservable); } + /** + * Create an Observable that depends on network connection. + * + * @param processObservable - Observable to which we subscribe in the availability of the Internet; + */ + @NonNull + public static Observable createNetworkDependentObservable(@NonNull final Context context, @NonNull final Completable processObservable) { + return createNetworkDependentObservable(context, processObservable.toObservable()); + } + private DeviceUtils() { }