Fix generic compile

pull/996/head
Alex Baker 4 years ago
parent 58e3d8f6e8
commit 66d44a2470

@ -26,7 +26,7 @@ class Firebase @Inject constructor(@param:ForApplication val context: Context, p
private var analytics: FirebaseAnalytics? = null
private var remoteConfig: FirebaseRemoteConfig? = null
fun reportException(t: Throwable?) {
fun reportException(t: Throwable) {
Timber.e(t)
if (enabled) {
Crashlytics.logException(t)

@ -15,7 +15,7 @@ import javax.inject.Inject
abstract class InjectingService : Service() {
@Inject lateinit var firebase: Firebase
private var disposables: CompositeDisposable? = null
private lateinit var disposables: CompositeDisposable
override fun onCreate() {
super.onCreate()
@ -26,14 +26,12 @@ abstract class InjectingService : Service() {
override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
startForeground()
disposables!!.add(
disposables.add(
Completable.fromAction { doWork() }
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
{ done(startId) }
) { t: Throwable? ->
firebase!!.reportException(t)
.subscribe({ done(startId) }) { t: Throwable ->
firebase.reportException(t)
done(startId)
})
return START_NOT_STICKY
@ -47,7 +45,7 @@ abstract class InjectingService : Service() {
override fun onDestroy() {
super.onDestroy()
stopForeground(true)
disposables!!.dispose()
disposables.dispose()
}
private fun startForeground() {

Loading…
Cancel
Save