summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/app/calllog/CallLogNotificationsService.java
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-05-15 14:05:33 -0700
committerEric Erfanian <erfanian@google.com>2017-05-15 14:48:12 -0700
commitc857f90590e7d7fcffa89511982eb33afd34805f (patch)
tree9910fb95c6fdb10b06ee8be02a3374d2882005b9 /java/com/android/dialer/app/calllog/CallLogNotificationsService.java
parent738bb09adee2b56c99063a0264f8f76de393143b (diff)
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
Diffstat (limited to 'java/com/android/dialer/app/calllog/CallLogNotificationsService.java')
-rw-r--r--java/com/android/dialer/app/calllog/CallLogNotificationsService.java89
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);