summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/app/calllog/CallLogNotificationsService.java
diff options
context:
space:
mode:
authortwyen <twyen@google.com>2017-09-27 17:11:33 -0700
committerEric Erfanian <erfanian@google.com>2017-09-28 08:36:37 -0700
commit96aea2a8f42bfc55dd2b08c51698efb0d0559109 (patch)
treeeb2b91eaa8fafe6041c27dae82a68888ba771a93 /java/com/android/dialer/app/calllog/CallLogNotificationsService.java
parentf455e6a70d225a28fff2b1922b0e1f4123d94a55 (diff)
Use goAsync() and dialer executor to insert post call notifications
Previously post call notifications are inserted by launching CallLogNotificationService. This usually works because the call has just broght dialer to the foreground and there are some grace period before the app is consider background again. However if the post call message comes later background check will crash the app. This CL made the broadcast receiver async and complete the insertion in a worker since it wouldn't take more than a few seconds. Bug: 66444859 Test: unit tests PiperOrigin-RevId: 170275928 Change-Id: I0ff396b51a173f2e4bab0bca6b6e5c5b56ab62da
Diffstat (limited to 'java/com/android/dialer/app/calllog/CallLogNotificationsService.java')
-rw-r--r--java/com/android/dialer/app/calllog/CallLogNotificationsService.java33
1 files changed, 1 insertions, 32 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogNotificationsService.java b/java/com/android/dialer/app/calllog/CallLogNotificationsService.java
index 0490b9932..5949141f1 100644
--- a/java/com/android/dialer/app/calllog/CallLogNotificationsService.java
+++ b/java/com/android/dialer/app/calllog/CallLogNotificationsService.java
@@ -64,9 +64,6 @@ public class CallLogNotificationsService extends IntentService {
private static final String ACTION_CANCEL_SINGLE_MISSED_CALL =
"com.android.dialer.calllog.ACTION_CANCEL_SINGLE_MISSED_CALL";
- private static final String ACTION_INCOMING_POST_CALL =
- "com.android.dialer.calllog.INCOMING_POST_CALL";
-
/** Action to call back a missed call. */
public static final String ACTION_CALL_BACK_FROM_MISSED_CALL_NOTIFICATION =
"com.android.dialer.calllog.CALL_BACK_FROM_MISSED_CALL_NOTIFICATION";
@@ -75,21 +72,6 @@ public class CallLogNotificationsService extends IntentService {
public static final String ACTION_LEGACY_VOICEMAIL_DISMISSED =
"com.android.dialer.calllog.ACTION_LEGACY_VOICEMAIL_DISMISSED";
- /**
- * Extra to be included with {@link #ACTION_INCOMING_POST_CALL} to represent a post call note.
- *
- * <p>It must be a {@link String}
- */
- private static final String EXTRA_POST_CALL_NOTE = "POST_CALL_NOTE";
-
- /**
- * Extra to be included with {@link #ACTION_INCOMING_POST_CALL} to represent the phone number the
- * post call note came from.
- *
- * <p>It must be a {@link String}
- */
- private static final String EXTRA_POST_CALL_NUMBER = "POST_CALL_NUMBER";
-
private static final String EXTRA_PHONE_ACCOUNT_HANDLE = "PHONE_ACCOUNT_HANDLE";
public static final int UNKNOWN_MISSED_CALL_COUNT = -1;
@@ -98,14 +80,6 @@ public class CallLogNotificationsService extends IntentService {
super("CallLogNotificationsService");
}
- public static void insertPostCallNote(Context context, String number, String postCallNote) {
- Intent serviceIntent = new Intent(context, CallLogNotificationsService.class);
- serviceIntent.setAction(ACTION_INCOMING_POST_CALL);
- serviceIntent.putExtra(EXTRA_POST_CALL_NUMBER, number);
- serviceIntent.putExtra(EXTRA_POST_CALL_NOTE, postCallNote);
- context.startService(serviceIntent);
- }
-
public static void markAllNewVoicemailsAsOld(Context context) {
LogUtil.enterBlock("CallLogNotificationsService.markAllNewVoicemailsAsOld");
Intent serviceIntent = new Intent(context, CallLogNotificationsService.class);
@@ -195,11 +169,6 @@ public class CallLogNotificationsService extends IntentService {
LegacyVoicemailNotificationReceiver.setDismissed(
this, intent.getParcelableExtra(EXTRA_PHONE_ACCOUNT_HANDLE), true);
break;
- case ACTION_INCOMING_POST_CALL:
- String note = intent.getStringExtra(EXTRA_POST_CALL_NOTE);
- String phoneNumber = intent.getStringExtra(EXTRA_POST_CALL_NUMBER);
- MissedCallNotifier.getIstance(this).insertPostCallNotification(phoneNumber, note);
- break;
case ACTION_CANCEL_ALL_MISSED_CALLS:
cancelAllMissedCalls(this);
break;
@@ -210,7 +179,7 @@ public class CallLogNotificationsService extends IntentService {
TelecomUtil.cancelMissedCallsNotification(this);
break;
case ACTION_CALL_BACK_FROM_MISSED_CALL_NOTIFICATION:
- MissedCallNotifier.getIstance(this)
+ MissedCallNotifier.getInstance(this)
.callBackFromMissedCall(
intent.getStringExtra(
MissedCallNotificationReceiver.EXTRA_NOTIFICATION_PHONE_NUMBER),