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

Commit d78dac0b authored by Malcolm Chen's avatar Malcolm Chen Committed by Xiangyu/Malcolm Chen
Browse files

Adding validate before switch feature.

In CBRS DSDS mode, switching data to CBRS network will require
validation first. Adding a component of CellularNetworkValidator
to trigger the validation and pass the result back to PhoneSwitcher.

Bug: 118348832
Test: manual
Change-Id: I689aa494f031834b5cee76906922ebdafa9c77ed
Merged-In: I689aa494f031834b5cee76906922ebdafa9c77ed
parent 5bc4949f
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -2583,8 +2583,14 @@ public class SubscriptionManager {
    @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
    public void setPreferredDataSubscriptionId(int subId) {
        if (VDBG) logd("[setPreferredDataSubscriptionId]+ subId:" + subId);
        setSubscriptionPropertyHelper(DEFAULT_SUBSCRIPTION_ID, "setPreferredDataSubscriptionId",
                (iSub)-> iSub.setPreferredDataSubscriptionId(subId));
        try {
            ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
            if (iSub != null) {
                iSub.setPreferredDataSubscriptionId(subId);
            }
        } catch (RemoteException ex) {
            // ignore it
        }
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ interface ISub {
     * @hide
     *
     */
    int setPreferredDataSubscriptionId(int subId);
    void setPreferredDataSubscriptionId(int subId);

    /**
     * Get which subscription is preferred for cellular data.