Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit fd39561

Browse files
committed
Merge branch 'master' into develop
2 parents b8ea2ee + 4acd48d commit fd39561

File tree

5 files changed

+36
-10
lines changed

5 files changed

+36
-10
lines changed

CHANGES.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Changes in Riot 0.8.12 (2018-07-06)
2+
===================================================
3+
4+
Bugfix:
5+
- Fix issue on vanished favorite and low priority room (#2413)
6+
17
Changes in Riot 0.8.11 (2018-07-03)
28
===================================================
39

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ buildscript {
1919

2020
// global properties used in sub modules
2121
ext {
22-
versionCodeProp = 81101
23-
versionNameProp = "0.8.11"
22+
versionCodeProp = 81200
23+
versionNameProp = "0.8.12"
2424
versionBuild = System.getenv("BUILD_NUMBER") as Integer ?: 0
2525
buildNumberProp = "${versionBuild}"
2626
}

vector/src/main/java/im/vector/activity/SplashActivity.java

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
package im.vector.activity;
1919

2020
import android.content.Intent;
21+
import android.os.Build;
2122
import android.os.Bundle;
23+
import android.preference.PreferenceManager;
2224

2325
import org.jetbrains.annotations.NotNull;
2426
import org.matrix.androidsdk.MXSession;
@@ -39,6 +41,7 @@
3941
import im.vector.gcm.GcmRegistrationManager;
4042
import im.vector.receiver.VectorUniversalLinkReceiver;
4143
import im.vector.services.EventStreamService;
44+
import im.vector.util.PreferencesManager;
4245
import kotlin.Pair;
4346

4447
/**
@@ -50,11 +53,13 @@ public class SplashActivity extends MXCActionBarActivity {
5053
public static final String EXTRA_MATRIX_ID = "EXTRA_MATRIX_ID";
5154
public static final String EXTRA_ROOM_ID = "EXTRA_ROOM_ID";
5255

53-
private Map<MXSession, IMXEventListener> mListeners;
54-
private Map<MXSession, IMXEventListener> mDoneListeners;
56+
private Map<MXSession, IMXEventListener> mListeners = new HashMap<>();
57+
private Map<MXSession, IMXEventListener> mDoneListeners = new HashMap<>();
5558

5659
private final long mLaunchTime = System.currentTimeMillis();
5760

61+
private static final String NEED_TO_CLEAR_CACHE_BEFORE_81200 = "NEED_TO_CLEAR_CACHE_BEFORE_81200";
62+
5863
/**
5964
* @return true if a store is corrupted.
6065
*/
@@ -133,8 +138,22 @@ public void initUiAndData() {
133138
return;
134139
}
135140

136-
mListeners = new HashMap<>();
137-
mDoneListeners = new HashMap<>();
141+
// Check if store is corrupted, due to change of type of some maps from HashMap to Map in Serialized objects
142+
// Only on Android 7.1+
143+
// Only if previous versionCode of the installation is < 81200
144+
// Only once
145+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1
146+
&& PreferenceManager.getDefaultSharedPreferences(this).getInt(PreferencesManager.VERSION_BUILD, 0) < 81200
147+
&& PreferenceManager.getDefaultSharedPreferences(this).getBoolean(NEED_TO_CLEAR_CACHE_BEFORE_81200, true)) {
148+
PreferenceManager.getDefaultSharedPreferences(this)
149+
.edit()
150+
.putBoolean(NEED_TO_CLEAR_CACHE_BEFORE_81200, false)
151+
.apply();
152+
153+
// Force a clear cache
154+
Matrix.getInstance(this).reloadSessions(this);
155+
return;
156+
}
138157

139158
List<String> matrixIds = new ArrayList<>();
140159

vector/src/main/java/im/vector/activity/VectorHomeActivity.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,16 +321,15 @@ public void initUiAndData() {
321321

322322
// track if the application update
323323
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
324-
int version = preferences.getInt("VERSION_BUILD", 0);
324+
int version = preferences.getInt(PreferencesManager.VERSION_BUILD, 0);
325325

326326
if (version != VectorApp.VERSION_BUILD) {
327327
Log.d(LOG_TAG, "The application has been updated from version " + version + " to version " + VectorApp.VERSION_BUILD);
328328

329329
// TODO add some dedicated actions here
330330

331-
preferences
332-
.edit()
333-
.putInt("VERSION_BUILD", VectorApp.VERSION_BUILD)
331+
preferences.edit()
332+
.putInt(PreferencesManager.VERSION_BUILD, VectorApp.VERSION_BUILD)
334333
.apply();
335334
}
336335

vector/src/main/java/im/vector/util/PreferencesManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public class PreferencesManager {
4444

4545
private static final String LOG_TAG = PreferencesManager.class.getSimpleName();
4646

47+
public static final String VERSION_BUILD = "VERSION_BUILD";
48+
4749
public static final String SETTINGS_MESSAGES_SENT_BY_BOT_PREFERENCE_KEY = "SETTINGS_MESSAGES_SENT_BY_BOT_PREFERENCE_KEY_2";
4850
public static final String SETTINGS_CHANGE_PASSWORD_PREFERENCE_KEY = "SETTINGS_CHANGE_PASSWORD_PREFERENCE_KEY";
4951
public static final String SETTINGS_VERSION_PREFERENCE_KEY = "SETTINGS_VERSION_PREFERENCE_KEY";

0 commit comments

Comments
 (0)