Merge "Fixed tethering failed when device is on CBRS" am: fa9c857b21
am: df9fb2aae8
Change-Id: Ia75de613314fcf7ff764090c833c9f4b440db6f1
This commit is contained in:
@@ -3175,4 +3175,24 @@ public class SubscriptionManager {
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get active data subscription id.
|
||||||
|
* See {@link PhoneStateListener#onActiveDataSubscriptionIdChanged(int)} for the details.
|
||||||
|
*
|
||||||
|
* @return Active data subscription id
|
||||||
|
*
|
||||||
|
* //TODO: Refactor this API in b/134702460
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static int getActiveDataSubscriptionId() {
|
||||||
|
try {
|
||||||
|
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
|
||||||
|
if (iSub != null) {
|
||||||
|
return iSub.getActiveDataSubscriptionId();
|
||||||
|
}
|
||||||
|
} catch (RemoteException ex) {
|
||||||
|
}
|
||||||
|
return SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2563,7 +2563,7 @@ public class TelephonyManager {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
|
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
|
||||||
public @NetworkType int getNetworkType() {
|
public @NetworkType int getNetworkType() {
|
||||||
return getNetworkType(getSubId(SubscriptionManager.getDefaultDataSubscriptionId()));
|
return getNetworkType(getSubId(SubscriptionManager.getActiveDataSubscriptionId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2646,7 +2646,7 @@ public class TelephonyManager {
|
|||||||
@SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges
|
@SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges
|
||||||
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
|
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
|
||||||
public @NetworkType int getDataNetworkType() {
|
public @NetworkType int getDataNetworkType() {
|
||||||
return getDataNetworkType(getSubId(SubscriptionManager.getDefaultDataSubscriptionId()));
|
return getDataNetworkType(getSubId(SubscriptionManager.getActiveDataSubscriptionId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -7432,7 +7432,7 @@ public class TelephonyManager {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public boolean getTetherApnRequired() {
|
public boolean getTetherApnRequired() {
|
||||||
return getTetherApnRequired(getSubId(SubscriptionManager.getDefaultDataSubscriptionId()));
|
return getTetherApnRequired(getSubId(SubscriptionManager.getActiveDataSubscriptionId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -8215,7 +8215,7 @@ public class TelephonyManager {
|
|||||||
ITelephony telephony = getITelephony();
|
ITelephony telephony = getITelephony();
|
||||||
if (telephony != null)
|
if (telephony != null)
|
||||||
return telephony.isDataConnectivityPossible(getSubId(SubscriptionManager
|
return telephony.isDataConnectivityPossible(getSubId(SubscriptionManager
|
||||||
.getDefaultDataSubscriptionId()));
|
.getActiveDataSubscriptionId()));
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Log.e(TAG, "Error calling ITelephony#isDataAllowed", e);
|
Log.e(TAG, "Error calling ITelephony#isDataAllowed", e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -281,4 +281,6 @@ interface ISub {
|
|||||||
boolean isActiveSubId(int subId, String callingPackage);
|
boolean isActiveSubId(int subId, String callingPackage);
|
||||||
|
|
||||||
boolean setAlwaysAllowMmsData(int subId, boolean alwaysAllow);
|
boolean setAlwaysAllowMmsData(int subId, boolean alwaysAllow);
|
||||||
|
|
||||||
|
int getActiveDataSubscriptionId();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user