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

Commit 4b9edae9 authored by Umashankar Godachi's avatar Umashankar Godachi Committed by Chaitanya Saggurthi
Browse files

Read the voice message count properly

When Voice message count is available from
EF, do not read from preference.

Bug: 35025528
Change-Id: Id87ed25f7f912674e405e92b44a5140cd4b29cf7
parent 8caf74e5
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -469,9 +469,8 @@ public class GsmCdmaPhone extends Phone {
                // get voice mail count from SIM
                countVoiceMessages = r.getVoiceMessageCount();
            }
            int countVoiceMessagesStored = getStoredVoiceMessageCount();
            if (countVoiceMessages == -1 && countVoiceMessagesStored != 0) {
                countVoiceMessages = countVoiceMessagesStored;
            if (countVoiceMessages == IccRecords.DEFAULT_VOICE_MESSAGE_COUNT) {
                countVoiceMessages = getStoredVoiceMessageCount();
            }
            logd("updateVoiceMail countVoiceMessages = " + countVoiceMessages
                    + " subId " + getSubId());
+3 −0
Original line number Diff line number Diff line
@@ -120,6 +120,9 @@ public abstract class IccRecords extends Handler implements IccConstants {
    public static final int CALL_FORWARDING_STATUS_ENABLED = 1;
    public static final int CALL_FORWARDING_STATUS_UNKNOWN = -1;

    public static final int DEFAULT_VOICE_MESSAGE_COUNT = -2;
    public static final int UNKNOWN_VOICE_MESSAGE_COUNT = -1;

    @Override
    public String toString() {
        String iccIdToPrint = SubscriptionInfo.givePrintableIccid(mFullIccId);
+3 −3
Original line number Diff line number Diff line
@@ -511,7 +511,7 @@ public class SIMRecords extends IccRecords {

    public int getVoiceMessageCount() {
        boolean voiceMailWaiting = false;
        int countVoiceMessages = 0;
        int countVoiceMessages = DEFAULT_VOICE_MESSAGE_COUNT;
        if (mEfMWIS != null) {
            // Use this data if the EF[MWIS] exists and
            // has been loaded
@@ -521,7 +521,7 @@ public class SIMRecords extends IccRecords {

            if (voiceMailWaiting && countVoiceMessages == 0) {
                // Unknown count = -1
                countVoiceMessages = -1;
                countVoiceMessages = UNKNOWN_VOICE_MESSAGE_COUNT;
            }
            if(DBG) log(" VoiceMessageCount from SIM MWIS = " + countVoiceMessages);
        } else if (mEfCPHS_MWI != null) {
@@ -531,7 +531,7 @@ public class SIMRecords extends IccRecords {
            // Refer CPHS4_2.WW6 B4.2.3
            if (indicator == 0xA) {
                // Unknown count = -1
                countVoiceMessages = -1;
                countVoiceMessages = UNKNOWN_VOICE_MESSAGE_COUNT;
            } else if (indicator == 0x5) {
                countVoiceMessages = 0;
            }