Remove extra options from dialpad menu.

These are now exposed as shortcuts in the search fragment.

Bug: 19372539
Change-Id: I526570cf8326dbfac1770c0f3c06b72ee1166cc8
diff --git a/res/menu/dialpad_options.xml b/res/menu/dialpad_options.xml
index 49ee37d..f0399a8 100644
--- a/res/menu/dialpad_options.xml
+++ b/res/menu/dialpad_options.xml
@@ -14,10 +14,7 @@
      limitations under the License.
 -->
 <menu xmlns:android="http://schemas.android.com/apk/res/android">
-    <item
-        android:id="@+id/menu_add_contact"
-        android:title="@string/add_contact"
-        android:showAsAction="withText" />
+
     <item
         android:id="@+id/menu_2s_pause"
         android:title="@string/add_2sec_pause"
@@ -26,8 +23,5 @@
         android:id="@+id/menu_add_wait"
         android:title="@string/add_wait"
         android:showAsAction="withText" />
-    <item
-        android:id="@+id/menu_send_message"
-        android:title="@string/menu_sendTextMessage"
-        android:showAsAction="withText" />
+
 </menu>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index fb424e9..28dab88 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -42,9 +42,6 @@
     [CHAR LIMIT=NONE] -->
     <string name="recentCallsIconLabel">Call history</string>
 
-    <!-- Menu item used to send an SMS or MMS message to a phone number  -->
-    <string name="menu_sendTextMessage">Send SMS</string>
-
     <!-- Menu item used to call a contact from the call log -->
     <string name="recentCalls_callNumber">Call
         <xliff:g id="name">%s</xliff:g>
@@ -262,7 +259,6 @@
     <string name="menu_show_all_calls">Show all calls</string>
 
     <!-- Menu items for dialpad options as part of Pause and Wait ftr [CHAR LIMIT=30] -->
-    <string name="add_contact">Add to contacts</string>
     <string name="add_2sec_pause">Add 2-sec pause</string>
     <string name="add_wait">Add wait</string>
 
diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java
index fbf862f..a910f7a 100644
--- a/src/com/android/dialer/dialpad/DialpadFragment.java
+++ b/src/com/android/dialer/dialpad/DialpadFragment.java
@@ -258,8 +258,6 @@
     private boolean mFirstLaunch = false;
     private boolean mAnimate = false;
 
-    private ComponentName mSmsPackageComponentName;
-
     private static final String PREF_DIGITS_FILLED_BY_INTENT = "pref_digits_filled_by_intent";
 
     private TelephonyManager getTelephonyManager() {
@@ -660,8 +658,6 @@
 
         stopWatch.stopAndLog(TAG, 50);
 
-        mSmsPackageComponentName = DialerUtils.getSmsComponent(activity);
-
         // Populate the overflow menu in onResume instead of onCreate, so that if the SMS activity
         // is disabled while Dialer is paused, the "Send a text message" option can be correctly
         // removed when resumed.
@@ -878,8 +874,6 @@
             @Override
             public void show() {
                 final Menu menu = getMenu();
-                final MenuItem sendMessage = menu.findItem(R.id.menu_send_message);
-                sendMessage.setVisible(mSmsPackageComponentName != null);
 
                 boolean enable = !isDigitsEmpty();
                 for (int i = 0; i < menu.size(); i++) {
@@ -1449,26 +1443,12 @@
     @Override
     public boolean onMenuItemClick(MenuItem item) {
         switch (item.getItemId()) {
-            case R.id.menu_add_contact: {
-                final CharSequence digits = mDigits.getText();
-                DialerUtils.startActivityWithErrorToast(getActivity(),
-                        DialtactsActivity.getAddNumberToContactIntent(digits));
-                return true;
-            }
             case R.id.menu_2s_pause:
                 updateDialString(PAUSE);
                 return true;
             case R.id.menu_add_wait:
                 updateDialString(WAIT);
                 return true;
-            case R.id.menu_send_message: {
-                final CharSequence digits = mDigits.getText();
-                final Intent smsIntent = new Intent(Intent.ACTION_SENDTO,
-                        Uri.fromParts(ContactsUtils.SCHEME_SMSTO, digits.toString(), null));
-                smsIntent.setComponent(mSmsPackageComponentName);
-                DialerUtils.startActivityWithErrorToast(getActivity(), smsIntent);
-                return true;
-            }
             default:
                 return false;
         }