Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 020211c4 authored by Hyunho's avatar Hyunho
Browse files

Fixed incorrect count logic

The no_cap count is incorrect when checking the capability of
the presence notification event.
If the pidfXml has rcs_cap, mmtel_cap and no_cap,
the no_cap count must be set to zero.
This is because either rcs or mmtel cap is included in the xml

Bug: b/207321490
Test: atest RcsStatsTest

Change-Id: I867a3ef33738de1444a375083a7033e597862026
Merged-In: I867a3ef33738de1444a375083a7033e597862026
parent 43115339
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -603,7 +603,7 @@ public class RcsStats {
            for (RcsContactUceCapability capability : updatedCapList) {
                boolean rcsCap = false;
                boolean mmtelCap = false;
                boolean noCap = false;
                boolean noCap = true;
                List<RcsContactPresenceTuple> tupleList = capability.getCapabilityTuples();
                if (tupleList.isEmpty()) {
                    noCap = true;
@@ -615,16 +615,17 @@ public class RcsStats {
                    String serviceId = tuple.getServiceId();
                    if (RCS_SERVICE_ID_SET.contains(serviceId)) {
                        rcsCap = true;
                        noCap = false;
                    } else if (MMTEL_SERVICE_ID_SET.contains(serviceId)) {
                        if (serviceId.equals(RcsContactPresenceTuple.SERVICE_ID_CALL_COMPOSER)) {
                            if ("1.0".equals(tuple.getServiceVersion())) {
                                rcsCap = true;
                                noCap = false;
                                continue;
                            }
                        }
                        mmtelCap = true;
                    } else {
                        noCap = true;
                        noCap = false;
                    }
                }
                mRcsStats.onPresenceNotifyEvent(subId, "", true, rcsCap,