Browse Source

android: persist Amplitude device id when not set externally

Co-authored-by: Titus-Andrei Moldovan <moldovan.titus@gmail.com>
master
tmoldovan8x8 5 years ago
parent
commit
2085851179
No account linked to committer's email address

+ 4
- 0
android/sdk/src/main/java/org/jitsi/meet/sdk/AmplitudeModule.java View File

66
         String android_id = sharedPreferences.getString(AMPLITUDE_DEVICE_ID_KEY, "");
66
         String android_id = sharedPreferences.getString(AMPLITUDE_DEVICE_ID_KEY, "");
67
         if (!TextUtils.isEmpty(android_id)) {
67
         if (!TextUtils.isEmpty(android_id)) {
68
             Amplitude.getInstance(instanceName).setDeviceId(android_id);
68
             Amplitude.getInstance(instanceName).setDeviceId(android_id);
69
+        } else {
70
+            String amplitudeId = Amplitude.getInstance(instanceName).getDeviceId();
71
+            SharedPreferences.Editor editor = sharedPreferences.edit();
72
+            editor.putString(JITSI_PREFERENCES, amplitudeId).apply();
69
         }
73
         }
70
     }
74
     }
71
 
75
 

Loading…
Cancel
Save