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

Commit 6ebaa2f0 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7302914 from 19fb7324 to sc-release

Change-Id: I7baecb5e92a9de348780c0ec40775292f9140676
parents 3aa258d5 19fb7324
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -375,7 +375,6 @@ java_library {
    static_libs: [
        "app-compat-annotations",
        "framework-minus-apex",
        "framework-connectivity.impl", // TODO(b/182859030): should be removed
        "framework-appsearch.impl", // TODO(b/146218515): should be removed
        "framework-updatable-stubs-module_libs_api",
    ],
+16 −14
Original line number Diff line number Diff line
{
  "presubmit": [
  "presubmit-large": [
    {
      "name": "FrameworksUiServicesTests",
      "name": "FrameworksServicesTests",
      "options": [
        {
          "include-annotation": "android.platform.test.annotations.Presubmit"
        },
        {
          "exclude-annotation": "androidx.test.filters.FlakyTest"
        },
        {
          "exclude-annotation": "org.junit.Ignore"
        }
      ]
    },
    }
  ],
  "presubmit": [
    {
      "name": "ExtServicesUnitTests",
      "name": "FrameworksUiServicesTests",
      "options": [
        {
          "exclude-annotation": "androidx.test.filters.FlakyTest"
@@ -17,7 +25,7 @@
      ]
    },
    {
      "name": "TestablesTests",
      "name": "ExtServicesUnitTests",
      "options": [
        {
          "exclude-annotation": "androidx.test.filters.FlakyTest"
@@ -25,21 +33,15 @@
      ]
    },
    {
      "name": "FrameworksCoreTests",
      "name": "TestablesTests",
      "options": [
        {
          "include-annotation": "android.platform.test.annotations.Presubmit"
        },
        {
          "exclude-annotation": "androidx.test.filters.FlakyTest"
        },
        {
          "exclude-annotation": "org.junit.Ignore"
        }
      ]
    },
    {
      "name": "FrameworkPermissionTests",
      "name": "FrameworksCoreTests",
      "options": [
        {
          "include-annotation": "android.platform.test.annotations.Presubmit"
@@ -53,7 +55,7 @@
      ]
    },
    {
      "name": "FrameworksServicesTests",
      "name": "FrameworkPermissionTests",
      "options": [
        {
          "include-annotation": "android.platform.test.annotations.Presubmit"
+8 −0
Original line number Diff line number Diff line
@@ -185,6 +185,11 @@ public class PowerExemptionManager {
    public static final int REASON_OP_ACTIVATE_VPN = 68;
    /** @hide */
    public static final int REASON_OP_ACTIVATE_PLATFORM_VPN = 69;
    /**
     * Temporarily allowed to have FGS while-in-use permissions.
     * @hide
     */
    public static final int REASON_TEMP_ALLOWED_WHILE_IN_USE = 70;

    /* BG-FGS-launch is allowed by temp-allow-list or system-allow-list.
       Reason code for temp and system allow list starts here.
@@ -348,6 +353,7 @@ public class PowerExemptionManager {
            REASON_ACTIVITY_VISIBILITY_GRACE_PERIOD,
            REASON_OP_ACTIVATE_VPN,
            REASON_OP_ACTIVATE_PLATFORM_VPN,
            REASON_TEMP_ALLOWED_WHILE_IN_USE,
            // temp and system allow list reasons.
            REASON_GEOFENCING,
            REASON_PUSH_MESSAGING,
@@ -609,6 +615,8 @@ public class PowerExemptionManager {
                return "OP_ACTIVATE_VPN";
            case REASON_OP_ACTIVATE_PLATFORM_VPN:
                return "OP_ACTIVATE_PLATFORM_VPN";
            case REASON_TEMP_ALLOWED_WHILE_IN_USE:
                return "TEMP_ALLOWED_WHILE_IN_USE";
            case REASON_GEOFENCING:
                return "GEOFENCING";
            case REASON_PUSH_MESSAGING:
+13 −8
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ class JobConcurrencyManager {
            new WorkConfigLimitsPerMemoryTrimLevel(
                    new WorkTypeConfig("screen_on_normal", 11,
                            // defaultMin
                            List.of(Pair.create(WORK_TYPE_TOP, 2), Pair.create(WORK_TYPE_FGS, 1),
                            List.of(Pair.create(WORK_TYPE_TOP, 4), Pair.create(WORK_TYPE_FGS, 1),
                                    Pair.create(WORK_TYPE_EJ, 3), Pair.create(WORK_TYPE_BG, 2),
                                    Pair.create(WORK_TYPE_BGUSER_IMPORTANT, 1)),
                            // defaultMax
@@ -202,7 +202,7 @@ class JobConcurrencyManager {
                            List.of(Pair.create(WORK_TYPE_TOP, 4), Pair.create(WORK_TYPE_FGS, 1),
                                    Pair.create(WORK_TYPE_EJ, 1)),
                            // defaultMax
                            List.of(Pair.create(WORK_TYPE_BG, 1),
                            List.of(Pair.create(WORK_TYPE_BG, 2),
                                    Pair.create(WORK_TYPE_BGUSER_IMPORTANT, 1),
                                    Pair.create(WORK_TYPE_BGUSER, 1))
                    ),
@@ -218,23 +218,23 @@ class JobConcurrencyManager {
            );
    private static final WorkConfigLimitsPerMemoryTrimLevel CONFIG_LIMITS_SCREEN_OFF =
            new WorkConfigLimitsPerMemoryTrimLevel(
                    new WorkTypeConfig("screen_off_normal", 15,
                    new WorkTypeConfig("screen_off_normal", 16,
                            // defaultMin
                            List.of(Pair.create(WORK_TYPE_TOP, 4), Pair.create(WORK_TYPE_FGS, 2),
                                    Pair.create(WORK_TYPE_EJ, 3), Pair.create(WORK_TYPE_BG, 2),
                                    Pair.create(WORK_TYPE_BGUSER_IMPORTANT, 1)),
                            // defaultMax
                            List.of(Pair.create(WORK_TYPE_BG, 6),
                            List.of(Pair.create(WORK_TYPE_BG, 10),
                                    Pair.create(WORK_TYPE_BGUSER_IMPORTANT, 2),
                                    Pair.create(WORK_TYPE_BGUSER, 3))
                    ),
                    new WorkTypeConfig("screen_off_moderate", 15,
                    new WorkTypeConfig("screen_off_moderate", 14,
                            // defaultMin
                            List.of(Pair.create(WORK_TYPE_TOP, 6), Pair.create(WORK_TYPE_FGS, 2),
                            List.of(Pair.create(WORK_TYPE_TOP, 4), Pair.create(WORK_TYPE_FGS, 2),
                                    Pair.create(WORK_TYPE_EJ, 3), Pair.create(WORK_TYPE_BG, 2),
                                    Pair.create(WORK_TYPE_BGUSER_IMPORTANT, 1)),
                            // defaultMax
                            List.of(Pair.create(WORK_TYPE_BG, 4),
                            List.of(Pair.create(WORK_TYPE_BG, 7),
                                    Pair.create(WORK_TYPE_BGUSER_IMPORTANT, 1),
                                    Pair.create(WORK_TYPE_BGUSER, 1))
                    ),
@@ -243,7 +243,7 @@ class JobConcurrencyManager {
                            List.of(Pair.create(WORK_TYPE_TOP, 4), Pair.create(WORK_TYPE_FGS, 1),
                                    Pair.create(WORK_TYPE_EJ, 2), Pair.create(WORK_TYPE_BG, 1)),
                            // defaultMax
                            List.of(Pair.create(WORK_TYPE_BG, 1),
                            List.of(Pair.create(WORK_TYPE_BG, 3),
                                    Pair.create(WORK_TYPE_BGUSER_IMPORTANT, 1),
                                    Pair.create(WORK_TYPE_BGUSER, 1))
                    ),
@@ -470,6 +470,11 @@ class JobConcurrencyManager {
        }
    }

    @GuardedBy("mLock")
    boolean isJobRunningLocked(JobStatus job) {
        return mRunningJobs.contains(job);
    }

    /** Return {@code true} if the state was updated. */
    @GuardedBy("mLock")
    private boolean refreshSystemStateLocked() {
+7 −23
Original line number Diff line number Diff line
@@ -336,8 +336,6 @@ public class JobSchedulerService extends com.android.server.SystemService
    // (ScheduledJobStateChanged and JobStatusDumpProto).
    public static final int RESTRICTED_INDEX = 5;

    // -- Pre-allocated temporaries only for use in assignJobsToContextsLocked --

    private class ConstantsObserver implements DeviceConfig.OnPropertiesChangedListener {
        public void start() {
            DeviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_JOB_SCHEDULER,
@@ -1632,22 +1630,6 @@ public class JobSchedulerService extends com.android.server.SystemService
        return false;
    }

    /**
     * @param job JobStatus we are querying against.
     * @return Whether or not the job represented by the status object is currently being run or
     * is pending.
     */
    private boolean isCurrentlyActiveLocked(JobStatus job) {
        for (int i=0; i<mActiveServices.size(); i++) {
            JobServiceContext serviceContext = mActiveServices.get(i);
            final JobStatus running = serviceContext.getRunningJobLocked();
            if (running != null && running.matches(job.getUid(), job.getJobId())) {
                return true;
            }
        }
        return false;
    }

    void noteJobsPending(List<JobStatus> jobs) {
        for (int i = jobs.size() - 1; i >= 0; i--) {
            JobStatus job = jobs.get(i);
@@ -2253,10 +2235,12 @@ public class JobSchedulerService extends com.android.server.SystemService
     *      - The component is enabled and runnable.
     */
    @VisibleForTesting
    @GuardedBy("mLock")
    boolean isReadyToBeExecutedLocked(JobStatus job) {
        return isReadyToBeExecutedLocked(job, true);
    }

    @GuardedBy("mLock")
    boolean isReadyToBeExecutedLocked(JobStatus job, boolean rejectActive) {
        final boolean jobReady = job.isReady();

@@ -2296,7 +2280,7 @@ public class JobSchedulerService extends com.android.server.SystemService
        }

        final boolean jobPending = mPendingJobs.contains(job);
        final boolean jobActive = rejectActive && isCurrentlyActiveLocked(job);
        final boolean jobActive = rejectActive && mConcurrencyManager.isJobRunningLocked(job);

        if (DEBUG) {
            Slog.v(TAG, "isReadyToBeExecutedLocked: " + job.toShortString()
@@ -2452,7 +2436,7 @@ public class JobSchedulerService extends com.android.server.SystemService
            synchronized (mLock) {
                final List<JobInfo> pendingJobs = new ArrayList<JobInfo>();
                mJobs.forEachJob(Process.SYSTEM_UID, (job) -> {
                    if (job.getJob().isPeriodic() || !isCurrentlyActiveLocked(job)) {
                    if (job.getJob().isPeriodic() || !mConcurrencyManager.isJobRunningLocked(job)) {
                        pendingJobs.add(job.getJob());
                    }
                });
@@ -3101,7 +3085,7 @@ public class JobSchedulerService extends com.android.server.SystemService
                    pw.print("pending");
                    printed = true;
                }
                if (isCurrentlyActiveLocked(js)) {
                if (mConcurrencyManager.isJobRunningLocked(js)) {
                    if (printed) {
                        pw.print(" ");
                    }
@@ -3284,7 +3268,7 @@ public class JobSchedulerService extends com.android.server.SystemService
                    pw.print(" !pending=");
                    pw.print(!mPendingJobs.contains(job));
                    pw.print(" !active=");
                    pw.print(!isCurrentlyActiveLocked(job));
                    pw.print(!mConcurrencyManager.isJobRunningLocked(job));
                    pw.print(" !backingup=");
                    pw.print(!(mBackingUpUids.indexOfKey(job.getSourceUid()) >= 0));
                    pw.print(" comp=");
@@ -3540,7 +3524,7 @@ public class JobSchedulerService extends com.android.server.SystemService
                    proto.write(JobSchedulerServiceDumpProto.RegisteredJob.IS_JOB_PENDING,
                            mPendingJobs.contains(job));
                    proto.write(JobSchedulerServiceDumpProto.RegisteredJob.IS_JOB_CURRENTLY_ACTIVE,
                            isCurrentlyActiveLocked(job));
                            mConcurrencyManager.isJobRunningLocked(job));
                    proto.write(JobSchedulerServiceDumpProto.RegisteredJob.IS_UID_BACKING_UP,
                            mBackingUpUids.indexOfKey(job.getSourceUid()) >= 0);
                    proto.write(JobSchedulerServiceDumpProto.RegisteredJob.IS_COMPONENT_USABLE,
Loading