diff options
-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; } |