Merge changes from topics "126864501", "129296702"

* changes:
  Changing default phone capability.
  Remove hidden IntDef in java doc.
  Add @hide API to return whether a modem stack is enabled or not.
This commit is contained in:
Xiangyu/Malcolm Chen
2019-04-08 22:29:36 +00:00
committed by Gerrit Code Review
4 changed files with 44 additions and 4 deletions

View File

@@ -30,6 +30,25 @@ import java.util.Objects;
* @hide
*/
public class PhoneCapability implements Parcelable {
// Hardcoded default DSDS capability.
public static final PhoneCapability DEFAULT_DSDS_CAPABILITY;
// Hardcoded default Single SIM single standby capability.
public static final PhoneCapability DEFAULT_SSSS_CAPABILITY;
static {
ModemInfo modemInfo1 = new ModemInfo(0, 0, true, true);
ModemInfo modemInfo2 = new ModemInfo(1, 0, true, true);
List<ModemInfo> logicalModemList = new ArrayList<>();
logicalModemList.add(modemInfo1);
logicalModemList.add(modemInfo2);
DEFAULT_DSDS_CAPABILITY = new PhoneCapability(1, 1, 0, logicalModemList, false);
logicalModemList = new ArrayList<>();
logicalModemList.add(modemInfo1);
DEFAULT_SSSS_CAPABILITY = new PhoneCapability(1, 1, 0, logicalModemList, false);
}
public final int maxActiveVoiceCalls;
public final int maxActiveData;
public final int max5G;

View File

@@ -2588,8 +2588,7 @@ public class SubscriptionManager {
* {@link NetworkCapabilities#NET_CAPABILITY_VALIDATED}.
* @param executor The executor of where the callback will execute.
* @param callback Callback will be triggered once it succeeds or failed.
* See {@link TelephonyManager.SetOpportunisticSubscriptionResult}
* for more details. Pass null if don't care about the result.
* Pass null if don't care about the result.
*
* @hide
*
@@ -2597,7 +2596,8 @@ public class SubscriptionManager {
@SystemApi
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
public void setPreferredDataSubscriptionId(int subId, boolean needValidation,
@Nullable @CallbackExecutor Executor executor, @Nullable Consumer<Integer> callback) {
@Nullable @CallbackExecutor Executor executor, @Nullable
@TelephonyManager.SetOpportunisticSubscriptionResult Consumer<Integer> callback) {
if (VDBG) logd("[setPreferredDataSubscriptionId]+ subId:" + subId);
try {
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));

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);
}