Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
613cbe2
UseCaseやリポジトリのCoroutineDispatcherをコンストラクタで渡せるように変更
ptkNktq Jan 12, 2026
998f140
kotlinx-coroutines-test追加
ptkNktq Jan 12, 2026
52c4fb0
runBlocking -> runTest
ptkNktq Jan 12, 2026
d2b4add
testDispatcher定義、runTest時はそれを使うように変更
ptkNktq Jan 12, 2026
7f12cac
usecase,repositoryでもtestDispatcherを使うように変更
ptkNktq Jan 12, 2026
39dc61d
AddTargetAppUseCaseの生成をsetUpに変更
ptkNktq Jan 12, 2026
33f00d6
LoadAppUseCaseの生成をsetUpに変更
ptkNktq Jan 12, 2026
31d8ab5
DeleteTargetAppUseCaseの生成をsetUpに変更
ptkNktq Jan 12, 2026
0b97ea1
PackageVisibilityGrantedUseCaseの生成をsetUpに変更
ptkNktq Jan 12, 2026
95aaf8f
SaveFilterConditionUseCaseの生成をsetUpに変更
ptkNktq Jan 12, 2026
6df1936
ToggleIgnoreSummaryUseCaseの生成をsetUpに変更
ptkNktq Jan 12, 2026
17f74b0
LoadFilterConditionUseCaseの生成をsetUpに変更
ptkNktq Jan 12, 2026
6fafc75
SaveAddressUseCaseの生成をsetUpに変更
ptkNktq Jan 12, 2026
ddbcb61
LoadAddressUseCaseの生成をsetUpに変更
ptkNktq Jan 12, 2026
ce0c20e
NotifyUseCaseの生成をsetUpに変更
ptkNktq Jan 12, 2026
a9789bd
ExportDataUseCaseの生成をsetUpに変更
ptkNktq Jan 12, 2026
2ad6fa7
ImportDataUseCaseの生成をsetUpに変更
ptkNktq Jan 12, 2026
8114872
プロパティにする必要のないものを修正
ptkNktq Jan 12, 2026
ff0027d
微修正
ptkNktq Jan 12, 2026
99f3323
ignoreにしていたテスト修正
ptkNktq Jan 12, 2026
47e495c
CI環境では一部のテストを実行しないように変更
ptkNktq Jan 12, 2026
9fbfff6
test用はandroidTestImplementationを使うように修正
ptkNktq Jan 12, 2026
97ea253
typo
ptkNktq Jan 12, 2026
3b63b47
testDispatcher指定漏れ
ptkNktq Jan 12, 2026
31cbb9e
不要なwithContextの削除
ptkNktq Jan 12, 2026
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
1 change: 1 addition & 0 deletions AndroidApp/.idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package me.nya_n.notificationnotifier.data.repository.impl

import android.content.pm.PackageManager
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import me.nya_n.notificationnotifier.data.repository.AppRepository
Expand All @@ -12,16 +13,17 @@ import me.nya_n.notificationnotifier.model.InstalledApp
class AppRepositoryImpl(
private val filterConditionDao: FilterConditionDao,
private val targetAppDao: TargetAppDao,
private val coroutineDispatcher: CoroutineDispatcher = Dispatchers.IO
) : AppRepository {
override suspend fun clearAll() {
withContext(Dispatchers.IO) {
withContext(coroutineDispatcher) {
filterConditionDao.clear()
targetAppDao.clear()
}
}

override suspend fun getFilterCondition(targetPackageName: String): FilterCondition? {
return withContext(Dispatchers.IO) {
return withContext(coroutineDispatcher) {
filterConditionDao.get(targetPackageName)
}
}
Expand All @@ -31,31 +33,31 @@ class AppRepositoryImpl(
}

override suspend fun getFilterConditionList(): List<FilterCondition> {
return withContext(Dispatchers.IO) {
return withContext(coroutineDispatcher) {
filterConditionDao.getAll()
}
}

override suspend fun saveFilterCondition(condition: FilterCondition) {
withContext(Dispatchers.IO) {
withContext(coroutineDispatcher) {
filterConditionDao.insert(condition)
}
}

override suspend fun getTargetAppList(): List<InstalledApp> {
return withContext(Dispatchers.IO) {
return withContext(coroutineDispatcher) {
targetAppDao.getAll()
}
}

override suspend fun addTargetApp(target: InstalledApp) {
withContext(Dispatchers.IO) {
withContext(coroutineDispatcher) {
targetAppDao.insert(target)
}
}

override suspend fun deleteTargetApp(target: InstalledApp) {
withContext(Dispatchers.IO) {
withContext(coroutineDispatcher) {
targetAppDao.delete(target)
}
}
Expand Down
9 changes: 5 additions & 4 deletions AndroidApp/domain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ dependencies {
api(libs.androidx.compose.runtime)

// test
implementation(libs.junit)
implementation(libs.com.google.truth)
implementation(libs.androidx.test.ext.junit)
implementation(libs.androidx.test.espresso.core)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.com.google.truth)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.androidx.test.espresso.core)
androidTestImplementation(libs.kotlinx.coroutines.test)

// その他
implementation(libs.com.google.code.gson)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package me.nya_n.notificationnotifier

@Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.RUNTIME)
annotation class LocalOnly
Loading