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

Commit 0ced792c authored by Shishir Agrawal's avatar Shishir Agrawal Committed by Cheuksan Wang
Browse files

Fail SmsManager requests if SubId is not active.

If subId is not active, expected subIds can be assigned to the messages being
processed due to SmsManager calls. The change will fail any SmsManager calls
if SubId is not active.

Bug: 18629526
Change-Id: I8da1b1e2c477f32dcbaff417fc4e14ba2a225414
parent cf9f5a16
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -1133,5 +1133,19 @@ public class SubscriptionManager {
        logd("getSimStateForSubscriber: simState=" + simState + " subId=" + subId);
        logd("getSimStateForSubscriber: simState=" + simState + " subId=" + subId);
        return simState;
        return simState;
    }
    }

    /**
     * @return true if the sub ID is active. i.e. The sub ID corresponds to a known subscription
     * and the SIM providing the subscription is present in a slot and in "LOADED" state.
     * @hide
     */
    public boolean isActiveSubId(int subId) {
        try {
            ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
            return iSub.isActiveSubId(subId);
        } catch (RemoteException ex) {
        }
        return false;
    }
}
}
+1 −0
Original line number Original line Diff line number Diff line
@@ -171,4 +171,5 @@ interface ISub {
     */
     */
    int getSimStateForSubscriber(int subId);
    int getSimStateForSubscriber(int subId);


    boolean isActiveSubId(int subId);
}
}