mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-22 13:05:31 +03:00
fix klint + findbugs warnings
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
70b4eed654
commit
ca7861358d
4 changed files with 32 additions and 19 deletions
|
@ -42,22 +42,27 @@ class GetFirebasePushTokenWorker(val context: Context, workerParameters: WorkerP
|
|||
|
||||
@SuppressLint("LongLogTag")
|
||||
override fun doWork(): Result {
|
||||
FirebaseMessaging.getInstance().token.addOnCompleteListener(OnCompleteListener { task ->
|
||||
if (!task.isSuccessful) {
|
||||
Log.w(TAG, "Fetching FCM registration token failed", task.exception)
|
||||
return@OnCompleteListener
|
||||
FirebaseMessaging.getInstance().token.addOnCompleteListener(
|
||||
OnCompleteListener { task ->
|
||||
if (!task.isSuccessful) {
|
||||
Log.w(TAG, "Fetching FCM registration token failed", task.exception)
|
||||
return@OnCompleteListener
|
||||
}
|
||||
|
||||
val token = task.result
|
||||
|
||||
appPreferences?.pushToken = token
|
||||
|
||||
val data: Data =
|
||||
Data.Builder()
|
||||
.putString(PushRegistrationWorker.ORIGIN, "GetFirebasePushTokenWorker")
|
||||
.build()
|
||||
val pushRegistrationWork = OneTimeWorkRequest.Builder(PushRegistrationWorker::class.java)
|
||||
.setInputData(data)
|
||||
.build()
|
||||
WorkManager.getInstance(context).enqueue(pushRegistrationWork)
|
||||
}
|
||||
|
||||
val token = task.result
|
||||
|
||||
appPreferences?.pushToken = token
|
||||
|
||||
val data: Data = Data.Builder().putString(PushRegistrationWorker.ORIGIN, "GetFirebasePushTokenWorker").build()
|
||||
val pushRegistrationWork = OneTimeWorkRequest.Builder(PushRegistrationWorker::class.java)
|
||||
.setInputData(data)
|
||||
.build()
|
||||
WorkManager.getInstance(context).enqueue(pushRegistrationWork)
|
||||
})
|
||||
)
|
||||
|
||||
return Result.success()
|
||||
}
|
||||
|
|
|
@ -75,7 +75,11 @@ class ClosedInterfaceImpl : ClosedInterface, ProviderInstaller.ProviderInstallLi
|
|||
}
|
||||
|
||||
private fun registerLocalToken() {
|
||||
val data: Data = Data.Builder().putString(PushRegistrationWorker.ORIGIN, "ClosedInterfaceImpl#registerLocalToken").build()
|
||||
val data: Data = Data.Builder().putString(
|
||||
PushRegistrationWorker.ORIGIN,
|
||||
"ClosedInterfaceImpl#registerLocalToken"
|
||||
)
|
||||
.build()
|
||||
val pushRegistrationWork = OneTimeWorkRequest.Builder(PushRegistrationWorker::class.java)
|
||||
.setInputData(data)
|
||||
.build()
|
||||
|
@ -83,7 +87,11 @@ class ClosedInterfaceImpl : ClosedInterface, ProviderInstaller.ProviderInstallLi
|
|||
}
|
||||
|
||||
private fun setUpPeriodicLocalTokenRegistration() {
|
||||
val data: Data = Data.Builder().putString(PushRegistrationWorker.ORIGIN, "ClosedInterfaceImpl#setUpPeriodicLocalTokenRegistration").build()
|
||||
val data: Data = Data.Builder().putString(
|
||||
PushRegistrationWorker.ORIGIN,
|
||||
"ClosedInterfaceImpl#setUpPeriodicLocalTokenRegistration"
|
||||
)
|
||||
.build()
|
||||
|
||||
val periodicTokenRegistration = PeriodicWorkRequest.Builder(
|
||||
PushRegistrationWorker::class.java,
|
||||
|
|
|
@ -1 +1 @@
|
|||
558
|
||||
554
|
|
@ -1,2 +1,2 @@
|
|||
DO NOT TOUCH; GENERATED BY DRONE
|
||||
<span class="mdl-layout-title">Lint Report: 1 error and 224 warnings</span>
|
||||
<span class="mdl-layout-title">Lint Report: 1 error and 222 warnings</span>
|
||||
|
|
Loading…
Reference in a new issue