fix: Task 14 완료 - LunaticLauncher 외부 저장소 폴백 및 Picasso 캐시 크기 수정
- LunaticLauncher.kt onCreate(): * 하드코딩된 /storage/emulated/0/... 로그 경로 접근 실패 또는 권한 부족 시 getExternalFilesDir(null)/logs로 안전 폴백하도록 try-catch 보강 * Picasso OkHttp 캐시 크기 계산 오류(1024L * 1024 * 1024 * 6 = 6GB)를 주석 의도대로 60L * 1024 * 1024(60MB)로 수정 - TODO.md: 3-5 항목 완료 처리 - 검증: ./gradlew :app:compileDebugKotlin 빌드 성공 확인 (2s)
This commit is contained in:
@@ -110,7 +110,7 @@
|
||||
- `app/src/main/kotlin/bums/lunatic/launcher/player/PlayerActivity.kt:78-80` — `rebootEngine` 콜백에서 `Surface(videoTextureView.surfaceTexture!!)` 사용 시, 비동기 준비 완료 시점에 `TextureView`가 이미 해제(`surfaceTexture == null`)되었으면 `NullPointerException` 발생.
|
||||
- **작업**: `videoTextureView.surfaceTexture?.let { nativePlayer?.play(Surface(it)) }`로 null-safe 처리 및 `isDestroyed`/`isFinishing` 체크 추가.
|
||||
|
||||
- [ ] **3-5. `LunaticLauncher` 초기화 시 외부 저장소/GeckoRuntime 예외 처리**
|
||||
- [x] **3-5. `LunaticLauncher` 초기화 시 외부 저장소/GeckoRuntime 예외 처리**
|
||||
- `app/src/main/kotlin/bums/lunatic/launcher/LunaticLauncher.kt:119-126` — 하드코딩된 경로(`/storage/emulated/0/bums_ob/...`) 접근 시 권한이 없거나 경로 생성 실패 시 예외 처리 부재.
|
||||
- `app/src/main/kotlin/bums/lunatic/launcher/LunaticLauncher.kt:130` — 주석은 `// 60MB`이나 실제 계산식은 `1024L * 1024 * 1024 * 6` (6GB)로 되어 있어 디스크 공간/캐시 정책 확인 필요.
|
||||
- **작업**: `getExternalFilesDir` 기반 안전 경로 폴백 추가 및 캐시 크기 상수 점검.
|
||||
|
||||
@@ -117,18 +117,21 @@ prefs:
|
||||
privateCompletedDir = File(getExternalFilesDir(null), "completed_torrents")
|
||||
PrefHelper.initialize(this)
|
||||
Base64ImageCache.init(this)
|
||||
val dir = File("/storage/emulated/0/bums_ob/BUM'S PACED /scraped/logs")
|
||||
///BUM'S PACED/pdfs
|
||||
if (!dir.exists()) {
|
||||
dir.mkdirs()
|
||||
} else {
|
||||
// dir.listFiles().forEach { Blog.LOGE("child -> ${it.absolutePath}") }
|
||||
val dir = try {
|
||||
val externalDir = File("/storage/emulated/0/bums_ob/BUM'S PACED /scraped/logs")
|
||||
if (externalDir.exists() || externalDir.mkdirs()) {
|
||||
externalDir
|
||||
} else {
|
||||
File(getExternalFilesDir(null), "logs").apply { mkdirs() }
|
||||
}
|
||||
} catch (_: Exception) {
|
||||
File(getExternalFilesDir(null), "logs").apply { mkdirs() }
|
||||
}
|
||||
mHourlyLogWriter = HourlyLogWriter(dir)
|
||||
val logging = HttpLoggingInterceptor().apply {
|
||||
level = HttpLoggingInterceptor.Level.NONE
|
||||
}
|
||||
val cacheSize = 1024L * 1024 * 1024 * 6 // 60MB
|
||||
val cacheSize = 60L * 1024 * 1024 // 60MB
|
||||
val cache = Cache(File(this.filesDir, "picasso-cache"), cacheSize)
|
||||
val okHttpClient = OkHttpClient.Builder()
|
||||
.cache(cache)
|
||||
|
||||
Reference in New Issue
Block a user