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

Commit 712cdaf4 authored by Cheuksan Wang's avatar Cheuksan Wang Committed by Android Partner Code Review
Browse files

Merge "Fail SmsManager requests if SubId is not active." into m-wireless-dev

parents 44a05269 0ced792c
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);
}
}