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

Commit aef0695d authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12616459 from 8230bd71 to 25Q1-release

Change-Id: I2f95b8a1e8b645953087323c6911c31dcc73d5d0
parents 85b130fd 8230bd71
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -348,6 +348,7 @@ java_aconfig_library {
aconfig_declarations {
    name: "android.security.flags-aconfig",
    package: "android.security",
    exportable: true,
    container: "system",
    srcs: ["core/java/android/security/*.aconfig"],
}
@@ -365,6 +366,13 @@ java_aconfig_library {
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}

java_aconfig_library {
    name: "android.security.flags-aconfig-java-export",
    aconfig_declarations: "android.security.flags-aconfig",
    mode: "exported",
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}

cc_aconfig_library {
    name: "android_security_flags_aconfig_c_lib",
    aconfig_declarations: "android.security.flags-aconfig",
+8 −0
Original line number Diff line number Diff line
@@ -45,3 +45,11 @@ flag {
    description: "Introduce a new getPendingJobReasons() API which returns reasons why a job may not have executed. Also deprecate the existing getPendingJobReason() API."
    bug: "372031023"
}

flag {
    name: "get_pending_job_reasons_history_api"
    is_exported: true
    namespace: "backstage_power"
    description: "Introduce a new getPendingJobReasonsHistory() API which returns a limited historical view of getPendingJobReasons()."
    bug: "372031023"
}
+10 −0
Original line number Diff line number Diff line
@@ -172,6 +172,16 @@ public class JobSchedulerImpl extends JobScheduler {
        }
    }

    @Override
    @NonNull
    public int[] getPendingJobReasons(int jobId) {
        try {
            return mBinder.getPendingJobReasons(mNamespace, jobId);
        } catch (RemoteException e) {
            return new int[] { PENDING_JOB_REASON_UNDEFINED };
        }
    }

    @Override
    public boolean canRunUserInitiatedJobs() {
        try {
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ interface IJobScheduler {
    ParceledListSlice<JobInfo> getAllPendingJobsInNamespace(String namespace);
    JobInfo getPendingJob(String namespace, int jobId);
    int getPendingJobReason(String namespace, int jobId);
    int[] getPendingJobReasons(String namespace, int jobId);
    boolean canRunUserInitiatedJobs(String packageName);
    boolean hasRunUserInitiatedJobsPermission(String packageName, int userId);
    List<JobInfo> getStartedJobs();
+28 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.app.job;

import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -238,6 +239,13 @@ public abstract class JobScheduler {
     * to defer this job.
     */
    public static final int PENDING_JOB_REASON_USER = 15;
    /**
     * The override deadline has not transpired.
     *
     * @see JobInfo.Builder#setOverrideDeadline(long)
     */
    @FlaggedApi(Flags.FLAG_GET_PENDING_JOB_REASONS_API)
    public static final int PENDING_JOB_REASON_CONSTRAINT_DEADLINE = 16;

    /** @hide */
    @IntDef(prefix = {"PENDING_JOB_REASON_"}, value = {
@@ -259,6 +267,7 @@ public abstract class JobScheduler {
            PENDING_JOB_REASON_JOB_SCHEDULER_OPTIMIZATION,
            PENDING_JOB_REASON_QUOTA,
            PENDING_JOB_REASON_USER,
            PENDING_JOB_REASON_CONSTRAINT_DEADLINE,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface PendingJobReason {
@@ -458,12 +467,31 @@ public abstract class JobScheduler {
    /**
     * Returns a reason why the job is pending and not currently executing. If there are multiple
     * reasons why a job may be pending, this will only return one of them.
     *
     * @apiNote
     * To know all the potential reasons why the job may be pending,
     * use {@link #getPendingJobReasons(int)} instead.
     */
    @PendingJobReason
    public int getPendingJobReason(int jobId) {
        return PENDING_JOB_REASON_UNDEFINED;
    }

    /**
     * Returns potential reasons why the job with the given {@code jobId} may be pending
     * and not currently executing.
     *
     * The returned array will include {@link PendingJobReason reasons} composed of both
     * explicitly set constraints on the job and implicit constraints imposed by the system.
     * The results can be used to debug why a given job may not be currently executing.
     */
    @FlaggedApi(Flags.FLAG_GET_PENDING_JOB_REASONS_API)
    @NonNull
    @PendingJobReason
    public int[] getPendingJobReasons(int jobId) {
        return new int[] { PENDING_JOB_REASON_UNDEFINED };
    }

    /**
     * Returns {@code true} if the calling app currently holds the
     * {@link android.Manifest.permission#RUN_USER_INITIATED_JOBS} permission, allowing it to run
Loading