Update a few things

This commit is contained in:
2025-08-07 19:01:52 -07:00
parent e52e2f76fe
commit 4cd4b7e0ef
6 changed files with 9 additions and 10 deletions

View File

@@ -19,8 +19,8 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage import coil.compose.AsyncImage
import dev.oxmc.androiddevicenames.DeviceInfo import dev.oxmc.androiddeviceinfo.DeviceInfo
import dev.oxmc.androiddevicenames.AndroidInfo import dev.oxmc.androiddeviceinfo.AndroidInfo
import dev.oxmc.androiddeviceinfo_demo.ui.theme.AndroidDeviceInfoTheme import dev.oxmc.androiddeviceinfo_demo.ui.theme.AndroidDeviceInfoTheme
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@@ -66,12 +66,13 @@ fun DeviceInfoScreen() {
androidVersion = "${AndroidInfo.Version.release} (SDK ${AndroidInfo.Version.sdkInt})" androidVersion = "${AndroidInfo.Version.release} (SDK ${AndroidInfo.Version.sdkInt})"
serial = if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { serial = if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
@Suppress("DEPRECATION")
Build.SERIAL.takeIf { it != Build.UNKNOWN } Build.SERIAL.takeIf { it != Build.UNKNOWN }
?: Settings.Secure.getString(context.contentResolver, Settings.Secure.ANDROID_ID) ?: Settings.Secure.getString(context.contentResolver, Settings.Secure.ANDROID_ID)
} else { } else {
try { try {
Build.getSerial() Build.getSerial()
} catch (e: SecurityException) { } catch (_: SecurityException) {
Settings.Secure.getString(context.contentResolver, Settings.Secure.ANDROID_ID) Settings.Secure.getString(context.contentResolver, Settings.Secure.ANDROID_ID)
} }
} }

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package dev.oxmc.androiddevicenames package dev.oxmc.androiddeviceinfo
object AltDeviceNames { object AltDeviceNames {
/** /**

View File

@@ -1,4 +1,4 @@
package dev.oxmc.androiddevicenames package dev.oxmc.androiddeviceinfo
import android.content.Context import android.content.Context
import android.os.Build import android.os.Build

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package dev.oxmc.androiddevicenames package dev.oxmc.androiddeviceinfo
import android.content.Context import android.content.Context
import android.database.SQLException import android.database.SQLException

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package dev.oxmc.androiddevicenames package dev.oxmc.androiddeviceinfo
import android.content.Context import android.content.Context
import android.os.Build import android.os.Build

View File

@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package dev.oxmc.androiddevicenames package dev.oxmc.androiddeviceinfo
import android.content.Context import android.content.Context
import android.os.Build import android.os.Build
@@ -75,8 +75,6 @@ object AndroidDeviceInfo {
model model
} }
//Log.i("DeviceInfo", "Device name: $finalDeviceName, codename: $codename, model: $model, manufacturer: $manufacturer")
return DeviceInfo(manufacturer, finalDeviceName, codename, model) return DeviceInfo(manufacturer, finalDeviceName, codename, model)
} }