Merge changes from topic "telephonymanager-data-policy" am: 3a14c6bdcc am: 4e254916f0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1469718 Change-Id: Ida4ad72ab7b1e3d7cc34342b5bf78b91b7b5d1c3
This commit is contained in:
@@ -12607,7 +12607,7 @@ public class TelephonyManager {
|
|||||||
* 1) User data is turned on, or
|
* 1) User data is turned on, or
|
||||||
* 2) APN is un-metered for this subscription, or
|
* 2) APN is un-metered for this subscription, or
|
||||||
* 3) APN type is whitelisted. E.g. MMS is whitelisted if
|
* 3) APN type is whitelisted. E.g. MMS is whitelisted if
|
||||||
* {@link #setAlwaysAllowMmsData(boolean)} is turned on.
|
* {@link #MOBILE_DATA_POLICY_MMS_ALWAYS_ALLOWED} is enabled.
|
||||||
*
|
*
|
||||||
* @param apnType Value indicating the apn type. Apn types are defined in {@link ApnSetting}.
|
* @param apnType Value indicating the apn type. Apn types are defined in {@link ApnSetting}.
|
||||||
* @return whether data is enabled for a apn type.
|
* @return whether data is enabled for a apn type.
|
||||||
@@ -13032,86 +13032,6 @@ public class TelephonyManager {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param allow {@code true} if allowing using data during voice call, {@code false} if
|
|
||||||
* disallowed.
|
|
||||||
*
|
|
||||||
* @return {@code true} if operation is successful. otherwise {@code false}.
|
|
||||||
*
|
|
||||||
* @throws SecurityException if the caller doesn't have the permission.
|
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
|
|
||||||
public boolean setDataAllowedDuringVoiceCall(boolean allow) {
|
|
||||||
try {
|
|
||||||
ITelephony service = getITelephony();
|
|
||||||
if (service != null) {
|
|
||||||
return service.setDataAllowedDuringVoiceCall(getSubId(), allow);
|
|
||||||
}
|
|
||||||
} catch (RemoteException ex) {
|
|
||||||
// This could happen if binder process crashes.
|
|
||||||
if (!isSystemProcess()) {
|
|
||||||
ex.rethrowAsRuntimeException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check whether data is allowed during voice call. This is used for allowing data on the
|
|
||||||
* non-default data SIM. When a voice call is placed on the non-default data SIM on DSDS
|
|
||||||
* devices, users will not be able to use mobile data. By calling this API, data will be
|
|
||||||
* temporarily enabled on the non-default data SIM during the life cycle of the voice call.
|
|
||||||
*
|
|
||||||
* @return {@code true} if data is allowed during voice call.
|
|
||||||
*
|
|
||||||
* @throws SecurityException if the caller doesn't have the permission.
|
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
|
|
||||||
public boolean isDataAllowedInVoiceCall() {
|
|
||||||
try {
|
|
||||||
ITelephony service = getITelephony();
|
|
||||||
if (service != null) {
|
|
||||||
return service.isDataAllowedInVoiceCall(getSubId());
|
|
||||||
}
|
|
||||||
} catch (RemoteException ex) {
|
|
||||||
// This could happen if binder process crashes.
|
|
||||||
if (!isSystemProcess()) {
|
|
||||||
ex.rethrowAsRuntimeException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set whether the specific sim card always allows MMS connection. If true, MMS network
|
|
||||||
* request will be accepted by telephony even if user turns "mobile data" off
|
|
||||||
* on this specific sim card.
|
|
||||||
*
|
|
||||||
* @param alwaysAllow whether Mms data is always allowed.
|
|
||||||
* @return whether operation is successful.
|
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
|
|
||||||
public boolean setAlwaysAllowMmsData(boolean alwaysAllow) {
|
|
||||||
try {
|
|
||||||
ITelephony service = getITelephony();
|
|
||||||
if (service != null) {
|
|
||||||
return service.setAlwaysAllowMmsData(getSubId(), alwaysAllow);
|
|
||||||
}
|
|
||||||
} catch (RemoteException ex) {
|
|
||||||
if (!isSystemProcess()) {
|
|
||||||
ex.rethrowAsRuntimeException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The IccLock state or password was changed successfully.
|
* The IccLock state or password was changed successfully.
|
||||||
* @hide
|
* @hide
|
||||||
|
|||||||
@@ -2237,22 +2237,6 @@ interface ITelephony {
|
|||||||
|
|
||||||
boolean isMobileDataPolicyEnabled(int subscriptionId, int policy);
|
boolean isMobileDataPolicyEnabled(int subscriptionId, int policy);
|
||||||
|
|
||||||
/**
|
|
||||||
* Set allowing mobile data during voice call.
|
|
||||||
*/
|
|
||||||
boolean setDataAllowedDuringVoiceCall(int subId, boolean allow);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check whether data is allowed during voice call. Note this is for dual sim device that
|
|
||||||
* data might be disabled on non-default data subscription but explicitly turned on by settings.
|
|
||||||
*/
|
|
||||||
boolean isDataAllowedInVoiceCall(int subId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set whether a subscription always allows MMS connection.
|
|
||||||
*/
|
|
||||||
boolean setAlwaysAllowMmsData(int subId, boolean allow);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Command line command to enable or disable handling of CEP data for test purposes.
|
* Command line command to enable or disable handling of CEP data for test purposes.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user