Require Android clients to support the gv2-3 capability

This commit is contained in:
Jon Chambers
2020-10-06 16:49:49 -04:00
committed by GitHub
parent 96cbdd5c37
commit e1c397993d
4 changed files with 10 additions and 20 deletions

View File

@@ -252,8 +252,9 @@ public class DeviceController {
if (account.isGroupsV2Supported()) {
try {
switch (UserAgentUtil.parseUserAgentString(userAgent).getPlatform()) {
case DESKTOP:
case ANDROID: {
if (!capabilities.isGv2() && !capabilities.isGv2_2() && !capabilities.isGv2_3()) {
if (!capabilities.isGv2_3()) {
isDowngrade = true;
}
@@ -267,14 +268,6 @@ public class DeviceController {
break;
}
case DESKTOP: {
if (!capabilities.isGv2_3()) {
isDowngrade = true;
}
break;
}
}
} catch (final UnrecognizedUserAgentException e) {
// If we can't parse the UA string, the client is for sure too old to support groups V2

View File

@@ -255,13 +255,9 @@ public class Device {
final boolean groupsV2Supported;
if (this.capabilities != null) {
boolean ios = this.apnId != null || this.voipApnId != null;
boolean android = isMaster() && !ios;
if (android) groupsV2Supported = this.capabilities.isGv2() || this.capabilities.isGv2_2() || this.capabilities.isGv2_3();
else if (ios) groupsV2Supported = this.capabilities.isGv2_2() || this.capabilities.isGv2_3();
else groupsV2Supported = this.capabilities.isGv2_3();
final boolean ios = this.apnId != null || this.voipApnId != null;
groupsV2Supported = this.capabilities.isGv2_3() || (ios && this.capabilities.isGv2_2());
} else {
groupsV2Supported = false;
}