diff options
author | Eric Erfanian <erfanian@google.com> | 2017-05-16 00:09:31 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-16 00:09:31 +0000 |
commit | c57430a61eab62e88372f386c75989dab6332608 (patch) | |
tree | b606f1899f80fcd0ea3ee753ce799883d5a673ab /java/com/android/dialer/app/calllog/CallLogNotificationsService.java | |
parent | 9842b4a7fd1d852b1353af806da4913b4298d516 (diff) | |
parent | 0c9dbf507b53a12bdf577ff3e55c1686a2e089de (diff) |
Merge "Update Dialer to v10 RC32" into oc-dev
am: 0c9dbf507b
Change-Id: I5f90090090c6e430d83fcdd294082c1f5237ade8
Diffstat (limited to 'java/com/android/dialer/app/calllog/CallLogNotificationsService.java')
-rw-r--r-- | java/com/android/dialer/app/calllog/CallLogNotificationsService.java | 89 |
1 files changed, 5 insertions, 84 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogNotificationsService.java b/java/com/android/dialer/app/calllog/CallLogNotificationsService.java index f67837f8a..7dfd2cb69 100644 --- a/java/com/android/dialer/app/calllog/CallLogNotificationsService.java +++ b/java/com/android/dialer/app/calllog/CallLogNotificationsService.java @@ -26,7 +26,6 @@ import android.support.annotation.Nullable; import com.android.dialer.common.LogUtil; import com.android.dialer.telecom.TelecomUtil; import com.android.dialer.util.PermissionsUtil; -import me.leolin.shortcutbadger.ShortcutBadger; /** * Provides operations for managing call-related notifications. @@ -47,17 +46,6 @@ public class CallLogNotificationsService extends IntentService { /** Action to mark all the new voicemails as old. */ public static final String ACTION_MARK_NEW_VOICEMAILS_AS_OLD = "com.android.dialer.calllog.ACTION_MARK_NEW_VOICEMAILS_AS_OLD"; - /** Action to update voicemail notifications. */ - public static final String ACTION_UPDATE_VOICEMAIL_NOTIFICATIONS = - "com.android.dialer.calllog.UPDATE_VOICEMAIL_NOTIFICATIONS"; - /** - * Action to update the missed call notifications. - * - * <p>Includes optional extras {@link #EXTRA_MISSED_CALL_NUMBER} and {@link - * #EXTRA_MISSED_CALL_COUNT}. - */ - public static final String ACTION_UPDATE_MISSED_CALL_NOTIFICATIONS = - "com.android.dialer.calllog.UPDATE_MISSED_CALL_NOTIFICATIONS"; /** Action to mark all the new missed calls as old. */ public static final String ACTION_MARK_NEW_MISSED_CALLS_AS_OLD = @@ -72,22 +60,6 @@ public class CallLogNotificationsService extends IntentService { "com.android.dialer.calllog.CALL_BACK_FROM_MISSED_CALL_NOTIFICATION"; /** - * Extra to be included with {@link #ACTION_UPDATE_MISSED_CALL_NOTIFICATIONS} and {@link - * #ACTION_CALL_BACK_FROM_MISSED_CALL_NOTIFICATION} to identify the number to display, call or - * text back. - * - * <p>It must be a {@link String}. - */ - public static final String EXTRA_MISSED_CALL_NUMBER = "MISSED_CALL_NUMBER"; - /** - * Extra to be included with {@link #ACTION_UPDATE_MISSED_CALL_NOTIFICATIONS} to represent the - * number of missed calls. - * - * <p>It must be a {@link Integer} - */ - public static final String EXTRA_MISSED_CALL_COUNT = "MISSED_CALL_COUNT"; - - /** * Extra to be included with {@link #ACTION_INCOMING_POST_CALL} to represent a post call note. * * <p>It must be a {@link String} @@ -109,40 +81,6 @@ public class CallLogNotificationsService extends IntentService { super("CallLogNotificationsService"); } - /** - * Updates notifications for any new voicemails. - * - * @param context a valid context. - */ - public static void updateVoicemailNotifications(Context context) { - if (!TelecomUtil.isDefaultDialer(context)) { - LogUtil.i( - "CallLogNotificationsService.updateVoicemailNotifications", - "not default dialer, ignoring voicemail notifications"); - return; - } - if (TelecomUtil.hasReadWriteVoicemailPermissions(context)) { - Intent serviceIntent = new Intent(context, CallLogNotificationsService.class); - serviceIntent.setAction(CallLogNotificationsService.ACTION_UPDATE_VOICEMAIL_NOTIFICATIONS); - context.startService(serviceIntent); - } - } - - /** - * Updates notifications for any new missed calls. - * - * @param context A valid context. - * @param count The number of new missed calls. - * @param number The phone number of the newest missed call. - */ - public static void updateMissedCallNotifications(Context context, int count, String number) { - Intent serviceIntent = new Intent(context, CallLogNotificationsService.class); - serviceIntent.setAction(CallLogNotificationsService.ACTION_UPDATE_MISSED_CALL_NOTIFICATIONS); - serviceIntent.putExtra(EXTRA_MISSED_CALL_COUNT, count); - serviceIntent.putExtra(EXTRA_MISSED_CALL_NUMBER, number); - context.startService(serviceIntent); - } - public static void insertPostCallNote(Context context, String number, String postCallNote) { Intent serviceIntent = new Intent(context, CallLogNotificationsService.class); serviceIntent.setAction(ACTION_INCOMING_POST_CALL); @@ -165,16 +103,6 @@ public class CallLogNotificationsService extends IntentService { context.startService(serviceIntent); } - public static boolean updateBadgeCount(Context context, int count) { - boolean success = ShortcutBadger.applyCount(context, count); - LogUtil.i( - "CallLogNotificationsService.updateBadgeCount", - "update badge count: %d success: %b", - count, - success); - return success; - } - @Override protected void onHandleIntent(Intent intent) { if (intent == null) { @@ -200,28 +128,21 @@ public class CallLogNotificationsService extends IntentService { mVoicemailQueryHandler.markNewVoicemailsAsOld(intent.getData()); }); break; - case ACTION_UPDATE_VOICEMAIL_NOTIFICATIONS: - DefaultVoicemailNotifier.getInstance(this).updateNotification(); - break; - case ACTION_UPDATE_MISSED_CALL_NOTIFICATIONS: - int count = intent.getIntExtra(EXTRA_MISSED_CALL_COUNT, UNKNOWN_MISSED_CALL_COUNT); - String number = intent.getStringExtra(EXTRA_MISSED_CALL_NUMBER); - MissedCallNotifier.getInstance(this).updateMissedCallNotification(count, number); - updateBadgeCount(this, count); - break; case ACTION_INCOMING_POST_CALL: String note = intent.getStringExtra(EXTRA_POST_CALL_NOTE); String phoneNumber = intent.getStringExtra(EXTRA_POST_CALL_NUMBER); - MissedCallNotifier.getInstance(this).insertPostCallNotification(phoneNumber, note); + MissedCallNotifier.getIstance(this).insertPostCallNotification(phoneNumber, note); break; case ACTION_MARK_NEW_MISSED_CALLS_AS_OLD: CallLogNotificationsQueryHelper.removeMissedCallNotifications(this, intent.getData()); TelecomUtil.cancelMissedCallsNotification(this); break; case ACTION_CALL_BACK_FROM_MISSED_CALL_NOTIFICATION: - MissedCallNotifier.getInstance(this) + MissedCallNotifier.getIstance(this) .callBackFromMissedCall( - intent.getStringExtra(EXTRA_MISSED_CALL_NUMBER), intent.getData()); + intent.getStringExtra( + MissedCallNotificationReceiver.EXTRA_NOTIFICATION_PHONE_NUMBER), + intent.getData()); break; default: LogUtil.d("CallLogNotificationsService.onHandleIntent", "could not handle: " + intent); |