summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/com/android/dialer/calllog/CallLogFragment.java2
-rw-r--r--src/com/android/dialer/calllog/CallLogNotificationsHelper.java24
-rw-r--r--src/com/android/dialer/list/ShortcutCardsAdapter.java2
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);
}