Skip to content

Commit

Permalink
Clear cached session id when restoring from backup
Browse files Browse the repository at this point in the history
  • Loading branch information
daneren2005 committed Nov 10, 2016
1 parent d0de29c commit 94ba466
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import android.app.backup.BackupAgentHelper;
import android.app.backup.BackupDataInput;
import android.app.backup.SharedPreferencesBackupHelper;
import android.content.SharedPreferences;
import android.os.ParcelFileDescriptor;

import java.io.IOError;
Expand All @@ -39,6 +40,10 @@ public void onCreate() {
@Override
public void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState) throws IOException{
super.onRestore(data, appVersionCode, newState);
Util.getPreferences(this).edit().remove(Constants.PREFERENCES_KEY_CACHE_LOCATION).apply();

SharedPreferences.Editor editor = Util.getPreferences(this).edit();
editor.remove(Constants.PREFERENCES_KEY_CACHE_LOCATION);
editor.remove(Constants.CACHE_AUDIO_SESSION_ID);
editor.apply();
}
}

0 comments on commit 94ba466

Please sign in to comment.