diff --git a/config/proguard/androidx-proguard-rules.pro b/config/proguard/androidx-proguard-rules.pro index 2a4f1c64760..1eaab2b2c54 100644 --- a/config/proguard/androidx-proguard-rules.pro +++ b/config/proguard/androidx-proguard-rules.pro @@ -39,3 +39,17 @@ # A strange unknown issue that arises within a Room class (it seems an actual dependency is missing # within Room). -dontwarn androidx.room.paging.LimitOffsetDataSource + +# Ensure that lifecycle-related components (such as LiveData) work correctly. For context, see: +# https://github.com/oppia/oppia-android/issues/3810#issuecomment-931925578. +-keepclassmembers enum androidx.lifecycle.Lifecycle$Event { + ; +} +-keep !interface * implements androidx.lifecycle.LifecycleObserver {} +-keep class * implements androidx.lifecycle.GeneratedAdapter { + (...); +} +-keepclassmembers class ** { + @androidx.lifecycle.OnLifecycleEvent *; +} +-keepclassmembers class androidx.lifecycle.ReportFragment$LifecycleCallbacks { *; } diff --git a/domain/src/main/java/org/oppia/android/domain/locale/LocaleController.kt b/domain/src/main/java/org/oppia/android/domain/locale/LocaleController.kt index 70e62e4b430..ec90dae8f02 100644 --- a/domain/src/main/java/org/oppia/android/domain/locale/LocaleController.kt +++ b/domain/src/main/java/org/oppia/android/domain/locale/LocaleController.kt @@ -103,8 +103,6 @@ class LocaleController @Inject constructor( }.build() } - // TODO(#3800): Utilize this method to build in resilience for low-memory process deaths resulting - // in crashes upon the app be foregrounded. /** * Returns a new [DisplayLocale] corresponding to the specified [OppiaLocaleContext]. This is * meant to be used in cases when a context needs to be saved (e.g. in a bundle) and later