diff options
author | Santos Cordon <santoscordon@google.com> | 2014-07-02 23:41:29 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-07-02 21:11:19 +0000 |
commit | c3ad2290b27234e7a2b7358d11ed137429b2be00 (patch) | |
tree | 26ca4888fd5040fadda70e788a06fbd3787d8fea | |
parent | fc1fed72d6adf5158be271646655056b14d1ccf2 (diff) | |
parent | 266a8ac75ab0cd0c0529cf342f8ab33ab1095b20 (diff) |
Merge "Make dialer use PhoneManager.cancelMissedCallsNotification."
3 files changed, 6 insertions, 22 deletions
diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java index 1d6ec79ff..1668895ef 100644 --- a/src/com/android/dialer/calllog/CallLogFragment.java +++ b/src/com/android/dialer/calllog/CallLogFragment.java @@ -489,7 +489,7 @@ public class CallLogFragment extends ListFragment if (!onEntry) { mCallLogQueryHandler.markMissedCallsAsRead(); } - CallLogNotificationsHelper.removeMissedCallNotifications(); + CallLogNotificationsHelper.removeMissedCallNotifications(getActivity()); CallLogNotificationsHelper.updateVoicemailNotifications(getActivity()); } } diff --git a/src/com/android/dialer/calllog/CallLogNotificationsHelper.java b/src/com/android/dialer/calllog/CallLogNotificationsHelper.java index 6ce66f08f..2b4ae5020 100644 --- a/src/com/android/dialer/calllog/CallLogNotificationsHelper.java +++ b/src/com/android/dialer/calllog/CallLogNotificationsHelper.java @@ -18,32 +18,16 @@ package com.android.dialer.calllog; import android.content.Context; import android.content.Intent; -import android.os.RemoteException; -import android.os.ServiceManager; -import android.util.Log; - -import com.android.internal.telephony.ITelephony; +import android.phone.PhoneManager; /** * Helper class operating on call log notifications. */ public class CallLogNotificationsHelper { - private static final String TAG = "CallLogNotificationsHelper"; - /** Removes the missed call notifications. */ - public static void removeMissedCallNotifications() { - try { - ITelephony telephony = - ITelephony.Stub.asInterface(ServiceManager.getService("phone")); - if (telephony != null) { - telephony.cancelMissedCallsNotification(); - } else { - Log.w(TAG, "Telephony service is null, can't call " + - "cancelMissedCallsNotification"); - } - } catch (RemoteException e) { - Log.e(TAG, "Failed to clear missed calls notification due to remote exception"); - } + public static void removeMissedCallNotifications(Context context) { + PhoneManager phoneManager = (PhoneManager) context.getSystemService(Context.PHONE_SERVICE); + phoneManager.cancelMissedCallsNotification(); } /** Update the voice mail notifications. */ diff --git a/src/com/android/dialer/list/ShortcutCardsAdapter.java b/src/com/android/dialer/list/ShortcutCardsAdapter.java index 766bddaa5..e856d800b 100644 --- a/src/com/android/dialer/list/ShortcutCardsAdapter.java +++ b/src/com/android/dialer/list/ShortcutCardsAdapter.java @@ -78,7 +78,7 @@ public class ShortcutCardsAdapter extends BaseAdapter { public void onSwipe(View view) { mCallLogQueryHandler.markNewCallsAsOld(); mCallLogQueryHandler.markNewVoicemailsAsOld(); - CallLogNotificationsHelper.removeMissedCallNotifications(); + CallLogNotificationsHelper.removeMissedCallNotifications(mContext); CallLogNotificationsHelper.updateVoicemailNotifications(mContext); mFragment.dismissShortcut(view); } |