Skip to content

Commit

Permalink
fix ephemeraltasks not working on mobile
Browse files Browse the repository at this point in the history
fixes #254
  • Loading branch information
newhinton committed Apr 28, 2024
1 parent c9e3239 commit 7b64735
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,9 @@ class EphemeralWorker (private var mContext: Context, workerParams: WorkerParame
}

private fun preconditionsMet(): Boolean {
val wifiOnly = mPreferences.getBoolean(mContext.getString(R.string.pref_key_wifi_only_transfers), false)
val connection = WifiConnectivitiyUtil.dataConnection(this.applicationContext)
if (connection === WifiConnectivitiyUtil.Connection.METERED) {
if (wifiOnly && connection === WifiConnectivitiyUtil.Connection.METERED) {
failureReason = FAILURE_REASON.NO_UNMETERED
return false
} else if (connection === WifiConnectivitiyUtil.Connection.DISCONNECTED || connection === WifiConnectivitiyUtil.Connection.NOT_AVAILABLE) {
Expand Down

0 comments on commit 7b64735

Please sign in to comment.