@@ -584,9 +584,9 @@ public void run() {
584
584
StatisticsService .reportEvent (StatisticsConstants .ACTFM_NEW_USER , "provider" , provider );
585
585
}
586
586
// Successful login, create outstanding entries
587
- long lastId = Preferences .getLong (ActFmPreferenceService .PREF_USER_ID , 0 );
587
+ String lastId = ActFmPreferenceService . userId (); // Preferences.getLong(ActFmPreferenceService.PREF_USER_ID, 0);
588
588
589
- if (!TextUtils .isEmpty (token ) && lastId == 0 ) {
589
+ if (!TextUtils .isEmpty (token ) && RemoteModel . isUuidEmpty ( lastId ) ) {
590
590
constructOutstandingTables ();
591
591
}
592
592
runOnUiThread (new Runnable () {
@@ -620,11 +620,11 @@ private void constructOutstandingTables() {
620
620
621
621
@ SuppressWarnings ("nls" )
622
622
private void postAuthenticate (final JSONObject result , final String token ) {
623
- long lastLoggedInUser = Preferences . getLong ( ActFmPreferenceService .PREF_USER_ID , 0 );
623
+ String lastLoggedInUser = ActFmPreferenceService .userId ( );
624
624
625
- if (lastLoggedInUser > 0 ) {
626
- long newUserId = result .optLong ("id" );
627
- if (lastLoggedInUser != newUserId ) {
625
+ if (RemoteModel . isValidUuid ( lastLoggedInUser ) ) {
626
+ String newUserId = Long . toString ( result .optLong ("id" ) );
627
+ if (! lastLoggedInUser . equals ( newUserId ) ) {
628
628
// In this case, we need to either make all data private or clear all data
629
629
// Prompt for choice
630
630
DialogUtilities .okCancelCustomDialog (this ,
@@ -831,8 +831,8 @@ private <T extends RemoteModel> void mapUuids(RemoteModelDao<T> dao, HashMap<Str
831
831
private void finishSignIn (JSONObject result , String token , boolean restart ) {
832
832
actFmPreferenceService .setToken (token );
833
833
834
- Preferences .setLong (ActFmPreferenceService .PREF_USER_ID ,
835
- result .optLong ("id" ));
834
+ Preferences .setString (ActFmPreferenceService .PREF_USER_ID ,
835
+ Long . toString ( result .optLong ("id" ) ));
836
836
Preferences .setString (ActFmPreferenceService .PREF_NAME ,
837
837
result .optString ("name" ));
838
838
Preferences .setString (ActFmPreferenceService .PREF_FIRST_NAME ,
0 commit comments