mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-22 01:51:47 +00:00
Regenerate device ID if the stored ID is not valid
This commit is contained in:
parent
e10f2496de
commit
28070954a6
@ -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")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user