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

Commit b4921338 authored by Sridhar Dubbaka's avatar Sridhar Dubbaka Committed by Gerrit - the friendly Code Review server
Browse files

Fix for correct subscription in Cell Broadcast message

Issue: When CB message sent over SUB2, it displays as SUB1 in UI
Fix: Update the subscription ID as per CB message in Parcel

Change-Id: Iff4f2f52c95dbf557b953d8579c70e5c404ca7af
CRs-Fixed: 625204
parent dca77760
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.database.Cursor;
import android.os.Parcel;
import android.os.Parcelable;
import android.provider.Telephony;
import android.telephony.SubscriptionManager;
import android.text.format.DateUtils;

/**
@@ -54,7 +55,7 @@ public class CellBroadcastMessage implements Parcelable {
     *
     * @hide
     */
    private long mSubId = 0;
    private long mSubId;

    /**
     * set Subscription information
@@ -78,18 +79,21 @@ public class CellBroadcastMessage implements Parcelable {
        mSmsCbMessage = message;
        mDeliveryTime = System.currentTimeMillis();
        mIsRead = false;
        mSubId = SubscriptionManager.getDefaultSmsSubId();
    }

    private CellBroadcastMessage(SmsCbMessage message, long deliveryTime, boolean isRead) {
        mSmsCbMessage = message;
        mDeliveryTime = deliveryTime;
        mIsRead = isRead;
        mSubId = SubscriptionManager.getDefaultSmsSubId();
    }

    private CellBroadcastMessage(Parcel in) {
        mSmsCbMessage = new SmsCbMessage(in);
        mDeliveryTime = in.readLong();
        mIsRead = (in.readInt() != 0);
        mSubId = in.readLong();
    }

    /** Parcelable: no special flags. */
@@ -103,6 +107,7 @@ public class CellBroadcastMessage implements Parcelable {
        mSmsCbMessage.writeToParcel(out, flags);
        out.writeLong(mDeliveryTime);
        out.writeInt(mIsRead ? 1 : 0);
        out.writeLong(mSubId);
    }

    public static final Parcelable.Creator<CellBroadcastMessage> CREATOR