Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rework DeviceInfo.kt #526

Merged
merged 1 commit into from
Nov 13, 2024
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
6 changes: 1 addition & 5 deletions app/src/main/java/org/koreader/launcher/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,7 @@ class MainActivity : NativeActivity(), LuaInterface,
}

override fun hasNativeRotation(): Boolean {
return if (platform == "android") {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
!(device.bugRotation)
} else false
} else false
return platform == "android" && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT
}

override fun hasOTAUpdates(): Boolean {
Expand Down
6 changes: 2 additions & 4 deletions app/src/main/java/org/koreader/launcher/device/Device.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class Device(activity: Activity) {
@Suppress("unused")
val product = DeviceInfo.PRODUCT
val needsWakelocks = DeviceInfo.QUIRK_NEEDS_WAKELOCKS
val bugRotation = DeviceInfo.QUIRK_NO_HW_ROTATION
val bugLifecycle = DeviceInfo.QUIRK_BROKEN_LIFECYCLE
val hasColorScreen = DeviceInfo.HAS_COLOR_SCREEN

Expand All @@ -31,13 +30,12 @@ class Device(activity: Activity) {
val einkPlatform = epd.getPlatform()

val properties: String
get() = String.format("%s;%s;%s;%s;%s;%s;%b;%b",
get() = String.format("%s;%s;%s;%s;%s;%s",
DeviceInfo.MANUFACTURER,
DeviceInfo.BRAND,
DeviceInfo.MODEL,
DeviceInfo.DEVICE,
DeviceInfo.PRODUCT,
DeviceInfo.HARDWARE,
DeviceInfo.BOYUE,
DeviceInfo.TOLINO)
)
}
Loading