2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-22 18:07:55 +00:00

Regenerate device ID if the stored ID is not valid

This commit is contained in:
Albert Vaca Cintora 2025-04-05 00:02:22 +02:00
parent e10f2496de
commit 28070954a6
No known key found for this signature in database

View File

@ -129,8 +129,8 @@ object DeviceHelper {
fun initializeDeviceId(context: Context) { fun initializeDeviceId(context: Context) {
val preferences = PreferenceManager.getDefaultSharedPreferences(context) val preferences = PreferenceManager.getDefaultSharedPreferences(context)
val preferenceKeys: Set<String> = preferences.all.keys val deviceId = preferences.getString(KEY_DEVICE_ID_PREFERENCE, "")!!
if (preferenceKeys.contains(KEY_DEVICE_ID_PREFERENCE)) { if (DeviceInfo.isValidDeviceId(deviceId)) {
return // We already have an ID return // We already have an ID
} }
@SuppressLint("HardwareIds") @SuppressLint("HardwareIds")