Skip to content

Commit

Permalink
Events: map no CLASSification to Android ACCESS_DEFAULT instead of AC…
Browse files Browse the repository at this point in the history
…CESS_PUBLIC
  • Loading branch information
rfc2822 committed Nov 20, 2024
1 parent d01dba0 commit 10b329e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ class AndroidEventTest {
fun testBuildEvent_Classification_None() {
buildEvent(true) {
}.let { result ->
assertEquals(Events.ACCESS_PUBLIC, result.getAsInteger(Events.ACCESS_LEVEL))
assertEquals(Events.ACCESS_DEFAULT, result.getAsInteger(Events.ACCESS_LEVEL))
assertNull(firstUnknownProperty(result))
}
}
Expand Down
3 changes: 2 additions & 1 deletion lib/src/main/kotlin/at/bitfire/ical4android/AndroidEvent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,8 @@ abstract class AndroidEvent(

builder .withValue(Events.AVAILABILITY, if (event.opaque) Events.AVAILABILITY_BUSY else Events.AVAILABILITY_FREE)
.withValue(Events.ACCESS_LEVEL, when (event.classification) {
null, Clazz.PUBLIC -> Events.ACCESS_PUBLIC
null -> Events.ACCESS_DEFAULT
Clazz.PUBLIC -> Events.ACCESS_PUBLIC
Clazz.CONFIDENTIAL -> Events.ACCESS_CONFIDENTIAL
else /* including Events.ACCESS_PRIVATE */ -> Events.ACCESS_PRIVATE
})
Expand Down

0 comments on commit 10b329e

Please sign in to comment.