Always use applicationContext for Api
This commit is contained in:
parent
d293129df5
commit
ded36d2e6e
|
@ -20,9 +20,10 @@ import org.unifiedpush.distributor.nextpush.api.response.ApiResponse
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import java.util.concurrent.atomic.AtomicReference
|
import java.util.concurrent.atomic.AtomicReference
|
||||||
|
|
||||||
class Api(val context: Context) {
|
class Api(context: Context) {
|
||||||
|
|
||||||
private val TAG = Api::class.java.simpleName
|
private val TAG = Api::class.java.simpleName
|
||||||
|
private val context = context.applicationContext
|
||||||
|
|
||||||
private val baseUrl: String
|
private val baseUrl: String
|
||||||
get() = getAccount(context)?.url ?: "http://0.0.0.0/"
|
get() = getAccount(context)?.url ?: "http://0.0.0.0/"
|
||||||
|
@ -94,7 +95,7 @@ class Api(val context: Context) {
|
||||||
syncSource.set(
|
syncSource.set(
|
||||||
EventSources.createFactory(client).newEventSource(
|
EventSources.createFactory(client).newEventSource(
|
||||||
request,
|
request,
|
||||||
SSEListener(context.applicationContext)
|
SSEListener(context)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
Log.d(TAG, "cSync done.")
|
Log.d(TAG, "cSync done.")
|
||||||
|
|
Loading…
Reference in New Issue