added some debug log
This commit is contained in:
parent
c20df0cb05
commit
0c748e9ef1
|
@ -24,7 +24,9 @@ import android.annotation.TargetApi
|
|||
import android.app.job.JobParameters
|
||||
import android.app.job.JobService
|
||||
import android.os.Build
|
||||
import android.util.Log
|
||||
import org.mariotaku.kpreferences.KPreferences
|
||||
import org.mariotaku.twidere.TwidereConstants.LOGTAG
|
||||
import org.mariotaku.twidere.annotation.AutoRefreshType
|
||||
import org.mariotaku.twidere.constant.autoRefreshCompatibilityModeKey
|
||||
import org.mariotaku.twidere.util.Analyzer
|
||||
|
@ -47,10 +49,17 @@ class JobTaskService : JobService() {
|
|||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
Log.d(LOGTAG, "JobTaskService started")
|
||||
GeneralComponentHelper.build(this).inject(this)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
Log.d(LOGTAG, "JobTaskService destroyed")
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
override fun onStartJob(params: JobParameters): Boolean {
|
||||
Log.d(LOGTAG, "LegacyTaskService received job $params")
|
||||
if (kPreferences[autoRefreshCompatibilityModeKey]) return false
|
||||
val action = getTaskAction(params.jobId) ?: return false
|
||||
return taskServiceRunner.runTask(action) {
|
||||
|
|
|
@ -22,7 +22,9 @@ package org.mariotaku.twidere.service
|
|||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.IBinder
|
||||
import android.util.Log
|
||||
import org.mariotaku.kpreferences.get
|
||||
import org.mariotaku.twidere.TwidereConstants.LOGTAG
|
||||
import org.mariotaku.twidere.annotation.AutoRefreshType
|
||||
import org.mariotaku.twidere.constant.autoRefreshCompatibilityModeKey
|
||||
import org.mariotaku.twidere.util.TaskServiceRunner.Companion.ACTION_REFRESH_DIRECT_MESSAGES
|
||||
|
@ -36,10 +38,17 @@ class LegacyTaskService : BaseService() {
|
|||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
Log.d(LOGTAG, "LegacyTaskService created")
|
||||
GeneralComponentHelper.build(this).inject(this)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
Log.d(LOGTAG, "LegacyTaskService destroyed")
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
Log.d(LOGTAG, "LegacyTaskService received $intent")
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP &&
|
||||
!preferences[autoRefreshCompatibilityModeKey]) return START_NOT_STICKY
|
||||
val action = intent?.action ?: return START_NOT_STICKY
|
||||
|
|
|
@ -2,11 +2,13 @@ package org.mariotaku.twidere.util
|
|||
|
||||
import android.content.Context
|
||||
import android.support.annotation.StringDef
|
||||
import android.util.Log
|
||||
import com.squareup.otto.Bus
|
||||
import org.mariotaku.abstask.library.AbstractTask
|
||||
import org.mariotaku.abstask.library.TaskStarter
|
||||
import org.mariotaku.kpreferences.KPreferences
|
||||
import org.mariotaku.ktextension.toNulls
|
||||
import org.mariotaku.twidere.TwidereConstants.LOGTAG
|
||||
import org.mariotaku.twidere.constant.IntentConstants.INTENT_PACKAGE_PREFIX
|
||||
import org.mariotaku.twidere.constant.dataSyncProviderInfoKey
|
||||
import org.mariotaku.twidere.constant.stopAutoRefreshWhenBatteryLowKey
|
||||
|
@ -31,6 +33,7 @@ class TaskServiceRunner(
|
|||
) {
|
||||
|
||||
fun runTask(@Action action: String, callback: (Boolean) -> Unit): Boolean {
|
||||
Log.d(LOGTAG, "TaskServiceRunner run task $action")
|
||||
when (action) {
|
||||
ACTION_REFRESH_HOME_TIMELINE, ACTION_REFRESH_NOTIFICATIONS,
|
||||
ACTION_REFRESH_DIRECT_MESSAGES, ACTION_REFRESH_FILTERS_SUBSCRIPTIONS -> {
|
||||
|
|
Loading…
Reference in New Issue