fix: 설정 화면 진입 시 크래시 수정

- AppDatabase.kt 누락된 닫는 괄호 추가
- PermissionHelper.canInstallUnknownApps() SecurityException 처리

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
sanjeok77
2026-03-05 07:05:38 +09:00
parent da9b69220a
commit 4060be7395
2 changed files with 14 additions and 8 deletions

View File

@@ -60,5 +60,6 @@ abstract class AppDatabase : RoomDatabase() {
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("ALTER TABLE hot_deals ADD COLUMN isFavorite INTEGER NOT NULL DEFAULT 0")
}
}
}
}
}

View File

@@ -44,13 +44,18 @@ object PermissionHelper {
/**
* 알 수 없는 앱 설치 권한이 있는지 확인
*/
fun canInstallUnknownApps(context: Context): Boolean {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.packageManager.canRequestPackageInstalls()
} else {
true
}
}
fun canInstallUnknownApps(context: Context): Boolean {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
try {
context.packageManager.canRequestPackageInstalls()
} catch (e: SecurityException) {
// REQUEST_INSTALL_PACKAGES 권한이 없으면 false 반환
false
}
} else {
true
}
}
/**
* 정확한 알람 설정 화면 열기