Fix "Clear call log" menu item.
The code is now loading the options menu from the resources, so it
should use the id that is automatically generated for it instead of the
fixed id we were using before.
Bug: 5035160
Change-Id: Ic1b15318581522b8d7e7e48208e80c3d8068298b
diff --git a/src/com/android/contacts/calllog/CallLogFragment.java b/src/com/android/contacts/calllog/CallLogFragment.java
index 49a6043..4bc9f10 100644
--- a/src/com/android/contacts/calllog/CallLogFragment.java
+++ b/src/com/android/contacts/calllog/CallLogFragment.java
@@ -139,10 +139,6 @@
public static final int LOOKUP_KEY = 7;
}
- private static final class OptionsMenuItems {
- public static final int DELETE_ALL = 1;
- }
-
private CallLogAdapter mAdapter;
private CallLogQueryHandler mCallLogQueryHandler;
private String mVoiceMailNumber;
@@ -1040,7 +1036,7 @@
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
- case OptionsMenuItems.DELETE_ALL: {
+ case R.id.delete_all: {
ClearCallLogDialog.show(getFragmentManager());
return true;
}
diff --git a/src/com/android/contacts/calllog/ClearCallLogDialog.java b/src/com/android/contacts/calllog/ClearCallLogDialog.java
index 426732a..0f999bd 100644
--- a/src/com/android/contacts/calllog/ClearCallLogDialog.java
+++ b/src/com/android/contacts/calllog/ClearCallLogDialog.java
@@ -52,7 +52,7 @@
final AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
- resolver.delete(Calls.CONTENT_URI, null, null);
+ resolver.delete(Calls.CONTENT_URI_WITH_VOICEMAIL, null, null);
return null;
}
@Override