Skip to content
Snippets Groups Projects
  1. Nov 17, 2023
    • Kweku Adams's avatar
      Properly set the NetworkRequest singleUid. · 054fcdf7
      Kweku Adams authored
      A job's NetworkRequest should have the source app's UID as the UID. The
      previous code attempted to set the UID, but didn't modify the stored
      job, leading to potentially unexpected behavior of proxied jobs.
      Rearranging code to ensure we properly set the NetworkRequest UID.
      
      Bug: 311727153
      Test: N/A
      Change-Id: I8fb49b74ff861ea82d89ab8d2791e4b917fd6ef2
      054fcdf7
  2. Nov 13, 2023
    • Kweku Adams's avatar
      Avoid duplicate classes in boot path. · 3b4319ea
      Kweku Adams authored
      Switch to using static_libs in one location to avoid loading
      the same class into the boot path multiple times.
      
      Remove redundant links.
      
      Bug: 309674488
      Test: atest android.compat.sjp.cts.StrictJavaPackagesTest
      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 CtsAppTestCases
      Test: atest CtsJobSchedulerTestCases:JobSchedulingTest
      Test: atest CtsNotificationTestCases:NotificationManagerZenTest
      Test: atest CtsNotificationTestCases:AutomaticZenRuleTest
      Test: atest CtsOsTestCases:PowerManagerTest
      Test: atest FrameworksUiServicesTests:ZenModeConfigTest
      Test: atest PowerServiceTests:PowerManagerServiceTest
      Change-Id: I917cc4ae662c55a030fbf266133fba04fec496f2
      3b4319ea
  3. Nov 10, 2023
    • Ikjoon Jang's avatar
      Revert "Avoid duplicate classes in boot path." · 94da08fb
      Ikjoon Jang authored
      This reverts commit efba4176.
      
      Reason for revert: DroidMonitor: Potential culprit for Bug b/310080905 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
      
      Bug: 310080905
      Change-Id: Id7d6c1fbc6e58b08c14ad52b74a10adbff8abc4e
      94da08fb
  4. Nov 09, 2023
    • Kweku Adams's avatar
      Avoid duplicate classes in boot path. · efba4176
      Kweku Adams authored
      Switch to using libs to avoid loading the same class into the
      boot path multiple times.
      
      Bug: 309674488
      Test: atest android.compat.sjp.cts.StrictJavaPackagesTest
      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:JobSchedulingTest
      Test: atest CtsOsTestCases:PowerManagerTest
      Test: atest PowerServiceTests:PowerManagerServiceTest
      Change-Id: I4a00922aec9ae295da4480784088d18d0c6bf806
      efba4176
    • Karishma Vakil's avatar
      Revert "[DeviceAware] Use AttributionSourceState in AppOpsServic..." · 0b668d04
      Karishma Vakil authored
      Revert submission 24499968-appops-deviceid
      
      Reason for revert: Causing perf regression b/308786093
      
      Reverted changes: /q/submissionid:24499968-appops-deviceid
      
      Change-Id: I211edc6b9bb9f59eb6259be54938000f9ad65c45
      0b668d04
  5. Nov 08, 2023
  6. Nov 07, 2023
  7. Nov 06, 2023
    • Kweku Adams's avatar
      Add transport affinities for flex scheduling. · 366583d3
      Kweku Adams authored
      Switch the flex network behavior from unmetered vs metered to looking at
      network transports. Transport affinities indicate which transports are
      preferred for running jobs, and which ones the system should try to
      avoid, if possible. By default, when flex scheduling is enabled, the
      system will avoid running jobs on the cellular network and prefer
      running jobs on wifi and/or ethernet networks.
      
      Watches tend to send most traffic over the bluetooth network. However,
      there are plans to modify job network traffic in other ways for watches.
      For now, watches will be excluded from network flex scheduling until
      those plans are resolved.
      
      Bug: 236261941
      Bug: 299329948
      Bug: 299346198
      Test: atest CtsJobSchedulerTestCases:ConnectivityConstraintTest
      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: I675d72b18ae6ddc43fb1503d481ff9bb56c2dcb6
      366583d3
    • Kweku Adams's avatar
      Add ability to disable wakelocks in light idle. · 3869da75
      Kweku Adams authored
      Make it possible to disable wakelocks for background apps while the
      device is in light device idle mode.
      
      Bug: 299329948
      Test: atest PowerServiceTests:PowerManagerServiceTest
      Change-Id: Ice07f936f6a2ac329825564cb4d8950a92e65fc3
      3869da75
    • Kweku Adams's avatar
      Avoid repeated/redundant work. · 40f71889
      Kweku Adams authored
      1. Avoid scheduling the idle alarm if the device is already considered
         idle.
      2. Avoid scheduling the idle alarm again if the currently scheduled
         alarm is for the same time.
      
      Bug: 309292340
      Test: atest FrameworksMockingServicesTests:DeviceIdlenessTrackerTest
      Change-Id: I0cb49041d15e5b2bd880ddc06cb2f1aa95e8c174
      40f71889
  8. Nov 03, 2023
    • Kweku Adams's avatar
      Remove network bypass flags for non-connectivity jobs. · 539279fe
      Kweku Adams authored
      If a job doesn't say that it needs network, then there's no reason to
      ensure that the app has access to network while the job is running.
      Currently, the network restriction bypass flags are only given to
      expedited or user-initiated jobs. Don't include the flags when the job
      doesn't require connectivity to avoid accidental network usage/leakage.
      
      Bug: 297106511
      Bug: 299329948
      Bug: 299346198
      Test: atest CtsJobSchedulerTestCases:ConnectivityConstraintTest
      Test: atest CtsJobSchedulerTestCases:ExpeditedJobTest
      Change-Id: I9c632595f27655a977d6b084760839ce02c8c07b
      539279fe
    • Kweku Adams's avatar
      Lower EJ execution limit to 10 minutes. · 03ebd42a
      Kweku Adams authored
      Developers are informed that expedited jobs can be stopped earlier than
      regular jobs and so shouldn't use them for long pieces of work.
      The standard timeout is 3 minutes for EJs. There's little reason to let
      them run longer than the normal 10 minutes, and letting them run up to
      30 minutes may give developers the wrong impression and increases the
      potential for accidental power issues. Lower the maximum execution limit
      of EJs to 10 minutes (the base execution limit of regular jobs) to be
      more in line with what EJs should be used for and prevent additional
      issues.
      
      Bug: 284512488
      Bug: 297106511
      Bug: 299329948
      Bug: 299346198
      Test: atest FrameworksMockingServicesTests:JobSchedulerServiceTest
      Change-Id: Ia4950f0801f2881a34976987f735e5ab7f493ee1
      03ebd42a
  9. Nov 02, 2023
    • Kweku Adams's avatar
      Split JobScheduler idle value by charging state. · 16a6a795
      Kweku Adams authored
      Create a separate JobScheduler idle value by charging + battery-not-low
      state so that we can have different values when the device is charging
      compared to when it's on battery.
      
      Bug: 236261941
      Bug: 297106511
      Bug: 299329948
      Test: atest CtsJobSchedulerTestCases:IdleConstraintTest
      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: I16f41f05f7ffe5ab7fd1f660e0e08ea7544ff921
      16a6a795
  10. Oct 31, 2023
    • Karishma Vakil's avatar
      [DeviceAware] Use AttributionSourceState in AppOpsService checkOp, noteOp, · 6ebedc96
      Karishma Vakil authored
      startOp, finishOp methods
      
      This allows us to reduce the number of parameters being passed around
      and also enables easy addition of new parameters such as device id.
      
      Note that this change is unflagged and is meant to be a pure refactor.
      This is preparatory CL and no new methods are being added to AppOpsManager yet, but will be needed
      to allow clients to pass in device id.
      
      Bug: 299160174
      Test: atest CtsAppOpsTestCases CtsAppOps2TestCases
      Change-Id: I591b1dc7d7e4af0371c2d1d80b06d858e7213a94
      6ebedc96
  11. Oct 30, 2023
    • Kweku Adams's avatar
      Revert "Add methods to mark some constraints as optional." · 6b5722c2
      Kweku Adams authored
      This reverts commit eb72459a.
      
      Reason for revert: The plan is to apply it to jobs by default.
      
      Bug: 236261941
      Bug: 299346198
      Test: atest FrameworksMockingServicesTests:ConnectivityControllerTest
      Test: atest FrameworksMockingServicesTests:FlexibilityControllerTest
      Test: atest FrameworksMockingServicesTests:JobStatusTest
      Change-Id: Ie9a5643caf6e6b68642580b92b10c05a70bd2998
      6b5722c2
    • Kweku Adams's avatar
      Add permission check to setBias. · 2b353f86
      Kweku Adams authored
      The job bias is meant to be an indication of the job type and the state
      the app was in when the job was scheduled. This can only be determined
      by the system and certain privileged apps. The job bias can affect some
      things such as which system health factors are taken into consideration
      when deciding when to run a job. Given all this, the bias should only be
      set by the system or certain privileged apps. Note the required permission
      on the hidden API and enforce that the calling app has the permission
      when the job is scheduled.
      
      Bug: 300477393
      Test: atest CtsJobSchedulerTestCases:JobInfoTest
      Test: atest CtsSyncManagerTestCases
      Test: atest DownloadManagerApi28Test
      Test: atest FrameworksServicesTests:BiasSchedulingTest
      Change-Id: I1cb37eafc42f961dee9d2e7bc7d496a31dff31f4
      2b353f86
  12. Oct 27, 2023
  13. Oct 24, 2023
    • Kweku Adams's avatar
      Add battery-not-low requirement for constraint relaxation. · 72d472c2
      Kweku Adams authored
      Don't relax the prefetch connectivity constraint requirement unless the
      battery is also not low.
      
      Bug: 299329948
      Test: atest FrameworksMockingServicesTests:PrefetchControllerTest
      Test: atest FrameworksMockingServicesTests:ConnectivityControllerTest
      Change-Id: I4b2c0905fb15277c63ae57284a2139858998d68b
      72d472c2
    • Kweku Adams's avatar
      Modify wakelock tag. · c3d14d17
      Kweku Adams authored
      1. Remove the job ID from the wakelock tag.
      2. Lazily load the tag when needed to reduce memory usage of jobs
         waiting for constraints to be satisfied.
      3. Remove redundant log line.
      
      Bug: 273758274
      Bug: 302348192
      Bug: 307556230
      Test: atest CtsJobSchedulerTestCases
      Test: Manually remove output of `adb shell dumpsys jobscheduler`
      Change-Id: If8547d23ced90b17225ab8efd758ac735655687e
      c3d14d17
    • Kweku Adams's avatar
      Support custom user strings. · 561415d9
      Kweku Adams authored
      Use UserHandle.parseUserArg() when parsing adb command flags to enable
      parsing "cur" and other special user strings.
      
      Bug: 282063891
      Test: atest CtsJobSchedulerTestCases
      Test: `adb shell cmd jobscheduler run --user cur com.android.settings 2131427352`
      Change-Id: Ibe06f536f1de760a5604d067b6c1894f756a17c6
      561415d9
    • Martijn Coenen's avatar
      BlobStore: use a separate thread for RevocableFd in system_server. · 33fdb78a
      Martijn Coenen authored
      Having the callbacks on RevocableFileDescriptor coming in on the main
      thread of system_server can create problems:
      - system_server's main thread is heavily contended
      - it can cause deadlocks: callbacks come in from vold with vold's global
        lock held; this callback needs the system_server main thread to make
        progress. But if the main thread is busy with another call into vold
        (unrelated to RevocableFd), this will result in deadlock.
      
      Bug: 300351508
      Test: atest BlobStoreManagerTest
      Change-Id: Ie4c3c65bdb9303f4aaab8f76b95d3f9f133b4c3e
      33fdb78a
  14. Oct 20, 2023
    • Kweku Adams's avatar
      Fix UID logging. · b49c9145
      Kweku Adams authored
      The uid parameter to scheduleAsPackage is the calling UID. It was
      incorrectly being used as the source UID in the statsd logging, causing
      the end metrics to have the wrong information. This fixes the UID
      logging and renames the input parameter to avoid further confusion.
      
      Bug: 138239687
      Test: N/A
      Change-Id: Ifdfe2ffbc7b5f8b8fe74291a1ec54068541f740b
      b49c9145
    • Kweku Adams's avatar
      Skip irrelevant files when loading jobs from disk. · 2bb0a70d
      Kweku Adams authored
      When loading from disk, skip files such as backup & temp files created
      during the AtomicFile writing process to avoid incorrectly reading
      duplicate jobs from them.
      
      Bug: 289062813
      Bug: 305169670
      Test: atest FrameworksServicesTests:JobStoreTest
      Change-Id: I28a180e2b24357219d34be6a22c785311be6e72e
      2bb0a70d
  15. Oct 13, 2023
    • Anton Hansson's avatar
      Fix broken framework documentation · 2ccbeb75
      Anton Hansson authored
      Various issues here, but the most recurring one is referencing SystemApi
      from public javadoc. Remove or rewrite such references.
      
      Also common is trying to @link IntDefs. Usually this is not necessary,
      as the presence of IntDef in the @param/@return auto-generates relevant
      documentation.
      
      Bug: 303184203
      Test: m docs
      Change-Id: Ie59e61881c45c73fbbe08250493bd35eca268ef6
      2ccbeb75
    • Suprabh Shukla's avatar
      Remove code to manage the exact alarm denylist · 24cbdb70
      Suprabh Shukla authored
      Now that exact alarms are denied to newer app installs for apps targeting T, the deny list is obsolete and the overhead of maintaining it is not worthwhile.
      
      Test: atest CtsAlarmManagerTestCases
      Test: atest FrameworksMockingServicesTests:com.android.server.alarm
      
      Bug: 304846238
      Change-Id: I4376e5ddbb2e470f3e3d690dd0866f4b470f455b
      24cbdb70
    • Kweku Adams's avatar
      Fix typo. · b90bb67c
      Kweku Adams authored
      Bug: 299329948
      Change-Id: If1f6ef1a950ee93c2cb4413205c87a9454734573
      Test: N/A
      b90bb67c
  16. Oct 12, 2023
    • Kweku Adams's avatar
      Avoid loading duplicate jobs. · 9b4ec7c8
      Kweku Adams authored
      If the persisted files have somehow accumulated duplicate versions of
      the same job (identified by uid-namespace-jobId), then drop the
      duplicates and only keep one.
      
      Bug: 289062813
      Bug: 296890885
      Test: atest JobStoreTest
      Change-Id: I3179261309031801f0506cf905206376e59af1fe
      (cherry picked from commit c8fbd937)
      Merged-In: I3179261309031801f0506cf905206376e59af1fe
      9b4ec7c8
    • Kweku Adams's avatar
      Don't penalize app for slow app binding. · 8d6ab2f9
      Kweku Adams authored
      The system may be busy when trying to bind to the app, so don't penalize
      it for slow binding. Now, we'll retain the job that was slow to bind and
      stop triggering an ANR.
      
      Bug: 292090044
      Bug: 303533836
      Test: atest CtsJobSchedulerTestCases:JobSchedulingTest
      Change-Id: Ida52d63c5e9710d9d590388d20fceb4fa8f2e0d5
      (cherry picked from commit 71fdfd48)
      Merged-In: Ida52d63c5e9710d9d590388d20fceb4fa8f2e0d5
      8d6ab2f9
  17. Oct 11, 2023
    • Kweku Adams's avatar
      Reduce prefetch launch time threshold. · b08c7a6b
      Kweku Adams authored
      Reduce the prefetch job launch time threshold to one hour so we will
      only consider running a prefetch job at most one hour before the app is
      estimated to be launched.
      
      Bug: 295046507
      Test: atest FrameworksMockingServicesTests:PrefetchControllerTest
      Change-Id: Ia3d4d049fb44b8f12418c987425949b60b37bd65
      b08c7a6b
  18. Oct 09, 2023
    • Kweku Adams's avatar
      Don't penalize app for slow app binding. · 71fdfd48
      Kweku Adams authored
      The system may be busy when trying to bind to the app, so don't penalize
      it for slow binding. Now, we'll retain the job that was slow to bind and
      stop triggering an ANR.
      
      Bug: 292090044
      Bug: 303533836
      Test: atest CtsJobSchedulerTestCases:JobSchedulingTest
      Change-Id: Ida52d63c5e9710d9d590388d20fceb4fa8f2e0d5
      71fdfd48
  19. Oct 04, 2023
    • Kweku Adams's avatar
      Add ability to increase light idle time linearly. · 176c2d00
      Kweku Adams authored
      Make it possible to increase the light idle time linearly instead of
      exponentially.
      
      Bug: 299329948
      Test: atest DeviceIdleTest
      Test: atest FrameworksMockingServicesTests:DeviceIdleControllerTest
      Change-Id: I4e7c07fa1d2653446ae5617f11fbd26ec39438ab
      176c2d00
    • Kweku Adams's avatar
      Turn off prefetch constraint relaxation on battery. · 95071adc
      Kweku Adams authored
      Only let prefetch jobs use the opportunistic quota when the device
      is on charger to reduce excess battery drain. The opportunistic quota
      usage behavior is optional and not required for prefetch jobs, so we can
      disable it without impacting app or developer expectations.
      
      Bug: 295046507
      Bug: 299329948
      Test: atest FrameworksMockingServicesTests:ConnectivityControllerTest
      Test: atest FrameworksMockingServicesTests:PrefetchControllerTest
      Change-Id: Idc137279fea1100f53ecf20279153fe92fdb5617
      95071adc
  20. Sep 28, 2023
  21. Sep 22, 2023
    • Kweku Adams's avatar
      Fix proxied job logging attribution. · b40e3b04
      Kweku Adams authored
      The statsd logging was incorrectly logging for only the source app.
      Including the calling app will enable better metrics and debugging.
      
      Bug: 138239687
      Test: statsd_testdrive 8 while running CtsSyncManagerTestsCases
      Test: statsd_testdrive 150 while running CtsSyncManagerTestsCases
      Change-Id: I9ba3097135b1f11368df800b043d730d780f3a33
      b40e3b04
  22. Sep 20, 2023
  23. Sep 19, 2023
  24. Sep 14, 2023
    • Tej Singh's avatar
      Move system server pullers off background thread · c0da04b7
      Tej Singh authored
      The background thread is prone to severe delays in processing time near
      boot, which causes pull timeouts and event queue overflow in statsd. The
      vast majority of pullers use the DIRECT_EXECUTOR to execute pulls in the
      incoming binder thread, so move these pulled atoms to do the same thing.
      More context is in the bug and linked docs.
      
      Bug: 298133385
      Test: verified via boot traces that the pull durations are shorter and
      that the pulls no longer happen in the background thread
      
      Change-Id: I67a3d583cc13d9547dfe7108897e95f4a5238d26
      Merged-In: I67a3d583cc13d9547dfe7108897e95f4a5238d26
      (cherry picked from commit 5c85f29b)
      c0da04b7
  25. Sep 11, 2023
Loading