Fix bugs and add AOSP Android.bp

- gen-db.py: fix DB output path (assets/ not res/raw/)
- DeviceName: use Build.DEVICE for DB lookup, Build.PRODUCT for AltDeviceNames
- DeviceName: fix capitalize() for API 36 (replaceFirstChar)
- DBHelper: add 24h rate-limit on update checks via SharedPreferences
- DBHelper: make DB download atomic (write to .tmp then rename)
- DeviceInfo: wrap getCurrentDeviceInfo() in withContext(Dispatchers.IO)
- DeviceInfo: add 30-day SharedPreferences cache for device image URLs
- AltDeviceNames: rewrite with Entry class + byModel index for O(1) lookup
- Android.bp: add android_library module for AOSP source build
This commit is contained in:
oxmc
2026-06-17 06:12:27 -07:00
parent 22177d3be4
commit 13bc3ae50e
6 changed files with 145 additions and 154 deletions
+14
View File
@@ -0,0 +1,14 @@
android_library {
name: "android-device-info",
srcs: ["library/src/main/java/**/*.kt"],
asset_dirs: ["library/src/main/assets"],
sdk_version: "current",
min_sdk_version: "36",
kotlincflags: ["-Xjvm-default=all"],
static_libs: [
"kotlinx-coroutines-android",
"androidx.annotation_annotation",
"androidx.core_core-ktx",
],
visibility: ["//visibility:public"],
}