summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWysie <sohyuanchin@gmail.com>2009-12-29 01:38:30 +0800
committerWysie <sohyuanchin@gmail.com>2009-12-29 01:38:30 +0800
commit115b7f71673d6189161a6e4176b07ebf27a83224 (patch)
tree0167f299221572fc57aca2f10c02123798fcc88f
parentbb98c49ccc6d5acf2653cc7faf4e7aceae90752c (diff)
downloadpackages_apps_Contacts-115b7f71673d6189161a6e4176b07ebf27a83224.tar.gz
packages_apps_Contacts-115b7f71673d6189161a6e4176b07ebf27a83224.tar.bz2
packages_apps_Contacts-115b7f71673d6189161a6e4176b07ebf27a83224.zip
Release 2.21. Added more clearing options for clear log. Can now clear all incoming, outgoing, or missed calls only.
-rwxr-xr-xres/values/strings.xml6
-rw-r--r--src/com/android/contacts/RecentCallsListActivity.java65
2 files changed, 62 insertions, 9 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f96fd1b05..02d1ddb13 100755
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -378,6 +378,10 @@
<!-- Menu item used to remove all calls from the call log -->
<string name="recentCalls_deleteAll">Clear call log</string>
+
+ <string name="recentCalls_deleteAllIncoming">Clear incoming</string>
+ <string name="recentCalls_deleteAllOutgoing">Clear outgoing</string>
+ <string name="recentCalls_deleteAllMissed">Clear missed</string>
<!-- Text displayed when the call log is empty -->
<string name="recentCalls_empty">Call log is empty.</string>
@@ -821,7 +825,7 @@
<string name="title_about_name">Mod Name</string>
<string name="summary_about_name">Wysie Contacts</string>
<string name="title_about_version">Version</string>
- <string name="summary_about_version">2.2</string>
+ <string name="summary_about_version">2.21</string>
<string name="title_about_credits">Credits</string>
<string name="summary_about_credits">ChainsDD and the rest of XDA! :)</string>
diff --git a/src/com/android/contacts/RecentCallsListActivity.java b/src/com/android/contacts/RecentCallsListActivity.java
index de79fd5d0..e726da7be 100644
--- a/src/com/android/contacts/RecentCallsListActivity.java
+++ b/src/com/android/contacts/RecentCallsListActivity.java
@@ -133,6 +133,9 @@ public class RecentCallsListActivity extends ListActivity
private static final int MENU_ITEM_TOTAL_CALL_LOG = 4;
private static final int MENU_ITEM_DELETE_ALL_NAME = 5; //Delete all instances of a particular user
private static final int MENU_ITEM_DELETE_ALL_NUMBER = 6; //Delete all instances of a particular number
+ private static final int MENU_ITEM_DELETE_ALL_INCOMING = 7;
+ private static final int MENU_ITEM_DELETE_ALL_OUTGOING = 8;
+ private static final int MENU_ITEM_DELETE_ALL_MISSED = 9;
private static final int QUERY_TOKEN = 53;
private static final int UPDATE_TOKEN = 54;
@@ -836,8 +839,10 @@ public class RecentCallsListActivity extends ListActivity
@Override
public boolean onCreateOptionsMenu(Menu menu) {
- menu.add(0, MENU_ITEM_DELETE_ALL, 0, R.string.recentCalls_deleteAll)
- .setIcon(android.R.drawable.ic_menu_close_clear_cancel);
+ menu.add(0, MENU_ITEM_DELETE_ALL, 0, R.string.recentCalls_deleteAll).setIcon(android.R.drawable.ic_menu_close_clear_cancel);
+ menu.add(0, MENU_ITEM_DELETE_ALL_INCOMING, 0, R.string.recentCalls_deleteAllIncoming).setIcon(android.R.drawable.ic_menu_close_clear_cancel);
+ menu.add(0, MENU_ITEM_DELETE_ALL_OUTGOING, 0, R.string.recentCalls_deleteAllOutgoing).setIcon(android.R.drawable.ic_menu_close_clear_cancel);
+ menu.add(0, MENU_ITEM_DELETE_ALL_MISSED, 0, R.string.recentCalls_deleteAllMissed).setIcon(android.R.drawable.ic_menu_close_clear_cancel);
menu.add(0, MENU_ITEM_TOTAL_CALL_LOG, 0, R.string.call_log_menu_total_duration).setIcon(R.drawable.ic_tab_recent);
Intent i = new Intent(this, ContactsPreferences.class);
@@ -925,6 +930,18 @@ public class RecentCallsListActivity extends ListActivity
clearCallLog();
return true;
}
+ case MENU_ITEM_DELETE_ALL_INCOMING: {
+ clearCallLogType(Calls.INCOMING_TYPE);
+ return true;
+ }
+ case MENU_ITEM_DELETE_ALL_OUTGOING: {
+ clearCallLogType(Calls.OUTGOING_TYPE);
+ return true;
+ }
+ case MENU_ITEM_DELETE_ALL_MISSED: {
+ clearCallLogType(Calls.MISSED_TYPE);
+ return true;
+ }
case MENU_ITEM_TOTAL_CALL_LOG: {
//Intent totalCallLog = new Intent(this, TotalCallLog.class);
//setIntent(totalCallLog);
@@ -1128,9 +1145,7 @@ public class RecentCallsListActivity extends ListActivity
startActivity(intent);
}
- private void clearCallLogInstances(String type, String value, String label) { // Clear all instances of a user OR number
- final String t = type;
- final String v = value;
+ private void clearCallLogInstances(final String type, final String value, String label) { // Clear all instances of a user OR number
if (prefs.getBoolean("cl_ask_before_clear", false)) {
AlertDialog.Builder alert = new AlertDialog.Builder(this);
@@ -1138,7 +1153,7 @@ public class RecentCallsListActivity extends ListActivity
alert.setMessage("Are you sure you want to clear all call records of " + label + "?"); //Text, eg. show "Private" instead of -1 :P
alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
- deleteCallLog(t + "='" + v + "'", null);
+ deleteCallLog(type + "='" + value + "'", null);
}
});
alert.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
@@ -1149,14 +1164,48 @@ public class RecentCallsListActivity extends ListActivity
alert.show();
}
else {
- deleteCallLog(t + "='" + v + "'", null);
+ deleteCallLog(type + "='" + value + "'", null);
}
}
+ private void clearCallLogType(final int type) {
+ String label = null;
+
+ if (type == Calls.INCOMING_TYPE) {
+ label = "incoming";
+ }
+ else if (type == Calls.OUTGOING_TYPE) {
+ label = "outgoing";
+ }
+ else if (type == Calls.MISSED_TYPE) {
+ label = "missed";
+ }
+
+ if (prefs.getBoolean("cl_ask_before_clear", false)) {
+ AlertDialog.Builder alert = new AlertDialog.Builder(this);
+ alert.setTitle(R.string.alert_clear_call_log_title);
+ alert.setMessage("Are you sure you want to clear all " + label + " call records?");
+ alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int whichButton) {
+ deleteCallLog(Calls.TYPE + "=" + type, null);
+ }
+ });
+ alert.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int whichButton) {
+ // Canceled.
+ }});
+ alert.show();
+
+ }
+ else {
+ deleteCallLog(Calls.TYPE + "=" + type, null);
+ }
+ }
+
private void deleteCallLog(String where, String[] selArgs) {
try {
- getContentResolver().delete(Calls.CONTENT_URI, where, null);
+ getContentResolver().delete(Calls.CONTENT_URI, where, selArgs);
//TODO The change notification should do this automatically, but it isn't working
// right now. Remove this when the change notification is working properly.
startQuery();