From c72f419b18258cfc6f29590e3b97dac8b175f904 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Wed, 5 Aug 2015 14:34:28 -0700 Subject: Add "Call with Note" from dialpad. Bug: 22685114 Change-Id: Id7d16634a0baad03b28b509b62315f43fa022ee4 --- src/com/android/dialer/dialpad/DialpadFragment.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/com/android/dialer/dialpad') diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index d35abd75b..6de9a483a 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -67,7 +67,9 @@ import android.widget.PopupMenu; import android.widget.RelativeLayout; import android.widget.TextView; +import com.android.contacts.common.CallUtil; import com.android.contacts.common.GeoUtil; +import com.android.contacts.common.dialog.CallSubjectDialog; import com.android.contacts.common.util.PermissionsUtil; import com.android.contacts.common.util.PhoneNumberFormatter; import com.android.contacts.common.util.StopWatch; @@ -896,9 +898,12 @@ public class DialpadFragment extends Fragment boolean enable = !isDigitsEmpty(); for (int i = 0; i < menu.size(); i++) { - menu.getItem(i).setEnabled(enable); + MenuItem item = menu.getItem(i); + item.setEnabled(enable); + if (item.getItemId() == R.id.menu_call_with_note) { + item.setVisible(CallUtil.isCallWithSubjectSupported(getContext())); + } } - super.show(); } }; @@ -1470,6 +1475,10 @@ public class DialpadFragment extends Fragment case R.id.menu_add_wait: updateDialString(WAIT); return true; + case R.id.menu_call_with_note: + CallSubjectDialog.start(getActivity(), mDigits.getText().toString()); + hideAndClearDialpad(false); + return true; default: return false; } -- cgit v1.2.3