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

Commit 459e51e5 authored by chen xu's avatar chen xu Committed by Chen Xu
Browse files

skip permission check for TelephonyManager API getMmsUserAgent

Bug: 133637995
Test: Manual test
Change-Id: Ib9f211120c34e9b48c02f990088c32fb307a64f2
(cherry picked from commit 48781653)
Merged-in: Ib9f211120c34e9b48c02f990088c32fb307a64f2
parent cdbb700f
Loading
Loading
Loading
Loading
+18 −6
Original line number Diff line number Diff line
@@ -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;
    }

    /**
+10 −0
Original line number Diff line number Diff line
@@ -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);
}