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

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

Merge "remove deprecated API sendDialerCode" into oc-dev

am: f0dfcc5f

Change-Id: I3e9e71acaa09d0e0d06ec5f0e389899f7e92dd69
parents 129df5e9 f0dfcc5f
Loading
Loading
Loading
Loading
+0 −24
Original line number Diff line number Diff line
@@ -2277,30 +2277,6 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        return countVoiceMessages;
    }

    /**
     * send secret dialer codes to launch arbitrary activities in the form of *#*#<code>#*#*.
     * If a secret code is encountered, an Intent is started with the android_secret_code://<code>
     * URI.
     *
     * @param code the text to check for a secret code in
     * @return true if a secret code was encountered
     */
    public boolean sendDialerCode(String code) {
        // Secret dialer codes are in the form *#*#<code>#*#*
        if (TextUtils.isEmpty(code)) {
            return false;
        }
        int len = code.length();
        if (len > 8 && code.startsWith("*#*#") && code.endsWith("#*#*")) {
            Intent intent = new Intent(TelephonyIntents.SECRET_CODE_ACTION,
                    Uri.parse("android_secret_code://" + code.substring(4, len - 4)));
            intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
            mContext.sendBroadcast(intent);
            return true;
        }
        return false;
    }

    /**
     * send secret dialer codes to launch arbitrary activities.
     * an Intent is started with the android_secret_code://<code> URI.