@@ -266,7 +266,7 @@ private void internalSyncUserState(boolean fromSyncService) {
266
266
final boolean isSessionCall = !fromSyncService && isSessionCall ();
267
267
JSONObject jsonBody , dependDiff ;
268
268
synchronized (LOCK ) {
269
- jsonBody = currentUserState .generateJsonDiff (getToSyncUserState (), isSessionCall );
269
+ jsonBody = getCurrentUserState () .generateJsonDiff (getToSyncUserState (), isSessionCall );
270
270
UserState toSyncState = getToSyncUserState ();
271
271
dependDiff = currentUserState .generateJsonDiffFromDependValues (toSyncState , null );;
272
272
OneSignal .onesignalLog (OneSignal .LOG_LEVEL .DEBUG , "UserStateSynchronizer internalSyncUserState from session call: " + isSessionCall + " jsonBody: " + jsonBody );
@@ -290,7 +290,7 @@ private void doEmailLogout(String userId) {
290
290
String urlStr = "players/" + userId + "/email_logout" ;
291
291
JSONObject jsonBody = new JSONObject ();
292
292
try {
293
- ImmutableJSONObject dependValues = currentUserState .getDependValues ();
293
+ ImmutableJSONObject dependValues = getCurrentUserState () .getDependValues ();
294
294
if (dependValues .has (EMAIL_AUTH_HASH_KEY ))
295
295
jsonBody .put (EMAIL_AUTH_HASH_KEY , dependValues .optString (EMAIL_AUTH_HASH_KEY ));
296
296
@@ -333,7 +333,7 @@ private void logoutEmailSyncSuccess() {
333
333
toSyncUserState .removeFromSyncValues (EMAIL_KEY );
334
334
toSyncUserState .persistState ();
335
335
336
- currentUserState .removeFromDependValues (EMAIL_AUTH_HASH_KEY );
336
+ getCurrentUserState () .removeFromDependValues (EMAIL_AUTH_HASH_KEY );
337
337
currentUserState .removeFromSyncValues (PARENT_PLAYER_ID );
338
338
String emailLoggedOut = currentUserState .getSyncValues ().optString (EMAIL_KEY );
339
339
currentUserState .removeFromSyncValues (EMAIL_KEY );
@@ -379,7 +379,7 @@ void onFailure(int statusCode, String response, Throwable throwable) {
379
379
@ Override
380
380
void onSuccess (String response ) {
381
381
synchronized (LOCK ) {
382
- currentUserState .persistStateAfterSync (dependDiff , jsonBody );
382
+ getCurrentUserState () .persistStateAfterSync (dependDiff , jsonBody );
383
383
onSuccessfulSync (jsonBody );
384
384
}
385
385
@@ -422,7 +422,7 @@ void onFailure(int statusCode, String response, Throwable throwable) {
422
422
void onSuccess (String response ) {
423
423
synchronized (LOCK ) {
424
424
waitingForSessionResponse = false ;
425
- currentUserState .persistStateAfterSync (dependDiff , jsonBody );
425
+ getCurrentUserState () .persistStateAfterSync (dependDiff , jsonBody );
426
426
427
427
try {
428
428
OneSignal .onesignalLog (OneSignal .LOG_LEVEL .DEBUG , "doCreateOrNewSession:response: " + response );
@@ -468,7 +468,7 @@ private void handleNetworkFailure(int statusCode) {
468
468
}
469
469
470
470
private void fireNetworkFailureEvents () {
471
- final JSONObject jsonBody = currentUserState .generateJsonDiff (toSyncUserState , false );
471
+ final JSONObject jsonBody = getCurrentUserState () .generateJsonDiff (toSyncUserState , false );
472
472
if (jsonBody != null )
473
473
fireEventsForUpdateFailure (jsonBody );
474
474
@@ -570,7 +570,7 @@ private void handlePlayerDeletedFromServer() {
570
570
}
571
571
572
572
void resetCurrentState () {
573
- currentUserState .setSyncValues (new JSONObject ());
573
+ getCurrentUserState () .setSyncValues (new JSONObject ());
574
574
currentUserState .persistState ();
575
575
}
576
576
0 commit comments