protected android.provider.Telephony.SECRET_CODE

1. This intent is only sent from telephony framework, thus mark it as
protected broadcast.
2. remove deprecated API sendDialerCode

Bug: 35767402
Test: run cts -m CtsPermissionTestCases -t
android.permission.cts.TelephonyManagerPermissionTest

Change-Id: Ibd82b35d78c796ed6d2c3e33f931f3fe9f0f1f8a
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index bc1c448..3b9de91 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -54,6 +54,7 @@
     <protected-broadcast android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" />
     <protected-broadcast android:name="android.provider.Telephony.SMS_CB_RECEIVED" />
     <protected-broadcast android:name="android.provider.Telephony.SMS_EMERGENCY_CB_RECEIVED" />
+    <protected-broadcast android:name="android.provider.Telephony.SECRET_CODE" />
     <protected-broadcast android:name= "android.intent.action.stk.command" />
     <protected-broadcast android:name= "android.intent.action.stk.session_end" />
     <protected-broadcast android:name= "android.intent.action.stk.icc_status_change" />
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 27e365f..10de1a8 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -2188,30 +2188,6 @@
     }
 
     /**
-     * Send the dialer code if called from the current default dialer and the input code follows the
-     * format of *#*#<code>#*#*
-     * <p>
-     * Requires Permission:
-     *   {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
-     *
-     * @param inputCode The dialer code to send
-     * @return true if successfully sent, false otherwise
-     */
-    @Override
-    public boolean sendDialerCode(String callingPackage, String inputCode) {
-        enforceModifyPermission();
-        mAppOps.checkPackage(Binder.getCallingUid(), callingPackage);
-        if (TextUtils.equals(callingPackage,
-                TelecomManager.from(mPhone.getContext()).getDefaultDialerPackage())) {
-            final Phone phone = getPhone(getDefaultSubscription());
-            if (phone != null) {
-                return phone.sendDialerCode(inputCode);
-            }
-        }
-        return false;
-    }
-
-    /**
      * Send the dialer code if called from the current default dialer or the caller has
      * carrier privilege.
      * @param inputCode The dialer code to send