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

Bug: 129296702
Test: TelephonyManagerTestApp
Change-Id: I7ef4ad8322cf85e5a159363e90dde303ac7240de
Merged-In: I7ef4ad8322cf85e5a159363e90dde303ac7240de
This commit is contained in:
Malcolm Chen
2019-03-27 19:21:11 -07:00
parent 820a7b5144
commit 96dd9e4dfe
2 changed files with 22 additions and 1 deletions

View File

@@ -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

View File

@@ -1955,5 +1955,7 @@ interface ITelephony {
/**
* Get the IRadio HAL Version encoded as 100 * MAJOR_VERSION + MINOR_VERSION or -1 if unknown
*/
int getRadioHalVersion();
int getRadioHalVersion();
boolean isModemEnabledForSlot(int slotIndex, String callingPackage);
}