Skip to content

Commit

Permalink
fix device id empty (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenxi-zeng authored Sep 26, 2023
1 parent 2dc0174 commit 3abff0d
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,8 @@ class AndroidContextPlugin : Plugin {
deviceId = task.await()
}

if (deviceId != fallbackDeviceId) {
device = updateJsonObject(device) {
it[DEVICE_ID_KEY] = deviceId
}
device = updateJsonObject(device) {
it[DEVICE_ID_KEY] = deviceId
}

storage.write(Storage.Constants.DeviceId, deviceId)
Expand All @@ -173,7 +171,7 @@ class AndroidContextPlugin : Plugin {

internal fun getDeviceId(collectDeviceId: Boolean, fallbackDeviceId: String): String {
if (!collectDeviceId) {
return storage.read(Storage.Constants.AnonymousId) ?: ""
return storage.read(Storage.Constants.AnonymousId) ?: fallbackDeviceId
}

// unique id generated from DRM API
Expand Down

0 comments on commit 3abff0d

Please sign in to comment.