diff options
author | Tyler Gunn <tgunn@google.com> | 2015-08-07 02:21:39 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-08-07 02:21:39 +0000 |
commit | 752880a3f2fc1edd3fa44c1bf21077949438d7c6 (patch) | |
tree | e7537dfe09ef7a85df5cbbfb4874a7e7237d913e | |
parent | 58de00fda096bec22a3896316e1da73a6c2d8a45 (diff) | |
parent | 60b35252aaf0c6caeb1bf32481f735c5e31d4853 (diff) |
am 60b35252: am 73cb73f4: am 0604f16a: am c72f419b: Add "Call with Note" from dialpad.
* commit '60b35252aaf0c6caeb1bf32481f735c5e31d4853':
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; } |