Skip to content

Commit 3abff0d

Browse files
authored
fix device id empty (#183)
1 parent 2dc0174 commit 3abff0d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

android/src/main/java/com/segment/analytics/kotlin/android/plugins/AndroidContextPlugin.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,8 @@ class AndroidContextPlugin : Plugin {
161161
deviceId = task.await()
162162
}
163163

164-
if (deviceId != fallbackDeviceId) {
165-
device = updateJsonObject(device) {
166-
it[DEVICE_ID_KEY] = deviceId
167-
}
164+
device = updateJsonObject(device) {
165+
it[DEVICE_ID_KEY] = deviceId
168166
}
169167

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

174172
internal fun getDeviceId(collectDeviceId: Boolean, fallbackDeviceId: String): String {
175173
if (!collectDeviceId) {
176-
return storage.read(Storage.Constants.AnonymousId) ?: ""
174+
return storage.read(Storage.Constants.AnonymousId) ?: fallbackDeviceId
177175
}
178176

179177
// unique id generated from DRM API

0 commit comments

Comments
 (0)