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

Commit 4c32333

Browse files
committed
Merge branch 'hotfix/2196'
2 parents 191faef + 8b5f6d7 commit 4c32333

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
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.8 (2018-05-13)
2+
===================================================
3+
4+
Bug Fix:
5+
* Background sync cannot be enabled on F-Droid Riot app (#2196)
6+
17
Changes in Riot 0.8.7 (2018-04-25)
28
===================================================
39

build.gradle

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

1515
// global properties used in sub modules
1616
ext {
17-
versionCodeProp = 80700
18-
versionNameProp = "0.8.7"
17+
versionCodeProp = 80800
18+
versionNameProp = "0.8.8"
1919
versionBuild = System.getenv("BUILD_NUMBER") as Integer ?: 0
2020
buildNumberProp = "${versionBuild}"
2121
}

vector/src/main/java/im/vector/gcm/GcmRegistrationManager.java

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,15 @@
2929
import android.text.TextUtils;
3030

3131
import org.matrix.androidsdk.HomeServerConnectionConfig;
32-
import org.matrix.androidsdk.rest.callback.SimpleApiCallback;
33-
import org.matrix.androidsdk.rest.client.PushersRestClient;
34-
import org.matrix.androidsdk.util.Log;
35-
3632
import org.matrix.androidsdk.MXSession;
3733
import org.matrix.androidsdk.data.Pusher;
3834
import org.matrix.androidsdk.listeners.IMXNetworkEventListener;
3935
import org.matrix.androidsdk.rest.callback.ApiCallback;
36+
import org.matrix.androidsdk.rest.callback.SimpleApiCallback;
37+
import org.matrix.androidsdk.rest.client.PushersRestClient;
4038
import org.matrix.androidsdk.rest.model.MatrixError;
4139
import org.matrix.androidsdk.rest.model.PushersResponse;
42-
43-
import im.vector.Matrix;
44-
import im.vector.R;
45-
import im.vector.activity.CommonActivityUtils;
46-
import im.vector.util.PreferencesManager;
40+
import org.matrix.androidsdk.util.Log;
4741

4842
import java.util.ArrayList;
4943
import java.util.HashMap;
@@ -52,6 +46,11 @@
5246
import java.util.Timer;
5347
import java.util.TimerTask;
5448

49+
import im.vector.Matrix;
50+
import im.vector.R;
51+
import im.vector.activity.CommonActivityUtils;
52+
import im.vector.util.PreferencesManager;
53+
5554
/**
5655
* Helper class to store the GCM registration ID in {@link SharedPreferences}
5756
*/
@@ -1128,12 +1127,9 @@ public NotificationPrivacy getNotificationPrivacy() {
11281127
boolean isContentSendingAllowed = isContentSendingAllowed();
11291128
boolean isBackgroundSyncAllowed = isBackgroundSyncAllowed();
11301129

1131-
if (isContentSendingAllowed && !isBackgroundSyncAllowed)
1132-
{
1130+
if (isContentSendingAllowed && !isBackgroundSyncAllowed) {
11331131
notificationPrivacy = NotificationPrivacy.REDUCED;
1134-
}
1135-
else if (!isContentSendingAllowed && isBackgroundSyncAllowed)
1136-
{
1132+
} else if (!isContentSendingAllowed && isBackgroundSyncAllowed) {
11371133
notificationPrivacy = NotificationPrivacy.NORMAL;
11381134
}
11391135

@@ -1218,10 +1214,10 @@ public void setScreenTurnedOn(boolean flag) {
12181214
* @return true if the background sync is allowed
12191215
*/
12201216
public boolean isBackgroundSyncAllowed() {
1221-
// first check if the application has the "run in background" permission.
1217+
// If using GCM, first check if the application has the "run in background" permission.
12221218
// No permission, no background sync
1223-
if (!PreferencesManager.isIgnoringBatteryOptimizations(mContext))
1224-
{
1219+
if (hasRegistrationToken()
1220+
&& !PreferencesManager.isIgnoringBatteryOptimizations(mContext)) {
12251221
return false;
12261222
}
12271223

0 commit comments

Comments
 (0)