Detect GV2 capability in non-gcm Android devices

This commit is contained in:
Alan Evans
2020-09-28 16:54:10 -03:00
committed by GitHub
parent 9339823e84
commit e64c8007c0
2 changed files with 50 additions and 34 deletions

View File

@@ -255,13 +255,13 @@ public class Device {
final boolean groupsV2Supported;
if (this.capabilities != null) {
if (this.getGcmId() != null) {
groupsV2Supported = this.capabilities.isGv2() || this.capabilities.isGv2_2() || this.capabilities.isGv2_3();
} else if (this.apnId != null || this.voipApnId != null) {
groupsV2Supported = this.capabilities.isGv2_2() || this.capabilities.isGv2_3();
} else {
groupsV2Supported = this.capabilities.isGv2_3();
}
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();
} else {
groupsV2Supported = false;
}