Skip to content

Commit 0a5ce6b

Browse files
committed
Fix update checking network state crash bug
1 parent 6967681 commit 0a5ce6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

java/src/org/futo/inputmethod/updates/UpdateChecking.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ suspend fun retrieveSavedLastUpdateCheckResult(context: Context): UpdateResult?
103103

104104
const val JOB_ID: Int = 15782788
105105
fun scheduleUpdateCheckingJob(context: Context) {
106-
if(!BuildConfig.UPDATE_CHECKING) return
106+
if(!BuildConfig.UPDATE_CHECKING_NETWORK) return
107107

108108
val jobScheduler = context.getSystemService(Context.JOB_SCHEDULER_SERVICE) as JobScheduler
109109

@@ -114,7 +114,7 @@ fun scheduleUpdateCheckingJob(context: Context) {
114114

115115
var jobInfoBuilder = JobInfo.Builder(JOB_ID, ComponentName(context, UpdateCheckingService::class.java))
116116
.setPeriodic(1000L * 60L * 60L * 12L) // every 12 hours
117-
.setRequiredNetworkType(JobInfo.NETWORK_TYPE_UNMETERED) // on unmetered Wi-Fi
117+
//.setRequiredNetworkType(JobInfo.NETWORK_TYPE_UNMETERED) // on unmetered Wi-Fi
118118
.setPersisted(true) // persist after reboots
119119

120120
// Update checking has minimum priority

0 commit comments

Comments
 (0)