Pull購読処理のワーカーの起動条件をNetworkType.UNMETEREDからNetworkType.CONNECTEDに変更

This commit is contained in:
tateisu 2023-02-11 21:51:19 +09:00
parent 963dc4edec
commit 1fdb586e75
2 changed files with 13 additions and 2 deletions

View File

@ -107,14 +107,25 @@ android {
}
}
// https://github.com/tateisu/SubwayTooter/issues/229
// splits {
// abi {
// enable true
// reset()
// include "arm64-v8a", "x86", "x86_64"
// universalApk true
// }
// }
// Generate Signed APK
android.applicationVariants.all { variant ->
if (variant.buildType.name == "release") {
variant.outputs.all {
variant.outputs.all { output ->
// Rename APK
def versionCode = defaultConfig.versionCode
def versionName = defaultConfig.versionName
def flavor = variant.flavorName
// def abi = output.getFilter("ABI") ?: "all"
def date = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date())
def branch = gitBranch()
outputFileName = "../../SubwayTooter-${branch}-${flavor}-${versionCode}-${versionName}-${date}.apk"

View File

@ -56,7 +56,7 @@ class PushWorker(appContext: Context, workerParams: WorkerParameters) :
// EXPEDITED だと制約の種類が限られる
// すぐ起動してほしいので制約は少なめにする
val constraints = Constraints.Builder()
.setRequiredNetworkType(NetworkType.UNMETERED)
.setRequiredNetworkType(NetworkType.CONNECTED)
.build()
val request = OneTimeWorkRequestBuilder<PushWorker>().apply {