Skip to content
Snippets Groups Projects
  1. May 29, 2024
    • lijilou's avatar
      JobSchedulerService:fix arrayIndexOutOfBoundsException to aviod · a8e15e02
      lijilou authored
      systemServer crash.
      
      As can be seen from the AOSP code, the set collection mTrackedTasks is accessed under mLock, but there is no mLock lock in the reportNewIdleState function. Therefore, we should put onControllerStateChanged into the mLock lock for execution, just like all other Controllers calling this method with mLock, there is no risk of deadlock.
      
      Test: OEM monkey test
      Bug: 342554438
      Change-Id: I596defa8ca018a7161cd149a54a029f6adb96937
      a8e15e02
  2. May 23, 2024
  3. May 03, 2024
    • Oriol Prieto Gasco's avatar
      RESTRICT AUTOMERGE · 7b816129
      Oriol Prieto Gasco authored
      Set the container field of aconfig flags
      
      Test: printflags --format='{package}:{container}:' | grep "::"
      Bug: 312769710
      Flag: NONE
      Change-Id: I84fda0d5e9813940609436d825738ff786908ff0
      7b816129
  4. Apr 11, 2024
  5. Apr 05, 2024
    • Jeongik Cha's avatar
      Add //visibility:any_system_partition · 0431bac2
      Jeongik Cha authored
      system image which is declared in Android.bp should include the module.
      
      Bug: 321000103
      Test: m nothing
      Change-Id: I238c6459a6ff521796ef142c8e9d4e88d3293f44
      0431bac2
  6. Apr 04, 2024
  7. Mar 09, 2024
  8. Mar 06, 2024
  9. Mar 01, 2024
  10. Feb 27, 2024
    • Tetiana Meronyk's avatar
      Add flag for user wakeup persistence · b7a913f9
      Tetiana Meronyk authored
      Bug: 314907186
      Test: m all_aconfig_declarations
      Change-Id: I08c7de5ce29a5b74300cae18cc6f08e61fcf4cab
      b7a913f9
    • Kweku Adams's avatar
      Update bug number. · 23af6f4e
      Kweku Adams authored
      Update the bug number of flags that have been pushed back to 24Q3.
      
      Bug: 326607666
      Test: N/A
      Change-Id: I7e09b3cae7e1f1801ae46ab776f80fbbc1522c52
      23af6f4e
  11. Feb 24, 2024
    • Kweku Adams's avatar
      Refactor special app tracking. · ad86db3d
      Kweku Adams authored
      Refactor code to make it easier to add exceptions to flex policy.
      
      Bug: 236261941
      Test: atest CtsJobSchedulerTestCases:FlexibilityConstraintTest
      Test: atest FrameworksMockingServicesTests:FlexibilityControllerTest
      Change-Id: Iafb9de05cf1d3cbbe7fa8559df47fd8677d65f02
      ad86db3d
  12. Feb 23, 2024
    • Prem Edhara's avatar
      Check if doze was forced before turning device active. · e2ae5cd4
      Prem Edhara authored
      Bug: 325090418
      
      Test: Manually verified that putting the watch on-body doesn't make the device active when deep doze has been enabled through adb.
      
      Change-Id: I7d5b0334f13f9f0170c909a8fd2b9fc99b99a900
      e2ae5cd4
    • Suprabh Shukla's avatar
      Use frozen state callback to drop listener alarms · 12f5c369
      Suprabh Shukla authored
      Exact listener alarms are currently dropped few seconds after being in
      cached to avoid a violation of the exactness guarantee if the app gets
      frozen. Now that a callback from activity manager is available, it is
      better to use it directly instead of a delayed handler message.
      
      This also improves the efficiency of the logic by avoiding the linear
      query in the MessageQueue on the main system-server handler thread
      which can be quite busy.
      
      Test: atest FrameworksMockingServicesTests:com.android.server.alarm
      
      Bug: 324470945
      Change-Id: I0a05259db98c63c0c17b98aa11a4e52bbdb73d67
      12f5c369
  13. Feb 21, 2024
    • jorgetm's avatar
      AlarmManager: Store the next dst transition in system properties · 2dd606d7
      jorgetm authored
      For our current timezone, store the new dst transition properties which are both the Unix epoch time of the next dst transition and the offset in the time during that transition.
      
      Bug: 277283353
      Test: Device test, properties are stored as expected
      Change-Id: I76b49b816cee24eaabb61c63ee14c9421f631a20
      2dd606d7
  14. Feb 14, 2024
    • Kweku Adams's avatar
      Fix logging. · b98a8719
      Kweku Adams authored
      Exclude the unbatched count from the logged value to get an accurate
      number of jobs that are piggybacking on something else.
      
      Bug: 28382445
      Test: atest CtsJobSchedulerTestCases
      Change-Id: Id6db3a40287db53e13f5f195d1688c34681350c4
      b98a8719
  15. Feb 13, 2024
    • Kweku Adams's avatar
      Revert^2 "Handle negative delays and deadlines." · bd6ba76b
      Kweku Adams authored
      Some apps are scheduling jobs with negative delays and deadlines. This
      is invalid input that can lead to incorrect behavior when used in
      calculations. Set a floor for delays and deadlines so that negatives are
      no longer propagated and throw a target SDK gated exception for the
      invalid input.
      
      Bug: 323349338
      Test: atest CtsJobSchedulerTestCases:JobInfoTest
      Test: atest com.android.federatedcompute.services.encryption.BackgroundKeyFetchJobServiceTest#testScheduleJob_notNeeded
      
      Change-Id: I04a3c0ca10cddde3052f0cd757ac5a01ced78c7e
      bd6ba76b
  16. Feb 12, 2024
    • Daniele Di Proietto's avatar
      Revert "Handle negative delays and deadlines." · fe177f2b
      Daniele Di Proietto authored
      Revert submission 26190262-js_block_negative_deadlines
      
      Reason for revert: b/324845571
      
      Reverted changes: /q/submissionid:26190262-js_block_negative_deadlines
      
      Change-Id: Ifabc2d25ffa9af844548d91d3d0c5d082716c70a
      fe177f2b
    • Kweku Adams's avatar
      Set affinity for transport satellites. · c712711f
      Kweku Adams authored
      Avoid using satellite transports if possible since they won't have a lot
      of bandwidth and may be very costly to use.
      
      Bug: 236261941
      Test: N/A
      Change-Id: I9cb8f9146ef4e40bac9cbe42253293ba2b6ed42c
      c712711f
  17. Feb 09, 2024
    • Kweku Adams's avatar
      Update time window message. · 30965fed
      Kweku Adams authored
      Update the short time window exception message to explain why the window
      is a problem so developers can make changes more appropriately than just
      setting the value to the minimum.
      
      Bug: 311402873
      Test: N/A
      Change-Id: Ia01f4da1454566457196fff496ad9aa0a763d06f
      30965fed
    • Kweku Adams's avatar
      Handle negative delays and deadlines. · 9c9e8d6b
      Kweku Adams authored
      Some apps are scheduling jobs with negative delays and deadlines. This
      is invalid input that can lead to incorrect behavior when used in
      calculations. Set a floor for delays and deadlines so that negatives are
      no longer propagated and throw a target SDK gated exception for the
      invalid input.
      
      Bug: 323349338
      Test: atest CtsJobSchedulerTestCases:JobInfoTest
      Change-Id: I524cf83d4f60e72a874c6272c30c348a04de00ba
      9c9e8d6b
  18. Feb 08, 2024
    • Kweku Adams's avatar
      Make it possible to check processed DeviceConfig flags. · 21fd192f
      Kweku Adams authored
      Make it possible to track the most recently processed DeviceConfig flags
      and get the value that was processed to help deflake tests.
      
      Bug: 271128261
      Bug: 322031031
      Bug: 322871938
      Bug: 323084558
      Bug: 323621598
      Test: atest --rerun-until-failure 25 CtsJobSchedulerTestCases:FlexibilityConstraintTest
      Change-Id: Iaec284b6670cef490a1ea93b5849fd5065cefe80
      21fd192f
    • Kweku Adams's avatar
      Apply flex policy to jobs with short deadlines. · 0f72d995
      Kweku Adams authored
      Apply flex policy to all jobs with deadlines and adjust other factors to
      accomodate increased scope:
      1. Don't exclude jobs with short deadlines from flex policy.
      2. Use the standard flex fallback duration for the policy, unless the
         job's own deadline results in a later end time. In that case, use the
         job's deadline instead.
      3. Exclude jobs from the TOP app from score calculation so that apps
         aren't penalized for doing work while in the TOP state.
      4. Cache job score to avoid recalculating if buckets haven't changed.
      5. Address comments from previous change.
      6. Adjust scores and max values to avoid extreme delays.
      
      Bug: 236261941
      Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/job
      Test: CtsJobSchedulerTestCases:FlexibilityConstraintTest
      Change-Id: I2dd85732eddc4aace3ab81a914d781fb25d9c6f6
      0f72d995
  19. Feb 07, 2024
    • Kweku Adams's avatar
      Don't log WTF when flex constraint becomes unsatisfied. · 1db6a37d
      Kweku Adams authored
      Bug: 323410278
      Test: atest CtsJobSchedulerTestCases:FlexibilityConstraintTest
      Change-Id: Ieac48cf4fe0970e167600332ff40cfcbc9a1175d
      1db6a37d
    • Kweku Adams's avatar
      Update minimum time window policy. · abb975e9
      Kweku Adams authored
      The new policy rejects jobs with short time windows and functional
      constraints (eg. charging, connectivity, etc.). Jobs without functional
      constraints and short time windows are allowed, but discouraged in a log
      message. The minimum accepted window is also brought down to be in line
      with the minimum job period.
      
      The setOverrideDeadline documentation is also updated to make it clear
      that the deadline just invalidates other requested (ie. functional)
      constraints, but the job may be delayed by factors such as system health
      signals.
      
      Bug: 311402873
      Test: atest CtsJobSchedulerTestCases:JobInfoTest
      Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/job
      Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/job
      Change-Id: I05def8a34e102c2e9b843d03f303f377fe4d4356
      abb975e9
    • Kweku Adams's avatar
      Account for different charging policies. · 00d1a384
      Kweku Adams authored
      Consider the device charging when special charging policies are active
      that may not increase the battery level, but will keep the device in a
      stable charging state.
      
      This is intended to be a short-term change until the final logic can be
      moved into BatteryService or another more appropriate location.
      
      Bug: 304512874
      Test: atest CtsJobSchedulerTestCases
      Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/job
      Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/job
      Test: atest FrameworksMockingServicesTests:JobSchedulerServiceTest
      Change-Id: Id8ba3ffb9112e662be4deadd8f823db5cc32b440
      00d1a384
  20. Feb 05, 2024
    • Kweku Adams's avatar
      Remove unnecessary flag. · 147134cd
      Kweku Adams authored
      The app compat framework now properly handles the device's version code,
      so there's no need to have a separate flag to ensure the code only
      operates on V+ builds.
      
      Bug: 300477393
      Test: atest CtsJobSchedulerTestCases:JobInfoTest
      Change-Id: I30404a9e1110f4d5a9b8c5bd1483c81737727962
      147134cd
  21. Feb 02, 2024
    • Kweku Adams's avatar
      Update batching logic. · 76c3b4f0
      Kweku Adams authored
      1. Attempt to piggyback on network activations.
         Have JobScheduler attempt to delay the start of some connectivity
         jobs until the network is actually active. This should help reduce
         the number of network wakeups and the cumulative network
         idle-to-suspend duration.
      2. Include jobs in the ACTIVE bucket in the forced batch set and don't
         force batch if we're too close to a job's deadline. However, still
         continue exempt jobs for apps in the EXEMPTED bucket and jobs for
         apps that are currently active (uidActive).
      
      Bug: 28382445
      Bug: 299329948
      Bug: 299346198
      Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/job
      Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/job
      Test: atest CtsJobSchedulerTestCases
      Change-Id: I58f47c8297b43e72a0b0af16aaf71ace3996166f
      76c3b4f0
  22. Jan 30, 2024
    • Karishma Vakil's avatar
      [DeviceAware] Track op accesses per device in AppOpsService · 49ec477e
      Karishma Vakil authored
      * Add device id validation checks in AppOpsManager APIs
      * Track accesses per persistent device id andbinder token
      * Notify all listeners about app ops events with device attribution
      
      Bug: 299330771
      Bug: 308202270
      Bug: 299333373
      Bug: 308716998
      Bug: 299331189
      Bug: 299331038
      Bug: 299330986
      Bug: 299330466
      Test: atest CtsAppOpsTestCases CtsAppOps2TestCases
      Change-Id: I3ea74be2b2dff1fbee70adba25267ecc6f1cb6fa
      49ec477e
  23. Jan 26, 2024
    • Varun Shah's avatar
      Add a new exemption for backup-related jobs. · 0a2bba4a
      Varun Shah authored
      Apps who have the new RUN_BACKUP_JOBS permission will be allowed to run
      longer backup-related jobs by the means of elevating their bucket if
      necessary. This new behavior is similar to the cloud media provider
      exemption.
      
      Bug: 318731461
      Test: atest JobStatusTest
      Change-Id: I4432eec8637b71e71dcecd74740a592399649c70
      0a2bba4a
  24. Jan 25, 2024
    • Kweku Adams's avatar
      Log debug and trace tags to statsd. · 1e466293
      Kweku Adams authored
      Log debug and trace tags to statsd for analysis. Apply basic PII
      filtering beforehand to minimize PII leaks.
      
      Bug: 293491637
      Bug: 297106461
      Test: atest FrameworksMockingServicesTests:JobStatusTest
      Test: statsd_testdrive 8
      Change-Id: I5e2e971413787e9c70ebffd4f6a767c8f2d89959
      1e466293
    • Kweku Adams's avatar
      Fix test flakiness. · b5cff963
      Kweku Adams authored
      The default mocked value (0) was causing some code to run that would
      occasionally interfere with tests, making them flaky. Setting the value
      to the right "unknown" value disables that and prevents the test flakes.
      
      Also add a safety check and escape valve in case something was missed
      and things go wrong in production.
      
      Bug: 236261941
      Test: atest --rerun-until-failure 25 FrameworksMockingServicesTests:FlexibilityControllerTest
      Change-Id: I5d14329e5ba656af77ccdbd39d28d53080c0c47d
      b5cff963
    • Varun Shah's avatar
      Introduce the RUN_BACKUP_JOBS permission. · 53e84fae
      Varun Shah authored
      This is a new app-op permission which will be reserved for apps whose
      primary purpose is to backup or sync content. Holding this permission
      will allow the app to run longer backup-related jobs.
      
      This permission will be denied by default and users will have to
      navigate to the relevant Special App Access page in Settings to grant an
      app the permission.
      
      Bug: 318731461
      Test: atest AppOpsTest
      Change-Id: I2b1257fa557b5b7fb0acf6046f912611a99f7d14
      53e84fae
  25. Jan 24, 2024
    • Kweku Adams's avatar
      Fix logging issue. · 870a603d
      Kweku Adams authored
      mHasFusedLocation was never set to true, so all bug reports would falsely indicate that FUSED_PROVIDER didn't exist on the device. Properly set mHasFusedLocation so that bug reports can be interpreted correctly.
      
      Bug: 273742717
      Test: N/A
      Change-Id: I67306397c8997acdcab7357f0454187da5e78744
      870a603d
  26. Jan 22, 2024
    • Kweku Adams's avatar
      Don't rush job checking at boot. · 5f9a0abd
      Kweku Adams authored
      Don't force an evaluation of all jobs right after the boot complete
      signal. Trying to run jobs at boot may cause contention, so let the
      execution of jobs after boot completed happen naturally to try and lower
      the potential for jank or other negative UX.
      
      Bug: 321598070
      Test: boot device
      Change-Id: I0fbe513fffc13960361952e3f1e20335f5c163d2
      5f9a0abd
  27. Jan 18, 2024
    • Kweku Adams's avatar
      Set flex policy based on job priority. · b53da711
      Kweku Adams authored
      Make it possible to have different fallback deadlines and percent drop
      rates for each job priority so that higher priority jobs aren't delayed
      as significantly as lower priority jobs.
      
      By default:
      * HIGH priority jobs have a 6 hour fallback with % drops of 33, 50, 60, 75
      * DEFAULT jobs have a 12 hour fallback with % drops of 50, 60, 70, 80
      * LOW jobs have a 24 hour fallback with % drops of 50, 60, 70, 80
      * MIN jobs have a 48 hour fallback with % drops of 55, 65, 75, 85
      
      The fallback deadline is adjusted based on job execution over the prior
      24 hours, with higher priority jobs carrying more weight, in order to
      discourage setting a lot of jobs as high priority.
      
      Bug: 236261941
      Bug: 299329948
      Bug: 299346198
      Test: atest CtsJobSchedulerTestCases:FlexibilityConstraintTest
      Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/job
      Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/job
      Change-Id: Ic153e642d7fd45f69986873162f84f69a289313e
      b53da711
  28. Jan 17, 2024
    • Kweku Adams's avatar
      Lower fallback deadline. · bb040f33
      Kweku Adams authored
      Lower the fallback deadline to a more reasonable 24 hours.
      
      Bug: 236261941
      Bug: 299329948
      Bug: 299346198
      Test: atest FrameworksMockingServicesTests:FlexibilityControllerTest
      Change-Id: I0c60e9d3152e84c1c7975aca684099efd0750c8d
      bb040f33
  29. Jan 12, 2024
    • Kweku Adams's avatar
      Revert^2 "Add exemptions to flex policy." · db03591e
      Kweku Adams authored
      57ed8cfb
      
      Exempt DEFAULT+ priority jobs for BFGS+ and exempted apps from flex
      policy. LOW and MIN priority jobs will continue to have the flex policy
      applied.
      
      Bug: 236261941
      Bug: 299329948
      Bug: 299346198
      Test: atest CtsJobSchedulerTestCases:FlexibilityConstraintTest
      Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/job
      Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/job
      Change-Id: Ia4d19e9726db748a63eb422858c208d393a9f3b2
      db03591e
Loading