Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fbc75e2a authored by Chen Xu's avatar Chen Xu Committed by android-build-merger
Browse files

Merge "skip permission check for TelephonyManager API getMmsUserAgent" into qt-dev

am: 924c6eb5

Change-Id: Ia7a563f8e46a869c39d4aeb6baba7f79d7a6e190
parents 87d0dcee 924c6eb5
Loading
Loading
Loading
Loading
+18 −6
Original line number Diff line number Diff line
@@ -5356,18 +5356,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;
    }

    /**
+10 −0
Original line number Diff line number Diff line
@@ -1986,4 +1986,14 @@ interface ITelephony {
     * outgoing SmsManager operation.
     */
    oneway void enqueueSmsPickResult(String callingPackage, IIntegerConsumer subIdResult);

    /**
     * Returns the MMS user agent.
     */
    String getMmsUserAgent(int subId);

    /**
     * Returns the MMS user agent profile URL.
     */
    String getMmsUAProfUrl(int subId);
}