Merge "skip permission check for TelephonyManager API getMmsUserAgent"

am: 4a864b8d96

Change-Id: I41dc53cb76bbb8a8bc239bb6e2c2779a9cd100bd
This commit is contained in:
Chen Xu
2019-06-04 17:59:22 -07:00
committed by android-build-merger
2 changed files with 28 additions and 6 deletions

View File

@@ -5223,18 +5223,30 @@ public class TelephonyManager {
* Returns the MMS user agent.
*/
public String getMmsUserAgent() {
if (mContext == null) return null;
return SubscriptionManager.getResourcesForSubId(mContext, getSubId()).getString(
com.android.internal.R.string.config_mms_user_agent);
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
return telephony.getMmsUserAgent(getSubId());
}
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
return null;
}
/**
* Returns the MMS user agent profile URL.
*/
public String getMmsUAProfUrl() {
if (mContext == null) return null;
return SubscriptionManager.getResourcesForSubId(mContext, getSubId()).getString(
com.android.internal.R.string.config_mms_user_agent_profile_url);
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
return telephony.getMmsUAProfUrl(getSubId());
}
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
return null;
}
/**

View File

@@ -1973,4 +1973,14 @@ interface ITelephony {
boolean isDataEnabledForApn(int apnType, int subId, String callingPackage);
boolean isApnMetered(int apnType, int subId);
/**
* Returns the MMS user agent.
*/
String getMmsUserAgent(int subId);
/**
* Returns the MMS user agent profile URL.
*/
String getMmsUAProfUrl(int subId);
}