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

Commit afd0087a authored by Malcolm Chen's avatar Malcolm Chen
Browse files

Add @hide API to return whether a modem stack is enabled or not.

Bug: 129296702
Test: TelephonyManagerTestApp
Change-Id: I7ef4ad8322cf85e5a159363e90dde303ac7240de
parent 2e1f945a
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -10691,6 +10691,25 @@ public class TelephonyManager {
        return ret;
    }

    /**
     * It indicates whether modem is enabled or not per slot.
     * It's the corresponding status of {@link #enableModemForSlot}.
     *
     * @param slotIndex which slot it's checking.
     * @hide
     */
    public boolean isModemEnabledForSlot(int slotIndex) {
        try {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
                return telephony.isModemEnabledForSlot(slotIndex, mContext.getOpPackageName());
            }
        } catch (RemoteException ex) {
            Log.e(TAG, "enableModem RemoteException", ex);
        }
        return false;
    }

    /**
     * Broadcast intent action for network country code changes.
     *
+3 −1
Original line number Diff line number Diff line
@@ -1958,4 +1958,6 @@ interface ITelephony {
     * Get the IRadio HAL Version encoded as 100 * MAJOR_VERSION + MINOR_VERSION or -1 if unknown
     */
    int getRadioHalVersion();

    boolean isModemEnabledForSlot(int slotIndex, String callingPackage);
}