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

Commit 19091a0f authored by Chen Xu's avatar Chen Xu Committed by Android (Google) Code Review
Browse files

Merge "sendDialerCode API review"

parents 615ee476 388eab41
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -39992,7 +39992,8 @@ package android.telephony {
    method public boolean isVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle);
    method public boolean isWorldPhone();
    method public void listen(android.telephony.PhoneStateListener, int);
    method public boolean sendDialerCode(java.lang.String);
    method public deprecated boolean sendDialerCode(java.lang.String);
    method public void sendDialerSpecialCode(java.lang.String);
    method public java.lang.String sendEnvelopeWithStatus(java.lang.String);
    method public void sendUssdRequest(java.lang.String, android.telephony.TelephonyManager.OnReceiveUssdResponseCallback, android.os.Handler);
    method public void setDataEnabled(boolean);
+2 −1
Original line number Diff line number Diff line
@@ -43399,7 +43399,8 @@ package android.telephony {
    method public boolean isWorldPhone();
    method public void listen(android.telephony.PhoneStateListener, int);
    method public boolean needsOtaServiceProvisioning();
    method public boolean sendDialerCode(java.lang.String);
    method public deprecated boolean sendDialerCode(java.lang.String);
    method public void sendDialerSpecialCode(java.lang.String);
    method public java.lang.String sendEnvelopeWithStatus(java.lang.String);
    method public void sendUssdRequest(java.lang.String, android.telephony.TelephonyManager.OnReceiveUssdResponseCallback, android.os.Handler);
    method public int setAllowedCarriers(int, java.util.List<android.service.carrier.CarrierIdentifier>);
+2 −1
Original line number Diff line number Diff line
@@ -40183,7 +40183,8 @@ package android.telephony {
    method public boolean isVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle);
    method public boolean isWorldPhone();
    method public void listen(android.telephony.PhoneStateListener, int);
    method public boolean sendDialerCode(java.lang.String);
    method public deprecated boolean sendDialerCode(java.lang.String);
    method public void sendDialerSpecialCode(java.lang.String);
    method public java.lang.String sendEnvelopeWithStatus(java.lang.String);
    method public void sendUssdRequest(java.lang.String, android.telephony.TelephonyManager.OnReceiveUssdResponseCallback, android.os.Handler);
    method public void setDataEnabled(boolean);
+26 −1
Original line number Diff line number Diff line
@@ -3080,7 +3080,7 @@ public class TelephonyManager {
     *
     * @param inputCode The special dialer code to send which follows the format of *#*#<code>#*#*
     * @return true if sent sucessfully, false otherwise
     *
     * @deprecated use {@link #sendDialerSpecialCode(String)} ()} instead.
     */
    public boolean sendDialerCode(String inputCode) {
        try {
@@ -3096,6 +3096,31 @@ public class TelephonyManager {
        }
    }

    /**
     * Send the special dialer code. The IPC caller must be the current default dialer or has
     * carrier privileges.
     * @see #hasCarrierPrivileges
     *
     * @param inputCode The special dialer code to send
     *
     * @throws SecurityException if the caller does not have carrier privileges or is not the
     *         current default dialer
     *
     * @throws IllegalStateException if telephony service is unavailable.
     */
    public void sendDialerSpecialCode(String inputCode) {
        try {
            final ITelephony telephony = getITelephony();
            telephony.sendDialerSpecialCode(mContext.getOpPackageName(), inputCode);
        } catch (RemoteException ex) {
            // This could happen if binder process crashes.
            ex.rethrowFromSystemServer();
        } catch (NullPointerException ex) {
            // This could happen before phone restarts due to crashing
            throw new IllegalStateException("Telephony service unavailable");
        }
    }

    /**
     * Returns the IMS private user identity (IMPI) that was loaded from the ISIM.
     * @return the IMPI, or null if not present or not loaded
+3 −0
Original line number Diff line number Diff line
@@ -532,6 +532,9 @@ interface ITelephony {
    // Send the special dialer code. The IPC caller must be the current default dialer.
    boolean sendDialerCode(String callingPackageName, String inputCode);

    // Send the special dialer code. The IPC caller must be the current default dialer.
    void sendDialerSpecialCode(String callingPackageName, String inputCode);

    /**
     * Returns the network type for data transmission
     * Legacy call, permission-free