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

Commit 5837dcdb authored by Xiangyu/Malcolm Chen's avatar Xiangyu/Malcolm Chen Committed by Android (Google) Code Review
Browse files

Merge "Add System API to enable / disable a logical modem."

parents 5d5e9827 cf21ad75
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -6892,6 +6892,7 @@ package android.telephony {
    method public void dial(java.lang.String);
    method public void dial(java.lang.String);
    method public boolean disableDataConnectivity();
    method public boolean disableDataConnectivity();
    method public boolean enableDataConnectivity();
    method public boolean enableDataConnectivity();
    method public boolean enableModemForSlot(int, boolean);
    method public void enableVideoCalling(boolean);
    method public void enableVideoCalling(boolean);
    method public java.lang.String getAidForAppType(int);
    method public java.lang.String getAidForAppType(int);
    method public deprecated java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers(int);
    method public deprecated java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers(int);
+29 −0
Original line number Original line Diff line number Diff line
@@ -10074,4 +10074,33 @@ public class TelephonyManager {
        }
        }
        return ret;
        return ret;
    }
    }

    /**
     * Enable or disable a logical modem stack. When a logical modem is disabled, the corresponding
     * SIM will still be visible to the user but its mapping modem will not have any radio activity.
     * For example, we will disable a modem when user or system believes the corresponding SIM
     * is temporarily not needed (e.g. out of coverage), and will enable it back on when needed.
     *
     * Requires that the calling app has permission
     * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
     * @param slotIndex which corresponding modem will operate on.
     * @param enable whether to enable or disable the modem stack.
     * @return whether the operation is successful.
     *
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
    public boolean enableModemForSlot(int slotIndex, boolean enable) {
        boolean ret = false;
        try {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
                ret = telephony.enableModemForSlot(slotIndex, enable);
            }
        } catch (RemoteException ex) {
            Log.e(TAG, "enableModem RemoteException", ex);
        }
        return ret;
    }
}
}
+5 −0
Original line number Original line Diff line number Diff line
@@ -1793,4 +1793,9 @@ interface ITelephony {
     * Get the full emergency number list for Test Mode.
     * Get the full emergency number list for Test Mode.
     */
     */
    List<String> getEmergencyNumberListTestMode();
    List<String> getEmergencyNumberListTestMode();

    /**
     * Enable or disable a logical modem stack associated with the slotIndex.
     */
    boolean enableModemForSlot(int slotIndex, boolean enable);
}
}
+1 −0
Original line number Original line Diff line number Diff line
@@ -489,6 +489,7 @@ public interface RILConstants {
    int RIL_REQUEST_STOP_NETWORK_SCAN = 143;
    int RIL_REQUEST_STOP_NETWORK_SCAN = 143;
    int RIL_REQUEST_START_KEEPALIVE = 144;
    int RIL_REQUEST_START_KEEPALIVE = 144;
    int RIL_REQUEST_STOP_KEEPALIVE = 145;
    int RIL_REQUEST_STOP_KEEPALIVE = 145;
    int RIL_REQUEST_ENABLE_MODEM = 146;


    /* The following requests are not defined in RIL.h */
    /* The following requests are not defined in RIL.h */
    int RIL_REQUEST_HAL_NON_RIL_BASE = 200;
    int RIL_REQUEST_HAL_NON_RIL_BASE = 200;