diff options
author | Sarmad Hashmi <mhashmi@google.com> | 2016-01-25 17:35:36 -0800 |
---|---|---|
committer | Sarmad Hashmi <mhashmi@google.com> | 2016-02-24 15:15:02 -0800 |
commit | cdc14da9275c67d123b55e668f48f73c4b58d948 (patch) | |
tree | f7441079b38f5c50bae4cf45d68b105f05d6fc8b /src/com/android/dialer/list/ListsFragment.java | |
parent | 6d8399afae309207237456c27b336d948ed912ff (diff) |
[DO NOT MERGE] Display missed call count for call log.
The number of unread missed calls are displayed beside the Call Log as a
badge. All unread missed calls are bolded under the call log tab. When
exiting the call log tab, all unread calls are marked as read. When
interacting with an unread missed call card while in the call log tab,
it will subtract 1 from the badge.
Cherry-picked from d118a8e0d8a68499398504f350f81175118e2ecf
BUG=24953555
Change-Id: If91a3bc89197465934cb773955e4bec005d6d14e
Diffstat (limited to 'src/com/android/dialer/list/ListsFragment.java')
-rw-r--r-- | src/com/android/dialer/list/ListsFragment.java | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/com/android/dialer/list/ListsFragment.java b/src/com/android/dialer/list/ListsFragment.java index d5caa1a2e..9f761486d 100644 --- a/src/com/android/dialer/list/ListsFragment.java +++ b/src/com/android/dialer/list/ListsFragment.java @@ -192,6 +192,7 @@ public class ListsFragment extends Fragment mCallLogQueryHandler = new CallLogQueryHandler(getActivity(), getActivity().getContentResolver(), this); mCallLogQueryHandler.fetchVoicemailStatus(); + mCallLogQueryHandler.fetchMissedCallsUnreadCount(); Trace.endSection(); } @@ -347,6 +348,23 @@ public class ListsFragment extends Fragment } @Override + public void onMissedCallsUnreadCountFetched(Cursor cursor) { + if (getActivity() == null || getActivity().isFinishing() || cursor == null) { + return; + } + + int count = 0; + try { + count = cursor.getCount(); + } finally { + cursor.close(); + } + + mViewPagerTabs.setUnreadCount(count, TAB_INDEX_HISTORY); + mViewPagerTabs.updateTab(TAB_INDEX_HISTORY); + } + + @Override public boolean onCallsFetched(Cursor statusCursor) { // Return false; did not take ownership of cursor return false; @@ -361,8 +379,11 @@ public class ListsFragment extends Fragment * expands a voicemail in the call log. */ public void updateTabUnreadCounts() { - if (mHasActiveVoicemailProvider && mCallLogQueryHandler != null) { - mCallLogQueryHandler.fetchVoicemailUnreadCount(); + if (mCallLogQueryHandler != null) { + mCallLogQueryHandler.fetchMissedCallsUnreadCount(); + if (mHasActiveVoicemailProvider) { + mCallLogQueryHandler.fetchVoicemailUnreadCount(); + } } } |