Loading src/com/android/contacts/callstats/CallStatsDetails.java +6 −2 Original line number Diff line number Diff line Loading @@ -54,8 +54,7 @@ public class CallStatsDetails implements CallDetailHeader.Data, Parcelable { this.geocode = geocode; this.date = date; this.inDuration = this.outDuration = 0; this.incomingCount = this.outgoingCount = this.missedCount = 0; reset(); if (info != null) { updateFromInfo(info); Loading Loading @@ -167,6 +166,11 @@ public class CallStatsDetails implements CallDetailHeader.Data, Parcelable { this.missedCount += other.missedCount; } public void reset() { this.inDuration = this.outDuration = 0; this.incomingCount = this.outgoingCount = this.missedCount = 0; } /* Parcelable interface */ @Override Loading src/com/android/contacts/callstats/CallStatsQueryHandler.java +4 −7 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ public class CallStatsQueryHandler extends AsyncQueryHandler { startQuery(QUERY_CALLS_TOKEN, null, Calls.CONTENT_URI, CallStatsQuery._PROJECTION, selection.toString(), selectionArgs.toArray(EMPTY_STRING_ARRAY), Calls.NUMBER + " DESC"); Calls.NUMBER + " ASC"); } @Override Loading Loading @@ -194,24 +194,21 @@ public class CallStatsQueryHandler extends AsyncQueryHandler { final ArrayList<CallStatsDetails> callsToRemove = new ArrayList<CallStatsDetails>(); final ArrayList<ContactInfo> infosToRemove = new ArrayList<ContactInfo>(); // numbers in non-international format will be the first for (int i = 0; i < calls.size(); i++) { final CallStatsDetails outerItem = calls.get(i); final String currentFormattedNumber = outerItem.number.toString(); if (currentFormattedNumber.startsWith("+")) { continue; // we don't check numbers starting with +, only removing from this point } for (int j = calls.size() - 1; j > i; j--) { final CallStatsDetails innerItem = calls.get(j); final String innerNumber = innerItem.number.toString(); if (ContactsUtils.phoneNumbersEqual(currentFormattedNumber, innerNumber)) { outerItem.mergeWith(innerItem); //make sure we're not counting twice in case we're dealing with //multiple different formats innerItem.reset(); callsToRemove.add(innerItem); infosToRemove.add(infos.get(j)); break; // we don't have multiple items with the same number, stop } } } Loading Loading
src/com/android/contacts/callstats/CallStatsDetails.java +6 −2 Original line number Diff line number Diff line Loading @@ -54,8 +54,7 @@ public class CallStatsDetails implements CallDetailHeader.Data, Parcelable { this.geocode = geocode; this.date = date; this.inDuration = this.outDuration = 0; this.incomingCount = this.outgoingCount = this.missedCount = 0; reset(); if (info != null) { updateFromInfo(info); Loading Loading @@ -167,6 +166,11 @@ public class CallStatsDetails implements CallDetailHeader.Data, Parcelable { this.missedCount += other.missedCount; } public void reset() { this.inDuration = this.outDuration = 0; this.incomingCount = this.outgoingCount = this.missedCount = 0; } /* Parcelable interface */ @Override Loading
src/com/android/contacts/callstats/CallStatsQueryHandler.java +4 −7 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ public class CallStatsQueryHandler extends AsyncQueryHandler { startQuery(QUERY_CALLS_TOKEN, null, Calls.CONTENT_URI, CallStatsQuery._PROJECTION, selection.toString(), selectionArgs.toArray(EMPTY_STRING_ARRAY), Calls.NUMBER + " DESC"); Calls.NUMBER + " ASC"); } @Override Loading Loading @@ -194,24 +194,21 @@ public class CallStatsQueryHandler extends AsyncQueryHandler { final ArrayList<CallStatsDetails> callsToRemove = new ArrayList<CallStatsDetails>(); final ArrayList<ContactInfo> infosToRemove = new ArrayList<ContactInfo>(); // numbers in non-international format will be the first for (int i = 0; i < calls.size(); i++) { final CallStatsDetails outerItem = calls.get(i); final String currentFormattedNumber = outerItem.number.toString(); if (currentFormattedNumber.startsWith("+")) { continue; // we don't check numbers starting with +, only removing from this point } for (int j = calls.size() - 1; j > i; j--) { final CallStatsDetails innerItem = calls.get(j); final String innerNumber = innerItem.number.toString(); if (ContactsUtils.phoneNumbersEqual(currentFormattedNumber, innerNumber)) { outerItem.mergeWith(innerItem); //make sure we're not counting twice in case we're dealing with //multiple different formats innerItem.reset(); callsToRemove.add(innerItem); infosToRemove.add(infos.get(j)); break; // we don't have multiple items with the same number, stop } } } Loading