diff options
author | Tyler Gunn <tgunn@google.com> | 2015-08-07 02:02:46 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-08-07 02:02:46 +0000 |
commit | 73cb73f47906bf486ba9781734acdc14bccdecfa (patch) | |
tree | 56a59fb3622437edd55b137cce508ce9644f0305 | |
parent | 5b27c3aae5b109a3d5823053c16a8eaa43f7ea94 (diff) | |
parent | 0604f16a932ebe5889d5f3e6380f22aefcc9bff2 (diff) |
am 0604f16a: am c72f419b: Add "Call with Note" from dialpad.
* commit '0604f16a932ebe5889d5f3e6380f22aefcc9bff2':
Add "Call with Note" from dialpad.
-rw-r--r-- | AndroidManifest.xml | 7 | ||||
-rw-r--r-- | res/menu/dialpad_options.xml | 5 | ||||
-rw-r--r-- | src/com/android/dialer/dialpad/DialpadFragment.java | 13 |
3 files changed, 22 insertions, 3 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 9569c1d00..ae1e3d627 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -172,6 +172,13 @@ </intent-filter> </activity> + <activity android:name="com.android.contacts.common.dialog.CallSubjectHistory" + android:theme="@style/Theme.CallSubjectSelector"> + <intent-filter> + <action android:name="android.intent.action.VIEW"/> + </intent-filter> + </activity> + <!-- Backwards compatibility: "Phone" from Gingerbread and earlier --> <activity-alias android:name="DialtactsActivity" android:targetActivity=".DialtactsActivity" diff --git a/res/menu/dialpad_options.xml b/res/menu/dialpad_options.xml index f0399a82b..63fca07da 100644 --- a/res/menu/dialpad_options.xml +++ b/res/menu/dialpad_options.xml @@ -23,5 +23,8 @@ android:id="@+id/menu_add_wait" android:title="@string/add_wait" android:showAsAction="withText" /> - + <item + android:id="@+id/menu_call_with_note" + android:title="@string/call_with_a_note" + android:showAsAction="withText" /> </menu> 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; } |