Skip to content

Commit

Permalink
Reverted back a custom configuration for WorkManager to prevent unexp…
Browse files Browse the repository at this point in the history
…ected bugs.| #2649
  • Loading branch information
DenBond7 committed Mar 25, 2024
1 parent 5794954 commit deda5b9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
12 changes: 12 additions & 0 deletions FlowCrypt/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,18 @@
android:grantUriPermissions="true"
android:permission="android.permission.MANAGE_DOCUMENTS" />

<!-- https://developer.android.com/topic/libraries/architecture/workmanager/advanced/custom-configuration#remove-default -->
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
android:exported="false"
tools:node="merge">
<!-- If you are using androidx.startup to initialize other components -->
<meta-data
android:name="androidx.work.WorkManagerInitializer"
android:value="androidx.startup"
tools:node="remove" />
</provider>
<!-- Services -->
<service
android:name=".service.PassPhrasesInRAMService"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package com.flowcrypt.email

import android.app.Application
import android.content.Context
import android.util.Log
import androidx.preference.PreferenceManager
import androidx.work.Configuration
import androidx.work.ExistingPeriodicWorkPolicy
Expand Down Expand Up @@ -46,7 +47,17 @@ import java.util.concurrent.TimeUnit
*
* @author Denys Bondarenko
*/
class FlowCryptApplication : Application() {
class FlowCryptApplication : Application(), Configuration.Provider {
override val workManagerConfiguration: Configuration
get() = Configuration.Builder()
.setMinimumLoggingLevel(
if (GeneralUtil.isDebugBuild()) {
Log.DEBUG
} else {
Log.ERROR
}
).build()

override fun onCreate() {
super.onCreate()
setupGlobalSettingsForJavaMail()
Expand Down

0 comments on commit deda5b9

Please sign in to comment.