From c857f90590e7d7fcffa89511982eb33afd34805f Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Mon, 15 May 2017 14:05:33 -0700 Subject: Update Dialer to v10 RC32 This release was created following the instructions at: go/dialer-aosp-release Subsequent dialer releases will follow as O bugs are fixed, until we reach our final RC. Version: 10 Candidate: RC32 Branch: dialer-android_release_branch/153304843.1 dialer-android_20170416.00/dialer-android_20170416.00_RC32 This release contains the following bug fixes since RC17: Bug: 33176679 33272455 3646510 36773894 37297649 37413780 37513689 37640315 37680595 37698062 37873639 37901752 37919295 37953423 38062852 38069600 38137349 38173549 38180252 38191514 Test: make, on device Change-Id: I4e4bb630082758e418ff24892b7db3142c6eb09a --- .../app/calllog/CallLogNotificationsService.java | 89 ++-------------------- 1 file changed, 5 insertions(+), 84 deletions(-) (limited to 'java/com/android/dialer/app/calllog/CallLogNotificationsService.java') 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. - * - *

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 = @@ -71,22 +59,6 @@ public class CallLogNotificationsService extends IntentService { public static final String ACTION_CALL_BACK_FROM_MISSED_CALL_NOTIFICATION = "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. - * - *

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. - * - *

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. * @@ -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); -- cgit v1.2.3