diff --git a/CHANGELOG.md b/CHANGELOG.md index eaad40b8aea..11efa583fb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Internal - Migrate alert facility change sheet to use Mobius loop +- Bump AGP to v8.2.0 ### Fixes diff --git a/app/src/main/java/org/simple/clinic/home/HomeScreen.kt b/app/src/main/java/org/simple/clinic/home/HomeScreen.kt index 741e8e1eb37..421d7c032f5 100644 --- a/app/src/main/java/org/simple/clinic/home/HomeScreen.kt +++ b/app/src/main/java/org/simple/clinic/home/HomeScreen.kt @@ -1,5 +1,6 @@ package org.simple.clinic.home +import android.Manifest import android.content.Context import android.content.Intent import android.net.Uri @@ -149,7 +150,9 @@ class HomeScreen : setupHelpClicks() if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - hotEvents.onNext(RequestNotificationPermission()) + hotEvents.onNext(RequestNotificationPermission( + permissionString = Manifest.permission.POST_NOTIFICATIONS + )) } // Keyboard stays open after login finishes, not sure why. diff --git a/app/src/main/java/org/simple/clinic/home/HomeScreenEvent.kt b/app/src/main/java/org/simple/clinic/home/HomeScreenEvent.kt index 307cea2b4ca..23ec03bbfbd 100644 --- a/app/src/main/java/org/simple/clinic/home/HomeScreenEvent.kt +++ b/app/src/main/java/org/simple/clinic/home/HomeScreenEvent.kt @@ -19,9 +19,8 @@ data class CurrentFacilityLoaded(val facility: Facility) : HomeScreenEvent() data class OverdueAppointmentCountUpdated(val overdueAppointmentCount: Int) : HomeScreenEvent() -@RequiresApi(Build.VERSION_CODES.TIRAMISU) data class RequestNotificationPermission( override var permission: Optional = Optional.empty(), - override val permissionString: String = Manifest.permission.POST_NOTIFICATIONS, + override val permissionString: String, override val permissionRequestCode: Int = 1 ) : HomeScreenEvent(), RequiresPermission diff --git a/app/src/main/java/org/simple/clinic/patient/Gender.kt b/app/src/main/java/org/simple/clinic/patient/Gender.kt index 9252384ce20..5bf21e250d2 100644 --- a/app/src/main/java/org/simple/clinic/patient/Gender.kt +++ b/app/src/main/java/org/simple/clinic/patient/Gender.kt @@ -28,7 +28,6 @@ sealed class Gender : Parcelable { @Parcelize data class Unknown(val actualValue: String) : Gender() - @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) object TypeAdapter : SafeEnumTypeAdapter( knownMappings = mapOf( Male to "male", diff --git a/app/src/test/java/org/simple/clinic/home/HomeScreenUpdateTest.kt b/app/src/test/java/org/simple/clinic/home/HomeScreenUpdateTest.kt index 67e2dc60a87..62da3d5abbc 100644 --- a/app/src/test/java/org/simple/clinic/home/HomeScreenUpdateTest.kt +++ b/app/src/test/java/org/simple/clinic/home/HomeScreenUpdateTest.kt @@ -5,10 +5,10 @@ import com.spotify.mobius.test.NextMatchers.hasNoEffects import com.spotify.mobius.test.NextMatchers.hasNoModel import com.spotify.mobius.test.UpdateSpec import com.spotify.mobius.test.UpdateSpec.assertThatNext -import java.util.Optional import org.junit.Test import org.simple.clinic.platform.util.RuntimePermissionResult.DENIED import org.simple.clinic.platform.util.RuntimePermissionResult.GRANTED +import java.util.Optional class HomeScreenUpdateTest { @@ -17,7 +17,10 @@ class HomeScreenUpdateTest { val defaultModel = HomeScreenModel.create() UpdateSpec(HomeScreenUpdate()) .given(defaultModel) - .whenEvent(RequestNotificationPermission(permission = Optional.of(GRANTED))) + .whenEvent(RequestNotificationPermission( + permission = Optional.of(GRANTED), + permissionString = "NOTIFICATION_PERMISSION" + )) .then(assertThatNext( hasNoModel(), hasNoEffects() @@ -29,7 +32,10 @@ class HomeScreenUpdateTest { val defaultModel = HomeScreenModel.create() UpdateSpec(HomeScreenUpdate()) .given(defaultModel) - .whenEvent(RequestNotificationPermission(permission = Optional.of(DENIED))) + .whenEvent(RequestNotificationPermission( + permission = Optional.of(DENIED), + permissionString = "NOTIFICATION_PERMISSION" + )) .then(assertThatNext( hasNoModel(), hasEffects(ShowNotificationPermissionDenied) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 223715e0f8a..3ad0e62ed2e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -43,7 +43,7 @@ ksp = "1.9.10-1.0.13" sqlCipher = "4.5.4" [libraries] -android-gradle-plugin = "com.android.tools.build:gradle:8.1.4" +android-gradle-plugin = "com.android.tools.build:gradle:8.2.0" android-desugaring = "com.android.tools:desugar_jdk_libs:1.2.3" androidx-annotation-annotation = "androidx.annotation:annotation:1.5.0"