summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorMakoto Onuki <omakoto@google.com>2018-01-16 23:04:15 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-01-16 23:04:15 +0000
commit13ccf0b9514213476e7cb2e15a1f762fa2d1ceab (patch)
treef2bce07dc4924ce0da18e048a616c014d81ede35 /core/java/android
parent182b3f994b0849ca590d75d03a24361ede89ba0c (diff)
parentd2bfec6359654b14e627502b784131cff1ebf03d (diff)
Merge "Log sync stop (== onStopJob) reason in the sync log."
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/job/JobParameters.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/core/java/android/app/job/JobParameters.java b/core/java/android/app/job/JobParameters.java
index 5053dc6fdf05..c71bf2e65731 100644
--- a/core/java/android/app/job/JobParameters.java
+++ b/core/java/android/app/job/JobParameters.java
@@ -70,6 +70,7 @@ public class JobParameters implements Parcelable {
private final Network network;
private int stopReason; // Default value of stopReason is REASON_CANCELED
+ private String debugStopReason; // Human readable stop reason for debugging.
/** @hide */
public JobParameters(IBinder callback, int jobId, PersistableBundle extras,
@@ -104,6 +105,14 @@ public class JobParameters implements Parcelable {
}
/**
+ * Reason onStopJob() was called on this job.
+ * @hide
+ */
+ public String getDebugStopReason() {
+ return debugStopReason;
+ }
+
+ /**
* @return The extras you passed in when constructing this job with
* {@link android.app.job.JobInfo.Builder#setExtras(android.os.PersistableBundle)}. This will
* never be null. If you did not set any extras this will be an empty bundle.
@@ -288,11 +297,13 @@ public class JobParameters implements Parcelable {
network = null;
}
stopReason = in.readInt();
+ debugStopReason = in.readString();
}
/** @hide */
- public void setStopReason(int reason) {
+ public void setStopReason(int reason, String debugStopReason) {
stopReason = reason;
+ this.debugStopReason = debugStopReason;
}
@Override
@@ -323,6 +334,7 @@ public class JobParameters implements Parcelable {
dest.writeInt(0);
}
dest.writeInt(stopReason);
+ dest.writeString(debugStopReason);
}
public static final Creator<JobParameters> CREATOR = new Creator<JobParameters>() {