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

Commit 96dd9e4d 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
Merged-In: I7ef4ad8322cf85e5a159363e90dde303ac7240de
parent 820a7b51
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -10695,6 +10695,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;
    }

    /**
     * Indicate if the user is allowed to use multiple SIM cards at the same time to register
     * on the network (e.g. Dual Standby or Dual Active) when the device supports it, or if the
+3 −1
Original line number Diff line number Diff line
@@ -1956,4 +1956,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);
}