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/TaskQueue.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/TaskQueue.java')
-rw-r--r-- | java/com/android/voicemail/impl/scheduling/TaskQueue.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/java/com/android/voicemail/impl/scheduling/TaskQueue.java b/java/com/android/voicemail/impl/scheduling/TaskQueue.java index fc5aa947a..6afcf0087 100644 --- a/java/com/android/voicemail/impl/scheduling/TaskQueue.java +++ b/java/com/android/voicemail/impl/scheduling/TaskQueue.java @@ -23,6 +23,7 @@ import android.support.annotation.Nullable; import com.android.voicemail.impl.Assert; import com.android.voicemail.impl.VvmLog; import com.android.voicemail.impl.scheduling.Task.TaskId; +import com.android.voicemail.impl.scheduling.Tasks.TaskCreationException; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Iterator; @@ -49,9 +50,13 @@ class TaskQueue implements Iterable<Task> { public void fromBundles(Context context, List<Bundle> pendingTasks) { Assert.isTrue(queue.isEmpty()); for (Bundle pendingTask : pendingTasks) { - Task task = Tasks.createTask(context, pendingTask); - task.onRestore(pendingTask); - add(task); + try { + Task task = Tasks.createTask(context, pendingTask); + task.onRestore(pendingTask); + add(task); + } catch (TaskCreationException e) { + VvmLog.e("TaskQueue.fromBundles", "cannot create task", e); + } } } |