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

Commit d6625fff authored by Kweku Adams's avatar Kweku Adams
Browse files

Using proc state to determine foreground status.

uidActive is true for bound foreground services. We would like to put a
quota on jobs for those processes as well, so switching to proc state
allows finer-grained control.

Bug: 117846754
Bug: 111423978
Test: atest com.android.server.job.controllers.QuotaControllerTest
Change-Id: I69b474b3dc0dda7a4d2234d75fd9023c3f041b67
parent e49bb322
Loading
Loading
Loading
Loading
+9 −4
Original line number Original line Diff line number Diff line
@@ -403,18 +403,23 @@ message StateControllerProto {
        optional bool is_charging = 1;
        optional bool is_charging = 1;
        optional bool is_in_parole = 2;
        optional bool is_in_parole = 2;


        // List of UIDs currently in the foreground.
        repeated int32 foreground_uids = 3;

        message TrackedJob {
        message TrackedJob {
            option (.android.msg_privacy).dest = DEST_AUTOMATIC;
            option (.android.msg_privacy).dest = DEST_AUTOMATIC;


            optional JobStatusShortInfoProto info = 1;
            optional JobStatusShortInfoProto info = 1;
            optional int32 source_uid = 2;
            optional int32 source_uid = 2;
            optional JobStatusDumpProto.Bucket effective_standby_bucket = 3;
            optional JobStatusDumpProto.Bucket effective_standby_bucket = 3;
            optional bool has_quota = 4;
            // If the job started while the app was in the TOP state.
            optional bool is_top_started_job = 4;
            optional bool has_quota = 5;
            // The amount of time that this job has remaining in its quota. This
            // The amount of time that this job has remaining in its quota. This
            // can be negative if the job is out of quota.
            // can be negative if the job is out of quota.
            optional int64 remaining_quota_ms = 5;
            optional int64 remaining_quota_ms = 6;
        }
        }
        repeated TrackedJob tracked_jobs = 3;
        repeated TrackedJob tracked_jobs = 4;


        message Package {
        message Package {
            option (.android.msg_privacy).dest = DEST_AUTOMATIC;
            option (.android.msg_privacy).dest = DEST_AUTOMATIC;
@@ -456,7 +461,7 @@ message StateControllerProto {


            repeated TimingSession saved_sessions = 3;
            repeated TimingSession saved_sessions = 3;
        }
        }
        repeated PackageStats package_stats = 4;
        repeated PackageStats package_stats = 5;
    }
    }
    message StorageController {
    message StorageController {
        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
+229 −19

File changed.

Preview size limit exceeded, changes collapsed.

+264 −13

File changed.

Preview size limit exceeded, changes collapsed.