summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2015-08-07 01:55:14 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-07 01:55:14 +0000
commit0604f16a932ebe5889d5f3e6380f22aefcc9bff2 (patch)
tree40c7bae2413ce21728e9b0806b2a624932a9b675
parent98cf19a53d5f0c722def08a075854f7a52a97d83 (diff)
parentc72f419b18258cfc6f29590e3b97dac8b175f904 (diff)
am c72f419b: Add "Call with Note" from dialpad.
* commit 'c72f419b18258cfc6f29590e3b97dac8b175f904': Add "Call with Note" from dialpad.
-rw-r--r--AndroidManifest.xml7
-rw-r--r--res/menu/dialpad_options.xml5
-rw-r--r--src/com/android/dialer/dialpad/DialpadFragment.java13
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;
}