diff options
author | twyen <twyen@google.com> | 2018-03-26 11:05:29 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-03-26 22:23:04 -0700 |
commit | e652cbf3991aad4a46ad811f370a54c1051089e0 (patch) | |
tree | 1a84176c631cccc87c584fa41e54ada1e3af36d6 /java/com/android/voicemail/impl/scheduling/TaskReceiver.java | |
parent | 07d6d00a5cc6c1aeb1befaccc1e832b3d5b398d8 (diff) |
Catch BadParcelableException
This happens when an old dialer submitted a job and the newer dialer is trying to handle it. The class fingerprint changed so it can no longer be unparceled.
In this CL, such tasks will be dropped.
Bug: 64225192
Test: N/A
PiperOrigin-RevId: 190491751
Change-Id: I90fe2d24a435201cfae09970387e9b1c3a58b094
Diffstat (limited to 'java/com/android/voicemail/impl/scheduling/TaskReceiver.java')
-rw-r--r-- | java/com/android/voicemail/impl/scheduling/TaskReceiver.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/java/com/android/voicemail/impl/scheduling/TaskReceiver.java b/java/com/android/voicemail/impl/scheduling/TaskReceiver.java index e78dcf72c..b9fd272af 100644 --- a/java/com/android/voicemail/impl/scheduling/TaskReceiver.java +++ b/java/com/android/voicemail/impl/scheduling/TaskReceiver.java @@ -23,6 +23,7 @@ import android.content.Intent; import android.os.Build.VERSION_CODES; import android.os.Bundle; import com.android.voicemail.impl.VvmLog; +import com.android.voicemail.impl.scheduling.Tasks.TaskCreationException; import java.util.ArrayList; import java.util.List; @@ -69,8 +70,12 @@ public class TaskReceiver extends BroadcastReceiver { deferredBroadcasts.add(intent); return; } - Task task = Tasks.createTask(context.getApplicationContext(), intent.getExtras()); - taskExecutor.addTask(task); + try { + Task task = Tasks.createTask(context.getApplicationContext(), intent.getExtras()); + taskExecutor.addTask(task); + } catch (TaskCreationException e) { + VvmLog.e(TAG, "cannot create task", e); + } } else { VvmLog.i(TAG, "scheduling new job"); List<Bundle> taskList = new ArrayList<>(); |