Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import kotlinx.coroutines.flow.Flow
import java.time.Instant

interface CalendarDataSource {
/** 변경 감지를 등록한 직후 한 번, 이후 폰 캘린더가 바뀔 때마다 내보낸다 */
fun observeChanges(): Flow<Unit>
suspend fun queryCalendars(): List<CalendarSource>
suspend fun queryInstances(from: Instant, to: Instant, calendarIds: Set<Long>): List<Event>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ internal class ContentResolverCalendarDataSource @Inject constructor(
) { it.toEvent() }
}

// 종일 일정의 BEGIN 은 UTC 자정이라 범위를 하루씩 넓혀 찾는다
override suspend fun findInstance(eventId: Long, start: Instant): Event? =
query(
uri = instancesUri(start - ONE_DAY, start + ONE_DAY),
Expand Down Expand Up @@ -91,7 +90,6 @@ internal class ContentResolverCalendarDataSource @Inject constructor(
.appendPath(to.toEpochMilli().toString())
.build()

// 칸 순서는 아래 PROJECTION 배열 순서와 같다
private fun Cursor.toCalendarSource() = CalendarSource(
id = getLong(0),
displayName = getString(1).orEmpty(),
Expand Down
Loading