From 9b9244b6941110ea2d940d9fc8eed0cdff96a016 Mon Sep 17 00:00:00 2001 From: Matthew Williams Date: Wed, 14 May 2014 11:06:04 -0700 Subject: DO NOT MERGE Implementation of TaskManager reschedule/cancel Issues here: "Reschedule" of an idle-mode task is not well-defined. In the API I throw an error if you try to set a back-off policy on an idle mode task. Implementation-wise, i add a delay for a reschedule request of an idle mode task. This means that if the phone's still in idle mode after the delay they app will get a call back, but otherwise it'll have to wait til the next one. Implemented all API functions --- api/current.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'api') diff --git a/api/current.txt b/api/current.txt index 2b6189a..8741d6d 100644 --- a/api/current.txt +++ b/api/current.txt @@ -5355,13 +5355,13 @@ package android.app.task { method public int describeContents(); method public int getBackoffPolicy(); method public android.os.Bundle getExtras(); + method public int getId(); method public long getInitialBackoffMillis(); method public long getIntervalMillis(); method public long getMaxExecutionDelayMillis(); method public long getMinLatencyMillis(); method public int getNetworkCapabilities(); method public android.content.ComponentName getService(); - method public int getTaskId(); method public boolean isPeriodic(); method public boolean isRequireCharging(); method public boolean isRequireDeviceIdle(); @@ -5374,7 +5374,7 @@ package android.app.task { field public static final int LINEAR = 0; // 0x0 } - public final class Task.Builder { + public static final class Task.Builder { ctor public Task.Builder(int, android.content.ComponentName); method public android.app.task.Task build(); method public android.app.task.Task.Builder setBackoffCriteria(long, int); @@ -5388,8 +5388,9 @@ package android.app.task { } public static abstract interface Task.NetworkType { - field public static final int ANY = 0; // 0x0 - field public static final int UNMETERED = 1; // 0x1 + field public static final int ANY = 1; // 0x1 + field public static final int NONE = 0; // 0x0 + field public static final int UNMETERED = 2; // 0x2 } public abstract class TaskManager { @@ -5398,8 +5399,8 @@ package android.app.task { method public abstract void cancelAll(); method public abstract java.util.List getAllPendingTasks(); method public abstract int schedule(android.app.task.Task); - field public static final int RESULT_INVALID_PARAMETERS = -1; // 0xffffffff - field public static final int RESULT_OVER_QUOTA = -2; // 0xfffffffe + field public static final int RESULT_FAILURE = 0; // 0x0 + field public static final int RESULT_SUCCESS = 1; // 0x1 } public class TaskParams implements android.os.Parcelable { -- cgit v1.1