From cb55981252b49e476e1adf9f2d5ec19a658d2aa4 Mon Sep 17 00:00:00 2001 From: Sarmad Hashmi Date: Wed, 10 Feb 2016 18:39:59 -0800 Subject: Mark missed calls as read on swipe. When swiping to a new tab, if the previous tab that the user was in was the call history tab, all missed calls are marked as read and the tab count is updated. Also fixes b/27153608 and clearing of missed calls on orientation change. BUG=27136093 BUG=27153608 BUG=27154514 Change-Id: I5be31b1a3978784b941fb8e1af22f93fb6ca944a --- src/com/android/dialer/list/ListsFragment.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/com/android/dialer/list/ListsFragment.java') diff --git a/src/com/android/dialer/list/ListsFragment.java b/src/com/android/dialer/list/ListsFragment.java index 9f761486d..5b7c950bf 100644 --- a/src/com/android/dialer/list/ListsFragment.java +++ b/src/com/android/dialer/list/ListsFragment.java @@ -36,6 +36,7 @@ import com.android.contacts.common.list.ViewPagerTabs; import com.android.dialer.DialtactsActivity; import com.android.dialer.R; import com.android.dialer.calllog.CallLogFragment; +import com.android.dialer.calllog.CallLogNotificationsHelper; import com.android.dialer.calllog.CallLogQueryHandler; import com.android.dialer.calllog.VisualVoicemailCallLogFragment; import com.android.dialer.logging.Logger; @@ -376,7 +377,8 @@ public class ListsFragment extends Fragment /** * External method to update unread count because the unread count changes when the user - * expands a voicemail in the call log. + * expands a voicemail in the call log or when the user expands an unread call in the call + * history tab. */ public void updateTabUnreadCounts() { if (mCallLogQueryHandler != null) { @@ -387,6 +389,17 @@ public class ListsFragment extends Fragment } } + /** + * External method to mark all missed calls as read. + */ + public void markMissedCallsAsReadAndRemoveNotifications() { + if (mCallLogQueryHandler != null) { + mCallLogQueryHandler.markMissedCallsAsRead(); + CallLogNotificationsHelper.removeMissedCallNotifications(getActivity()); + } + } + + public void showRemoveView(boolean show) { mRemoveViewContent.setVisibility(show ? View.VISIBLE : View.GONE); mRemoveView.setAlpha(show ? 0 : 1); -- cgit v1.2.3