Loading api/current.txt +9 −5 Original line number Diff line number Diff line Loading @@ -7041,7 +7041,8 @@ package android.app.job { method public int getBackoffPolicy(); method public android.content.ClipData getClipData(); method public int getClipGrantFlags(); method public long getEstimatedNetworkBytes(); method public long getEstimatedNetworkDownloadBytes(); method public long getEstimatedNetworkUploadBytes(); method public android.os.PersistableBundle getExtras(); method public long getFlexMillis(); method public int getId(); Loading @@ -7058,8 +7059,10 @@ package android.app.job { method public long getTriggerContentMaxDelay(); method public long getTriggerContentUpdateDelay(); method public android.app.job.JobInfo.TriggerContentUri[] getTriggerContentUris(); method public boolean isImportantWhileForeground(); method public boolean isPeriodic(); method public boolean isPersisted(); method public boolean isPrefetch(); method public boolean isRequireBatteryNotLow(); method public boolean isRequireCharging(); method public boolean isRequireDeviceIdle(); Loading @@ -7085,15 +7088,15 @@ package android.app.job { method public android.app.job.JobInfo build(); method public android.app.job.JobInfo.Builder setBackoffCriteria(long, int); method public android.app.job.JobInfo.Builder setClipData(android.content.ClipData, int); method public android.app.job.JobInfo.Builder setEstimatedNetworkBytes(long); method public android.app.job.JobInfo.Builder setEstimatedNetworkBytes(long, long); method public android.app.job.JobInfo.Builder setExtras(android.os.PersistableBundle); method public android.app.job.JobInfo.Builder setImportantWhileForeground(boolean); method public android.app.job.JobInfo.Builder setIsPrefetch(boolean); method public android.app.job.JobInfo.Builder setMinimumLatency(long); method public android.app.job.JobInfo.Builder setOverrideDeadline(long); method public android.app.job.JobInfo.Builder setPeriodic(long); method public android.app.job.JobInfo.Builder setPeriodic(long, long); method public android.app.job.JobInfo.Builder setPersisted(boolean); method public android.app.job.JobInfo.Builder setPrefetch(boolean); method public android.app.job.JobInfo.Builder setRequiredNetwork(android.net.NetworkRequest); method public android.app.job.JobInfo.Builder setRequiredNetworkType(int); method public android.app.job.JobInfo.Builder setRequiresBatteryNotLow(boolean); Loading Loading @@ -7163,10 +7166,11 @@ package android.app.job { public final class JobWorkItem implements android.os.Parcelable { ctor public JobWorkItem(android.content.Intent); ctor public JobWorkItem(android.content.Intent, long); ctor public JobWorkItem(android.content.Intent, long, long); method public int describeContents(); method public int getDeliveryCount(); method public long getEstimatedNetworkBytes(); method public long getEstimatedNetworkDownloadBytes(); method public long getEstimatedNetworkUploadBytes(); method public android.content.Intent getIntent(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.app.job.JobWorkItem> CREATOR; api/removed.txt +18 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,24 @@ package android.app.admin { } package android.app.job { public class JobInfo implements android.os.Parcelable { method public deprecated long getEstimatedNetworkBytes(); } public static final class JobInfo.Builder { method public deprecated android.app.job.JobInfo.Builder setEstimatedNetworkBytes(long); method public deprecated android.app.job.JobInfo.Builder setIsPrefetch(boolean); } public final class JobWorkItem implements android.os.Parcelable { ctor public deprecated JobWorkItem(android.content.Intent, long); method public deprecated long getEstimatedNetworkBytes(); } } package android.app.usage { public final class StorageStats implements android.os.Parcelable { Loading core/java/android/app/job/JobInfo.java +153 −47 File changed.Preview size limit exceeded, changes collapsed. Show changes core/java/android/app/job/JobWorkItem.java +71 −18 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.app.job; import static android.app.job.JobInfo.NETWORK_BYTES_UNKNOWN; import android.annotation.BytesLong; import android.content.Intent; import android.os.Parcel; Loading @@ -28,7 +30,8 @@ import android.os.Parcelable; */ final public class JobWorkItem implements Parcelable { final Intent mIntent; final long mNetworkBytes; final long mNetworkDownloadBytes; final long mNetworkUploadBytes; int mDeliveryCount; int mWorkId; Object mGrants; Loading @@ -41,22 +44,36 @@ final public class JobWorkItem implements Parcelable { */ public JobWorkItem(Intent intent) { mIntent = intent; mNetworkBytes = JobInfo.NETWORK_BYTES_UNKNOWN; mNetworkDownloadBytes = NETWORK_BYTES_UNKNOWN; mNetworkUploadBytes = NETWORK_BYTES_UNKNOWN; } /** * @deprecated replaced by {@link #JobWorkItem(Intent, long, long)} * @removed */ @Deprecated public JobWorkItem(Intent intent, @BytesLong long networkBytes) { this(intent, networkBytes, NETWORK_BYTES_UNKNOWN); } /** * Create a new piece of work, which can be submitted to * {@link JobScheduler#enqueue JobScheduler.enqueue}. * <p> * See {@link JobInfo.Builder#setEstimatedNetworkBytes(long, long)} for * details about how to estimate network traffic. * * @param intent The general Intent describing this work. * @param networkBytes The estimated size of network traffic that will be * performed by this job work item, in bytes. See * {@link JobInfo.Builder#setEstimatedNetworkBytes(long)} for * details about how to estimate. * @param downloadBytes The estimated size of network traffic that will be * downloaded by this job work item, in bytes. * @param uploadBytes The estimated size of network traffic that will be * uploaded by this job work item, in bytes. */ public JobWorkItem(Intent intent, @BytesLong long networkBytes) { public JobWorkItem(Intent intent, @BytesLong long downloadBytes, @BytesLong long uploadBytes) { mIntent = intent; mNetworkBytes = networkBytes; mNetworkDownloadBytes = downloadBytes; mNetworkUploadBytes = uploadBytes; } /** Loading @@ -67,14 +84,44 @@ final public class JobWorkItem implements Parcelable { } /** * Return the estimated size of network traffic that will be performed by * @deprecated replaced by {@link #getEstimatedNetworkDownloadBytes()} and * {@link #getEstimatedNetworkUploadBytes()}. * @removed */ @Deprecated public @BytesLong long getEstimatedNetworkBytes() { if (mNetworkDownloadBytes == NETWORK_BYTES_UNKNOWN && mNetworkUploadBytes == NETWORK_BYTES_UNKNOWN) { return NETWORK_BYTES_UNKNOWN; } else if (mNetworkDownloadBytes == NETWORK_BYTES_UNKNOWN) { return mNetworkUploadBytes; } else if (mNetworkUploadBytes == NETWORK_BYTES_UNKNOWN) { return mNetworkDownloadBytes; } else { return mNetworkDownloadBytes + mNetworkUploadBytes; } } /** * Return the estimated size of download traffic that will be performed by * this job, in bytes. * * @return Estimated size of download traffic, or * {@link JobInfo#NETWORK_BYTES_UNKNOWN} when unknown. */ public @BytesLong long getEstimatedNetworkDownloadBytes() { return mNetworkDownloadBytes; } /** * Return the estimated size of upload traffic that will be performed by * this job work item, in bytes. * * @return estimated size, or {@link JobInfo#NETWORK_BYTES_UNKNOWN} when * unknown. * @return Estimated size of upload traffic, or * {@link JobInfo#NETWORK_BYTES_UNKNOWN} when unknown. */ public @BytesLong long getEstimatedNetworkBytes() { return mNetworkBytes; public @BytesLong long getEstimatedNetworkUploadBytes() { return mNetworkUploadBytes; } /** Loading Loading @@ -128,9 +175,13 @@ final public class JobWorkItem implements Parcelable { sb.append(mWorkId); sb.append(" intent="); sb.append(mIntent); if (mNetworkBytes != JobInfo.NETWORK_BYTES_UNKNOWN) { sb.append(" networkBytes="); sb.append(mNetworkBytes); if (mNetworkDownloadBytes != NETWORK_BYTES_UNKNOWN) { sb.append(" downloadBytes="); sb.append(mNetworkDownloadBytes); } if (mNetworkUploadBytes != NETWORK_BYTES_UNKNOWN) { sb.append(" uploadBytes="); sb.append(mNetworkUploadBytes); } if (mDeliveryCount != 0) { sb.append(" dcount="); Loading @@ -151,7 +202,8 @@ final public class JobWorkItem implements Parcelable { } else { out.writeInt(0); } out.writeLong(mNetworkBytes); out.writeLong(mNetworkDownloadBytes); out.writeLong(mNetworkUploadBytes); out.writeInt(mDeliveryCount); out.writeInt(mWorkId); } Loading @@ -173,7 +225,8 @@ final public class JobWorkItem implements Parcelable { } else { mIntent = null; } mNetworkBytes = in.readLong(); mNetworkDownloadBytes = in.readLong(); mNetworkUploadBytes = in.readLong(); mDeliveryCount = in.readInt(); mWorkId = in.readInt(); } Loading services/core/java/com/android/server/job/controllers/ConnectivityController.java +1 −1 Original line number Diff line number Diff line Loading @@ -160,7 +160,7 @@ public final class ConnectivityController extends StateController implements private static boolean isRelaxedSatisfied(JobStatus jobStatus, Network network, NetworkCapabilities capabilities, Constants constants) { // Only consider doing this for prefetching jobs if ((jobStatus.getJob().getFlags() & JobInfo.FLAG_IS_PREFETCH) == 0) { if (!jobStatus.getJob().isPrefetch()) { return false; } Loading Loading
api/current.txt +9 −5 Original line number Diff line number Diff line Loading @@ -7041,7 +7041,8 @@ package android.app.job { method public int getBackoffPolicy(); method public android.content.ClipData getClipData(); method public int getClipGrantFlags(); method public long getEstimatedNetworkBytes(); method public long getEstimatedNetworkDownloadBytes(); method public long getEstimatedNetworkUploadBytes(); method public android.os.PersistableBundle getExtras(); method public long getFlexMillis(); method public int getId(); Loading @@ -7058,8 +7059,10 @@ package android.app.job { method public long getTriggerContentMaxDelay(); method public long getTriggerContentUpdateDelay(); method public android.app.job.JobInfo.TriggerContentUri[] getTriggerContentUris(); method public boolean isImportantWhileForeground(); method public boolean isPeriodic(); method public boolean isPersisted(); method public boolean isPrefetch(); method public boolean isRequireBatteryNotLow(); method public boolean isRequireCharging(); method public boolean isRequireDeviceIdle(); Loading @@ -7085,15 +7088,15 @@ package android.app.job { method public android.app.job.JobInfo build(); method public android.app.job.JobInfo.Builder setBackoffCriteria(long, int); method public android.app.job.JobInfo.Builder setClipData(android.content.ClipData, int); method public android.app.job.JobInfo.Builder setEstimatedNetworkBytes(long); method public android.app.job.JobInfo.Builder setEstimatedNetworkBytes(long, long); method public android.app.job.JobInfo.Builder setExtras(android.os.PersistableBundle); method public android.app.job.JobInfo.Builder setImportantWhileForeground(boolean); method public android.app.job.JobInfo.Builder setIsPrefetch(boolean); method public android.app.job.JobInfo.Builder setMinimumLatency(long); method public android.app.job.JobInfo.Builder setOverrideDeadline(long); method public android.app.job.JobInfo.Builder setPeriodic(long); method public android.app.job.JobInfo.Builder setPeriodic(long, long); method public android.app.job.JobInfo.Builder setPersisted(boolean); method public android.app.job.JobInfo.Builder setPrefetch(boolean); method public android.app.job.JobInfo.Builder setRequiredNetwork(android.net.NetworkRequest); method public android.app.job.JobInfo.Builder setRequiredNetworkType(int); method public android.app.job.JobInfo.Builder setRequiresBatteryNotLow(boolean); Loading Loading @@ -7163,10 +7166,11 @@ package android.app.job { public final class JobWorkItem implements android.os.Parcelable { ctor public JobWorkItem(android.content.Intent); ctor public JobWorkItem(android.content.Intent, long); ctor public JobWorkItem(android.content.Intent, long, long); method public int describeContents(); method public int getDeliveryCount(); method public long getEstimatedNetworkBytes(); method public long getEstimatedNetworkDownloadBytes(); method public long getEstimatedNetworkUploadBytes(); method public android.content.Intent getIntent(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.app.job.JobWorkItem> CREATOR;
api/removed.txt +18 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,24 @@ package android.app.admin { } package android.app.job { public class JobInfo implements android.os.Parcelable { method public deprecated long getEstimatedNetworkBytes(); } public static final class JobInfo.Builder { method public deprecated android.app.job.JobInfo.Builder setEstimatedNetworkBytes(long); method public deprecated android.app.job.JobInfo.Builder setIsPrefetch(boolean); } public final class JobWorkItem implements android.os.Parcelable { ctor public deprecated JobWorkItem(android.content.Intent, long); method public deprecated long getEstimatedNetworkBytes(); } } package android.app.usage { public final class StorageStats implements android.os.Parcelable { Loading
core/java/android/app/job/JobInfo.java +153 −47 File changed.Preview size limit exceeded, changes collapsed. Show changes
core/java/android/app/job/JobWorkItem.java +71 −18 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.app.job; import static android.app.job.JobInfo.NETWORK_BYTES_UNKNOWN; import android.annotation.BytesLong; import android.content.Intent; import android.os.Parcel; Loading @@ -28,7 +30,8 @@ import android.os.Parcelable; */ final public class JobWorkItem implements Parcelable { final Intent mIntent; final long mNetworkBytes; final long mNetworkDownloadBytes; final long mNetworkUploadBytes; int mDeliveryCount; int mWorkId; Object mGrants; Loading @@ -41,22 +44,36 @@ final public class JobWorkItem implements Parcelable { */ public JobWorkItem(Intent intent) { mIntent = intent; mNetworkBytes = JobInfo.NETWORK_BYTES_UNKNOWN; mNetworkDownloadBytes = NETWORK_BYTES_UNKNOWN; mNetworkUploadBytes = NETWORK_BYTES_UNKNOWN; } /** * @deprecated replaced by {@link #JobWorkItem(Intent, long, long)} * @removed */ @Deprecated public JobWorkItem(Intent intent, @BytesLong long networkBytes) { this(intent, networkBytes, NETWORK_BYTES_UNKNOWN); } /** * Create a new piece of work, which can be submitted to * {@link JobScheduler#enqueue JobScheduler.enqueue}. * <p> * See {@link JobInfo.Builder#setEstimatedNetworkBytes(long, long)} for * details about how to estimate network traffic. * * @param intent The general Intent describing this work. * @param networkBytes The estimated size of network traffic that will be * performed by this job work item, in bytes. See * {@link JobInfo.Builder#setEstimatedNetworkBytes(long)} for * details about how to estimate. * @param downloadBytes The estimated size of network traffic that will be * downloaded by this job work item, in bytes. * @param uploadBytes The estimated size of network traffic that will be * uploaded by this job work item, in bytes. */ public JobWorkItem(Intent intent, @BytesLong long networkBytes) { public JobWorkItem(Intent intent, @BytesLong long downloadBytes, @BytesLong long uploadBytes) { mIntent = intent; mNetworkBytes = networkBytes; mNetworkDownloadBytes = downloadBytes; mNetworkUploadBytes = uploadBytes; } /** Loading @@ -67,14 +84,44 @@ final public class JobWorkItem implements Parcelable { } /** * Return the estimated size of network traffic that will be performed by * @deprecated replaced by {@link #getEstimatedNetworkDownloadBytes()} and * {@link #getEstimatedNetworkUploadBytes()}. * @removed */ @Deprecated public @BytesLong long getEstimatedNetworkBytes() { if (mNetworkDownloadBytes == NETWORK_BYTES_UNKNOWN && mNetworkUploadBytes == NETWORK_BYTES_UNKNOWN) { return NETWORK_BYTES_UNKNOWN; } else if (mNetworkDownloadBytes == NETWORK_BYTES_UNKNOWN) { return mNetworkUploadBytes; } else if (mNetworkUploadBytes == NETWORK_BYTES_UNKNOWN) { return mNetworkDownloadBytes; } else { return mNetworkDownloadBytes + mNetworkUploadBytes; } } /** * Return the estimated size of download traffic that will be performed by * this job, in bytes. * * @return Estimated size of download traffic, or * {@link JobInfo#NETWORK_BYTES_UNKNOWN} when unknown. */ public @BytesLong long getEstimatedNetworkDownloadBytes() { return mNetworkDownloadBytes; } /** * Return the estimated size of upload traffic that will be performed by * this job work item, in bytes. * * @return estimated size, or {@link JobInfo#NETWORK_BYTES_UNKNOWN} when * unknown. * @return Estimated size of upload traffic, or * {@link JobInfo#NETWORK_BYTES_UNKNOWN} when unknown. */ public @BytesLong long getEstimatedNetworkBytes() { return mNetworkBytes; public @BytesLong long getEstimatedNetworkUploadBytes() { return mNetworkUploadBytes; } /** Loading Loading @@ -128,9 +175,13 @@ final public class JobWorkItem implements Parcelable { sb.append(mWorkId); sb.append(" intent="); sb.append(mIntent); if (mNetworkBytes != JobInfo.NETWORK_BYTES_UNKNOWN) { sb.append(" networkBytes="); sb.append(mNetworkBytes); if (mNetworkDownloadBytes != NETWORK_BYTES_UNKNOWN) { sb.append(" downloadBytes="); sb.append(mNetworkDownloadBytes); } if (mNetworkUploadBytes != NETWORK_BYTES_UNKNOWN) { sb.append(" uploadBytes="); sb.append(mNetworkUploadBytes); } if (mDeliveryCount != 0) { sb.append(" dcount="); Loading @@ -151,7 +202,8 @@ final public class JobWorkItem implements Parcelable { } else { out.writeInt(0); } out.writeLong(mNetworkBytes); out.writeLong(mNetworkDownloadBytes); out.writeLong(mNetworkUploadBytes); out.writeInt(mDeliveryCount); out.writeInt(mWorkId); } Loading @@ -173,7 +225,8 @@ final public class JobWorkItem implements Parcelable { } else { mIntent = null; } mNetworkBytes = in.readLong(); mNetworkDownloadBytes = in.readLong(); mNetworkUploadBytes = in.readLong(); mDeliveryCount = in.readInt(); mWorkId = in.readInt(); } Loading
services/core/java/com/android/server/job/controllers/ConnectivityController.java +1 −1 Original line number Diff line number Diff line Loading @@ -160,7 +160,7 @@ public final class ConnectivityController extends StateController implements private static boolean isRelaxedSatisfied(JobStatus jobStatus, Network network, NetworkCapabilities capabilities, Constants constants) { // Only consider doing this for prefetching jobs if ((jobStatus.getJob().getFlags() & JobInfo.FLAG_IS_PREFETCH) == 0) { if (!jobStatus.getJob().isPrefetch()) { return false; } Loading