Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 266a8ac7 authored by Santos Cordon's avatar Santos Cordon
Browse files

Make dialer use PhoneManager.cancelMissedCallsNotification.

Change-Id: I1e8de39efe0918b974cf949e80e15e4c85c1a70c
parent 91c90d13
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -489,7 +489,7 @@ public class CallLogFragment extends ListFragment
            if (!onEntry) {
                mCallLogQueryHandler.markMissedCallsAsRead();
            }
            CallLogNotificationsHelper.removeMissedCallNotifications();
            CallLogNotificationsHelper.removeMissedCallNotifications(getActivity());
            CallLogNotificationsHelper.updateVoicemailNotifications(getActivity());
        }
    }
+4 −20
Original line number Diff line number Diff line
@@ -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. */
+1 −1
Original line number Diff line number Diff line
@@ -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);
        }