Loading api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -6899,6 +6899,7 @@ package android.app.job { method public int getClipGrantFlags(); method public android.os.PersistableBundle getExtras(); method public int getJobId(); method public android.net.Network getNetwork(); method public android.os.Bundle getTransientExtras(); method public java.lang.String[] getTriggeredContentAuthorities(); method public android.net.Uri[] getTriggeredContentUris(); Loading Loading @@ -52074,7 +52075,6 @@ package android.widget { method public android.graphics.Typeface getTypeface(); method public android.text.style.URLSpan[] getUrls(); method public boolean hasSelection(); method public void invalidate(int, int, int, int); method public boolean isAllCaps(); method public boolean isCursorVisible(); method public boolean isElegantTextHeight(); api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -7341,6 +7341,7 @@ package android.app.job { method public int getClipGrantFlags(); method public android.os.PersistableBundle getExtras(); method public int getJobId(); method public android.net.Network getNetwork(); method public android.os.Bundle getTransientExtras(); method public java.lang.String[] getTriggeredContentAuthorities(); method public android.net.Uri[] getTriggeredContentUris(); Loading Loading @@ -56178,7 +56179,6 @@ package android.widget { method public android.graphics.Typeface getTypeface(); method public android.text.style.URLSpan[] getUrls(); method public boolean hasSelection(); method public void invalidate(int, int, int, int); method public boolean isAllCaps(); method public boolean isCursorVisible(); method public boolean isElegantTextHeight(); api/test-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -6970,6 +6970,7 @@ package android.app.job { method public int getClipGrantFlags(); method public android.os.PersistableBundle getExtras(); method public int getJobId(); method public android.net.Network getNetwork(); method public android.os.Bundle getTransientExtras(); method public java.lang.String[] getTriggeredContentAuthorities(); method public android.net.Uri[] getTriggeredContentUris(); Loading Loading @@ -52683,7 +52684,6 @@ package android.widget { method public android.graphics.Typeface getTypeface(); method public android.text.style.URLSpan[] getUrls(); method public boolean hasSelection(); method public void invalidate(int, int, int, int); method public boolean isAllCaps(); method public boolean isCursorVisible(); method public boolean isElegantTextHeight(); core/java/android/app/job/JobInfo.java +15 −6 Original line number Diff line number Diff line Loading @@ -909,12 +909,21 @@ public class JobInfo implements Parcelable { } /** * Set some description of the kind of network type your job needs to have. * Not calling this function means the network is not necessary, as the default is * {@link #NETWORK_TYPE_NONE}. * Bear in mind that calling this function defines network as a strict requirement for your * job. If the network requested is not available your job will never run. See * {@link #setOverrideDeadline(long)} to change this behaviour. * Set some description of the kind of network type your job needs to * have. Not calling this function means the network is not necessary, * as the default is {@link #NETWORK_TYPE_NONE}. Bear in mind that * calling this function defines network as a strict requirement for * your job. If the network requested is not available your job will * never run. See {@link #setOverrideDeadline(long)} to change this * behaviour. * <p class="note"> * Note: When your job executes in * {@link JobService#onStartJob(JobParameters)}, be sure to use the * specific network returned by {@link JobParameters#getNetwork()}, * otherwise you'll use the default network which may not meet this * constraint. * * @see JobParameters#getNetwork() */ public Builder setRequiredNetworkType(@NetworkType int networkType) { mNetworkType = networkType; Loading core/java/android/app/job/JobParameters.java +37 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.app.job.IJobCallback; import android.content.ClipData; import android.net.Network; import android.net.Uri; import android.os.Bundle; import android.os.IBinder; Loading Loading @@ -66,6 +67,7 @@ public class JobParameters implements Parcelable { private final boolean overrideDeadlineExpired; private final Uri[] mTriggeredContentUris; private final String[] mTriggeredContentAuthorities; private final Network network; private int stopReason; // Default value of stopReason is REASON_CANCELED Loading @@ -73,7 +75,7 @@ public class JobParameters implements Parcelable { public JobParameters(IBinder callback, int jobId, PersistableBundle extras, Bundle transientExtras, ClipData clipData, int clipGrantFlags, boolean overrideDeadlineExpired, Uri[] triggeredContentUris, String[] triggeredContentAuthorities) { String[] triggeredContentAuthorities, Network network) { this.jobId = jobId; this.extras = extras; this.transientExtras = transientExtras; Loading @@ -83,6 +85,7 @@ public class JobParameters implements Parcelable { this.overrideDeadlineExpired = overrideDeadlineExpired; this.mTriggeredContentUris = triggeredContentUris; this.mTriggeredContentAuthorities = triggeredContentAuthorities; this.network = network; } /** Loading Loading @@ -170,6 +173,28 @@ public class JobParameters implements Parcelable { return mTriggeredContentAuthorities; } /** * Return the network that should be used to perform any network requests * for this job. * <p> * Devices may have multiple active network connections simultaneously, or * they may not have a default network route at all. To correctly handle all * situations like this, your job should always use the network returned by * this method instead of implicitly using the default network route. * <p> * Note that the system may relax the constraints you originally requested, * such as allowing a {@link JobInfo#NETWORK_TYPE_UNMETERED} job to run over * a metered network when there is a surplus of metered data available. * * @return the network that should be used to perform any network requests * for this job, or {@code null} if this job didn't set any required * network type. * @see JobInfo.Builder#setRequiredNetworkType(int) */ public @Nullable Network getNetwork() { return network; } /** * Dequeue the next pending {@link JobWorkItem} from these JobParameters associated with their * currently running job. Calling this method when there is no more work available and all Loading Loading @@ -257,6 +282,11 @@ public class JobParameters implements Parcelable { overrideDeadlineExpired = in.readInt() == 1; mTriggeredContentUris = in.createTypedArray(Uri.CREATOR); mTriggeredContentAuthorities = in.createStringArray(); if (in.readInt() != 0) { network = Network.CREATOR.createFromParcel(in); } else { network = null; } stopReason = in.readInt(); } Loading Loading @@ -286,6 +316,12 @@ public class JobParameters implements Parcelable { dest.writeInt(overrideDeadlineExpired ? 1 : 0); dest.writeTypedArray(mTriggeredContentUris, flags); dest.writeStringArray(mTriggeredContentAuthorities); if (network != null) { dest.writeInt(1); network.writeToParcel(dest, flags); } else { dest.writeInt(0); } dest.writeInt(stopReason); } Loading Loading
api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -6899,6 +6899,7 @@ package android.app.job { method public int getClipGrantFlags(); method public android.os.PersistableBundle getExtras(); method public int getJobId(); method public android.net.Network getNetwork(); method public android.os.Bundle getTransientExtras(); method public java.lang.String[] getTriggeredContentAuthorities(); method public android.net.Uri[] getTriggeredContentUris(); Loading Loading @@ -52074,7 +52075,6 @@ package android.widget { method public android.graphics.Typeface getTypeface(); method public android.text.style.URLSpan[] getUrls(); method public boolean hasSelection(); method public void invalidate(int, int, int, int); method public boolean isAllCaps(); method public boolean isCursorVisible(); method public boolean isElegantTextHeight();
api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -7341,6 +7341,7 @@ package android.app.job { method public int getClipGrantFlags(); method public android.os.PersistableBundle getExtras(); method public int getJobId(); method public android.net.Network getNetwork(); method public android.os.Bundle getTransientExtras(); method public java.lang.String[] getTriggeredContentAuthorities(); method public android.net.Uri[] getTriggeredContentUris(); Loading Loading @@ -56178,7 +56179,6 @@ package android.widget { method public android.graphics.Typeface getTypeface(); method public android.text.style.URLSpan[] getUrls(); method public boolean hasSelection(); method public void invalidate(int, int, int, int); method public boolean isAllCaps(); method public boolean isCursorVisible(); method public boolean isElegantTextHeight();
api/test-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -6970,6 +6970,7 @@ package android.app.job { method public int getClipGrantFlags(); method public android.os.PersistableBundle getExtras(); method public int getJobId(); method public android.net.Network getNetwork(); method public android.os.Bundle getTransientExtras(); method public java.lang.String[] getTriggeredContentAuthorities(); method public android.net.Uri[] getTriggeredContentUris(); Loading Loading @@ -52683,7 +52684,6 @@ package android.widget { method public android.graphics.Typeface getTypeface(); method public android.text.style.URLSpan[] getUrls(); method public boolean hasSelection(); method public void invalidate(int, int, int, int); method public boolean isAllCaps(); method public boolean isCursorVisible(); method public boolean isElegantTextHeight();
core/java/android/app/job/JobInfo.java +15 −6 Original line number Diff line number Diff line Loading @@ -909,12 +909,21 @@ public class JobInfo implements Parcelable { } /** * Set some description of the kind of network type your job needs to have. * Not calling this function means the network is not necessary, as the default is * {@link #NETWORK_TYPE_NONE}. * Bear in mind that calling this function defines network as a strict requirement for your * job. If the network requested is not available your job will never run. See * {@link #setOverrideDeadline(long)} to change this behaviour. * Set some description of the kind of network type your job needs to * have. Not calling this function means the network is not necessary, * as the default is {@link #NETWORK_TYPE_NONE}. Bear in mind that * calling this function defines network as a strict requirement for * your job. If the network requested is not available your job will * never run. See {@link #setOverrideDeadline(long)} to change this * behaviour. * <p class="note"> * Note: When your job executes in * {@link JobService#onStartJob(JobParameters)}, be sure to use the * specific network returned by {@link JobParameters#getNetwork()}, * otherwise you'll use the default network which may not meet this * constraint. * * @see JobParameters#getNetwork() */ public Builder setRequiredNetworkType(@NetworkType int networkType) { mNetworkType = networkType; Loading
core/java/android/app/job/JobParameters.java +37 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.app.job.IJobCallback; import android.content.ClipData; import android.net.Network; import android.net.Uri; import android.os.Bundle; import android.os.IBinder; Loading Loading @@ -66,6 +67,7 @@ public class JobParameters implements Parcelable { private final boolean overrideDeadlineExpired; private final Uri[] mTriggeredContentUris; private final String[] mTriggeredContentAuthorities; private final Network network; private int stopReason; // Default value of stopReason is REASON_CANCELED Loading @@ -73,7 +75,7 @@ public class JobParameters implements Parcelable { public JobParameters(IBinder callback, int jobId, PersistableBundle extras, Bundle transientExtras, ClipData clipData, int clipGrantFlags, boolean overrideDeadlineExpired, Uri[] triggeredContentUris, String[] triggeredContentAuthorities) { String[] triggeredContentAuthorities, Network network) { this.jobId = jobId; this.extras = extras; this.transientExtras = transientExtras; Loading @@ -83,6 +85,7 @@ public class JobParameters implements Parcelable { this.overrideDeadlineExpired = overrideDeadlineExpired; this.mTriggeredContentUris = triggeredContentUris; this.mTriggeredContentAuthorities = triggeredContentAuthorities; this.network = network; } /** Loading Loading @@ -170,6 +173,28 @@ public class JobParameters implements Parcelable { return mTriggeredContentAuthorities; } /** * Return the network that should be used to perform any network requests * for this job. * <p> * Devices may have multiple active network connections simultaneously, or * they may not have a default network route at all. To correctly handle all * situations like this, your job should always use the network returned by * this method instead of implicitly using the default network route. * <p> * Note that the system may relax the constraints you originally requested, * such as allowing a {@link JobInfo#NETWORK_TYPE_UNMETERED} job to run over * a metered network when there is a surplus of metered data available. * * @return the network that should be used to perform any network requests * for this job, or {@code null} if this job didn't set any required * network type. * @see JobInfo.Builder#setRequiredNetworkType(int) */ public @Nullable Network getNetwork() { return network; } /** * Dequeue the next pending {@link JobWorkItem} from these JobParameters associated with their * currently running job. Calling this method when there is no more work available and all Loading Loading @@ -257,6 +282,11 @@ public class JobParameters implements Parcelable { overrideDeadlineExpired = in.readInt() == 1; mTriggeredContentUris = in.createTypedArray(Uri.CREATOR); mTriggeredContentAuthorities = in.createStringArray(); if (in.readInt() != 0) { network = Network.CREATOR.createFromParcel(in); } else { network = null; } stopReason = in.readInt(); } Loading Loading @@ -286,6 +316,12 @@ public class JobParameters implements Parcelable { dest.writeInt(overrideDeadlineExpired ? 1 : 0); dest.writeTypedArray(mTriggeredContentUris, flags); dest.writeStringArray(mTriggeredContentAuthorities); if (network != null) { dest.writeInt(1); network.writeToParcel(dest, flags); } else { dest.writeInt(0); } dest.writeInt(stopReason); } Loading