Merge "Make dialer use PhoneManager.cancelMissedCallsNotification."
diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java
index 1d6ec79..1668895 100644
--- a/src/com/android/dialer/calllog/CallLogFragment.java
+++ b/src/com/android/dialer/calllog/CallLogFragment.java
@@ -489,7 +489,7 @@
             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 6ce66f0..2b4ae50 100644
--- a/src/com/android/dialer/calllog/CallLogNotificationsHelper.java
+++ b/src/com/android/dialer/calllog/CallLogNotificationsHelper.java
@@ -18,32 +18,16 @@
 
 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 766bdda..e856d80 100644
--- a/src/com/android/dialer/list/ShortcutCardsAdapter.java
+++ b/src/com/android/dialer/list/ShortcutCardsAdapter.java
@@ -78,7 +78,7 @@
         public void onSwipe(View view) {
             mCallLogQueryHandler.markNewCallsAsOld();
             mCallLogQueryHandler.markNewVoicemailsAsOld();
-            CallLogNotificationsHelper.removeMissedCallNotifications();
+            CallLogNotificationsHelper.removeMissedCallNotifications(mContext);
             CallLogNotificationsHelper.updateVoicemailNotifications(mContext);
             mFragment.dismissShortcut(view);
         }