Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb14a187 authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Move getCategory() API into JobInfo from JobInfo.Builder.

Getter should be on the built object, not the builder.

Bug: 419047126
Test: n/a
API-Coverage-Bug: 414390253
Flag: android.app.job.job_category_apis
Change-Id: Ie52efba7fad7db54f7defbed8e908714c0d39860
parent a781c5a7
Loading
Loading
Loading
Loading
+15 −14
Original line number Diff line number Diff line
@@ -826,6 +826,21 @@ public class JobInfo implements Parcelable {
        return mTraceTag;
    }

    /**
     * Gets the category of this job, which was previously defined using
     * {@link JobInfo.Builder#setCategory(int)}. If no category has been set, then
     * {@link JobInfo#CATEGORY_UNKNOWN} will be returned.
     *
     * @return The category of this job, or {@link JobInfo#CATEGORY_UNKNOWN} if no category has
     *         been set using {@link JobInfo.Builder#setCategory(int)}.
     * @see JobInfo.Builder#setCategory(int)
     */
    @FlaggedApi(Flags.FLAG_JOB_CATEGORY_APIS)
    @Category
    public int getCategory() {
        return JobInfo.CATEGORY_UNKNOWN;
    }

    /**
     * @see JobInfo.Builder#setExpedited(boolean)
     */
@@ -2287,20 +2302,6 @@ public class JobInfo implements Parcelable {
            return this;
        }

        /**
         * Gets the category of this job, which was previously defined using
         * {@link #setCategory(int)}. If no category has been set, then
         * {@link JobInfo#CATEGORY_UNKNOWN} will be returned.
         *
         * @return The category of this job, or {@link JobInfo#CATEGORY_UNKNOWN} if no category
         *         has been set using {@link #setCategory(int)}.
         */
        @FlaggedApi(Flags.FLAG_JOB_CATEGORY_APIS)
        @Category
        public int getCategory() {
            return JobInfo.CATEGORY_UNKNOWN;
        }

        /**
         * @return The job object to hand to the JobScheduler. This object is immutable.
         */
+1 −1
Original line number Diff line number Diff line
@@ -9459,6 +9459,7 @@ package android.app.job {
  public class JobInfo implements android.os.Parcelable {
    method public int describeContents();
    method public int getBackoffPolicy();
    method @FlaggedApi("android.app.job.job_category_apis") public int getCategory();
    method @Nullable public android.content.ClipData getClipData();
    method public int getClipGrantFlags();
    method @FlaggedApi("android.app.job.job_debug_info_apis") @NonNull public java.util.Set<java.lang.String> getDebugTags();
@@ -9520,7 +9521,6 @@ package android.app.job {
    method @FlaggedApi("android.app.job.job_debug_info_apis") @NonNull public android.app.job.JobInfo.Builder addDebugTag(@NonNull String);
    method public android.app.job.JobInfo.Builder addTriggerContentUri(@NonNull android.app.job.JobInfo.TriggerContentUri);
    method public android.app.job.JobInfo build();
    method @FlaggedApi("android.app.job.job_category_apis") public int getCategory();
    method @FlaggedApi("android.app.job.job_debug_info_apis") @NonNull public android.app.job.JobInfo.Builder removeDebugTag(@NonNull String);
    method public android.app.job.JobInfo.Builder setBackoffCriteria(long, int);
    method @FlaggedApi("android.app.job.job_category_apis") @NonNull public android.app.job.JobInfo.Builder setCategory(int);