Skip to content

Commit

Permalink
Made getNdefMessage return a nullable value
Browse files Browse the repository at this point in the history
  • Loading branch information
h0ker committed Sep 14, 2024
1 parent 01fcfde commit 261a57b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId = "com.hoker.intra_example"
minSdk = 28
targetSdk = 35
versionCode = 130
versionName = "1.3.0"
versionCode = 131
versionName = "1.3.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
2 changes: 1 addition & 1 deletion intra/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ afterEvaluate {
from(components["release"])
groupId = "com.github.CarbideCowboy"
artifactId = "Intra"
version = "1.3.0"
version = "1.3.1"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class IsodepControllerImpl @Inject constructor(
}
}

override suspend fun getNdefMessage(ndef: Ndef): OperationResult<NdefMessage> {
override suspend fun getNdefMessage(ndef: Ndef): OperationResult<NdefMessage?> {
return try {
val result = ndef.cachedNdefMessage
OperationResult.Success(result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class NfcAControllerImpl @Inject constructor(
return OperationResult.Failure(Exception("This operation is not currently supported with NfcA"))
}

override suspend fun getNdefMessage(ndef: Ndef): OperationResult<NdefMessage> {
override suspend fun getNdefMessage(ndef: Ndef): OperationResult<NdefMessage?> {
return try {
val result = ndef.cachedNdefMessage
OperationResult.Success(result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class NfcVControllerImpl @Inject constructor(
}
}

override suspend fun getNdefMessage(ndef: Ndef): OperationResult<NdefMessage> {
override suspend fun getNdefMessage(ndef: Ndef): OperationResult<NdefMessage?> {
return try {
val result = ndef.cachedNdefMessage
OperationResult.Success(result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface NfcController {
suspend fun writeNdefMessage(tag: Tag, message: NdefMessage): OperationResult<Unit>
suspend fun getVivokeyJwt(tag: Tag): OperationResult<String>
suspend fun getNdefCapacity(ndef: Ndef): OperationResult<Int>
suspend fun getNdefMessage(ndef: Ndef): OperationResult<NdefMessage>
suspend fun getNdefMessage(ndef: Ndef): OperationResult<NdefMessage?>
suspend fun checkConnection(): OperationResult<Boolean>
suspend fun withNdefConnection(tag: Tag, operations: suspend (ndef: Ndef) -> Unit): OperationResult<Unit> {
return try {
Expand Down

0 comments on commit 261a57b

Please sign in to comment.