Skip to content

Commit

Permalink
Fix cache delete on android from 6.x to 7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
veloce committed Feb 27, 2020
1 parent 7d5a86e commit c66964b
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,16 @@ private void openGooglePlayPage(String packageName) throws android.content.Activ
}

private void versionUpdateActions() {
// fix home quick setup loading bug when going from 6.x to 7.x
if (BuildConfig.VERSION_CODE == 7000019) {
SharedPreferences prefs = getSharedPreferences("LiVersionCheck", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = prefs.edit();
int previousVersionCode = prefs.getInt("LAST_VERSION_CODE", 0);
if (BuildConfig.VERSION_CODE > previousVersionCode) {
SharedPreferences prefs = getSharedPreferences("LiVersionCheck", Context.MODE_PRIVATE);
int previousVersionCode = prefs.getInt("LAST_VERSION_CODE", 0);
if (BuildConfig.VERSION_CODE > previousVersionCode) {
// fix home quick setup loading bug when going from 6.x to 7.x
if (previousVersionCode == 0) {
deleteDir(getApplicationContext().getCacheDir());
editor.putInt("LAST_VERSION_CODE", BuildConfig.VERSION_CODE);
editor.apply();
}
SharedPreferences.Editor editor = prefs.edit();
editor.putInt("LAST_VERSION_CODE", BuildConfig.VERSION_CODE);
editor.apply();
}
}

Expand Down

0 comments on commit c66964b

Please sign in to comment.