Merge "Changing setPreferredData so that it takes subId."

This commit is contained in:
Xiangyu/Malcolm Chen
2018-11-07 20:19:21 +00:00
committed by Gerrit Code Review
2 changed files with 14 additions and 14 deletions

View File

@@ -2207,24 +2207,25 @@ public class SubscriptionManager {
}
/**
* Set preferred default data.
* Set on which slot most cellular data will be on.
* It's also usually what we set up internet connection on.
* Set which subscription is preferred for cellular data.
* It's also usually the subscription we set up internet connection on.
*
* PreferredData overwrites user setting of default data subscription. And it's used
* by AlternativeNetworkAccessService or carrier apps to switch primary and CBRS
* by AlternativeNetworkService or carrier apps to switch primary and CBRS
* subscription dynamically in multi-SIM devices.
*
* @param slotId which slot is preferred to for cellular data. If it's INVALID, it means
* it's unset and defaultDataSubId is used to determine which modem is preferred.
* @param subId which subscription is preferred to for cellular data. If it's
* {@link SubscriptionManager#INVALID_SUBSCRIPTION_ID}, it means
* it's unset and {@link SubscriptionManager#getDefaultDataSubscriptionId()}
* is used to determine which modem is preferred.
* @hide
*
*/
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
public void setPreferredData(int slotId) {
if (VDBG) logd("[setPreferredData]+ slotId:" + slotId);
public void setPreferredData(int subId) {
if (VDBG) logd("[setPreferredData]+ subId:" + subId);
setSubscriptionPropertyHelper(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID,
"setPreferredData", (iSub)-> iSub.setPreferredData(slotId));
"setPreferredData", (iSub)-> iSub.setPreferredData(subId));
}
/**

View File

@@ -16,7 +16,6 @@
package com.android.internal.telephony;
import android.app.PendingIntent;
import android.telephony.SubscriptionInfo;
interface ISub {
@@ -175,14 +174,14 @@ interface ISub {
int setParentSubId(int parentSubId, int subId);
/**
* Set preferred default data.
* Set on which slot default data will be on.
* Set which subscription is preferred for cellular data. It's
* designed to overwrite default data subscription temporarily.
*
* @param slotId which slot is preferred to for cellular data.
* @param subId which subscription is preferred to for cellular data.
* @hide
*
*/
int setPreferredData(int slotId);
int setPreferredData(int subId);
/**
* Get User downloaded Profiles.