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. Dec 12, 2023
    • Varun Shah's avatar
      Update exception thrown for consistency. · 3bb71c1c
      Varun Shah authored
      The PackageManagerInternal APIs for checking if the app is in a stopped
      state or is quarantined throw an IllegalArgumentException when the
      package is not found - however, this was not documented anywhere.
      
      Instead, to be consistent with other PackageManager APIs, start throwing
      a NameNotFoundException from the internal APIs and ensure the new
      exception is caught from the public APIs and rethrown as
      IllegalArgumentException.
      
      This change updates the documentation as well, fixes a typo in a method
      name, and also updates the logging level for when these exceptions occur.
      
      Bug: 314863695
      Test: builds/flashes/boots (mostly documentation changes)
      Change-Id: Ia7b30ce4e16b5e40bd767cd15dbf2cd2728567dd
      3bb71c1c
  10. Dec 08, 2023
    • Kweku Adams's avatar
      Reduce handler message spam. · d94881b8
      Kweku Adams authored
      Skip posting a message to the handler for events that aren't going to be
      processed.
      
      Bug: 141645789
      Bug: 273758274
      Test: atest FrameworksMockingServicesTests:QuotaControllerTest
      Change-Id: I9ed4da14aa33e66340f6573ad7f15763458ec5a9
      d94881b8
    • Kweku Adams's avatar
      Limit execution extension to important jobs. · a8e4b0aa
      Kweku Adams authored
      Limit the timeout execution extension for apps in privileged states to
      only the jobs that are marked as important.
      
      Bug: 284512488
      Bug: 299329948
      Bug: 299346198
      Test: atest FrameworksMockingServicesTests:QuotaControllerTest
      Change-Id: Ie6d17f091ae18cd8ff402886ca7d9a9be3c56f07
      a8e4b0aa
    • Varun Shah's avatar
      Catch exception when package is unknown. · f045351b
      Varun Shah authored
      Bug: 314863695
      Test: builds/flashes/boots
      Test: atest BackgroundJobsControllerTest
      Change-Id: I2a46ba64e7764c4e95547c3a50c999d6132f1b87
      f045351b
  11. Dec 07, 2023
    • Kweku Adams's avatar
      Make applied flex constraints configurable. · a6738a47
      Kweku Adams authored
      Make it possible to change which specific constraints are used in the
      flex scheduling behavior.
      
      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: I55c143d9e4ec384bd4c687dbe9313a8e78a9a6f1
      a6738a47
    • Kweku Adams's avatar
      Remove incorrect assumption. · 10973add
      Kweku Adams authored
      The initial assumption was that PACKAGE_RESTARTED meant that the app
      would be put into the stopped state and be kept in the stopped state
      until the PACKAGE_UNSTOPPED broadcast was sent. However, there are cases
      where the PACKAGE_RESTARTED broadcast is sent but the app is not put and
      kept in the stopped state (eg. clearing app data). Change the logic to
      no longer assume that PACKAGE_RESTARTED means the app is put and kept in
      the stopped state.
      
      Bug: 315171674
      Test: atest android.permissionui.cts.SafetyLabelChangesJobServiceTest#runNotificationJob_packageSourceUnspecified_updatesSafetyLabelHistoryForApps
      Test: atest FrameworksMockingServicesTests:BackgroundJobsControllerTest
      Change-Id: I23efa966b4963ca1777bdac58bbdad2f250c4984
      10973add
  12. Dec 06, 2023
    • Kweku Adams's avatar
      Minor cleanup. · 704be323
      Kweku Adams authored
      1. Add @GuardedBy annotations to help errorprone.
      2. Update copyright date to the year the file was created.
      
      Bug: 141645789
      Test: N/A
      Change-Id: If743ddc51f5d3ad390b3085048b5a31badb635ce
      704be323
  13. Dec 05, 2023
    • Kweku Adams's avatar
      Add shell command to get aconfig flag values. · 1ffaf3be
      Kweku Adams authored
      Also include the flag value in the job dump.
      
      Bug: 314877619
      Test: atest CtsJobSchedulerTestCases:JobInfoTest
      Change-Id: Idfb507de07354c97af1d39f6cc67b09fa891d5b9
      1ffaf3be
    • Kweku Adams's avatar
      Don't allow jobs of stopped apps to run. · 3d3b01ab
      Kweku Adams authored
      Jobs scheduled on behalf of another app (aka "source app") aren't
      dropped when the source app is force stopped. In this scenario, we don't
      want the job to run until the app comes out of the stopped state. Add
      explicit handling of this case to ensure we don't accidentally run these
      jobs and potentially give the app a way to get out of the stopped state
      in the background.
      
      Bug: 313794821
      Test: atest FrameworksMockingServicesTests:BackgroundJobsControllerTest
      Test: atest CtsJobSchedulerTestCases:JobThrottlingTest
      Change-Id: I26a8efb0b04022a6ac9e9ad716940c8971fd57dd
      3d3b01ab
  14. Dec 01, 2023
    • Kweku Adams's avatar
      Enforce minimum job time windows. · da434496
      Kweku Adams authored
      Set a minimum difference between a job's latency and deadline to give
      the system time to optimize execution decisions.
      
      Bug: 311402873
      Bug: 297106511
      Bug: 299329948
      Bug: 236261941
      Test: atest CtsJobSchedulerSharedUidTestCases
      Test: atest CtsJobSchedulerTestCases
      Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/job
      Test: atset frameworks/base/services/tests/servicestests/src/com/android/server/job
      Change-Id: Ia6a7f1ddfdcef3fb7298543170b03ba679e0779c
      da434496
  15. Nov 29, 2023
    • Kweku Adams's avatar
      Throw the SecurityException only on V+ builds. · 0028af98
      Kweku Adams authored
      U builds shouldn't treat apps targeting V+ differently from apps
      targeting U. Make sure the target SDK gated exception is only thrown on
      V+ builds.
      
      Bug: 300477393
      Test: atest CtsJobSchedulerTestCases:JobInfoTest
      Change-Id: I6d02e2d3d37f7dd06d63801da3352c357415e222
      0028af98
    • Sudheer Shanka's avatar
      Update delivery group policy for TIME_CHANGED and TIMEZONE_CHANGED. · 0e85b380
      Sudheer Shanka authored
      Applying the DELIVERY_GROUP_POLICY_MOST_RECENT policy to TIME_CHANGED
      and TIMEZONE_CHANGED broadcasts so that the older broadcasts can be
      discarded when a new one comes in. Since they are already using
      the FLAG_RECEIVER_REPLACE_PENDING, it should be safe to apply this
      policy.
      
      Bug: 311288757
      Test: atest CtsAlarmManagerTestCases
      Test: atest services/tests/mockingservicestests/src/com/android/server/alarm/AlarmManagerServiceTest.java
      Change-Id: Iada16830fa05d93e2a85c0a2d06ee31c0470cb4a
      0e85b380
    • Kweku Adams's avatar
      Avoid doubly penalizing rescheduled periodic jobs for flex. · 2d0db1b3
      Kweku Adams authored
      Periodic jobs that were completed successfully and rescheduled sometimes
      have adjusted start times to avoid running them back to back. When this
      happens, make sure the flex logic takes the adjustment into account and
      doesn't delay the constraint drops too significantly.
      
      Bug: 236261941
      Test: atest FrameworksMockingServicesTests:FlexibilityControllerTest
      Change-Id: I039f86a409754089c7592719e0fd3355d6883cfb
      2d0db1b3
    • Kweku Adams's avatar
      Move some tracking starts out of constructor. · ea77a1ea
      Kweku Adams authored
      Shift the tracking initiation of some controllers out of the constructor
      and do them asynchronously to reduce the amount of work done inside
      JobScheduler's constructor.
      
      Bug: 309292340
      Test: atest CtsJobSchedulerTestCases:JobSchedulingTest
      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: I7812419d7434ecf3fcb917f8c8bdd270d00bdd75
      ea77a1ea
  16. Nov 28, 2023
    • Kweku Adams's avatar
      Adjust idle timings. · 5caa3536
      Kweku Adams authored
      1. Reduce the time to enter deep device idle from ~71 minutes to a few
         minutes. Based on user behavior, the system can be more confident
         than not that the user won't turn the screen on for a while after
         a few minutes of screen off time.
      2. Shorten the time to enter light Doze and increase the max light idle
         time to 30 minutes and change the backoff system to get to 30 minutes
         more slowly.
      
      Bug: 187947479
      Bug: 299329948
      Test: atest DeviceIdleTest
      Test: atest FrameworksMockingServicesTests:DeviceIdleControllerTest
      Change-Id: Id4fb80d9def10d511759f6ae853ab6ce8909ca36
      5caa3536
  17. Nov 20, 2023
    • Kweku Adams's avatar
      Allow users to set custom Doze settings. · 44e8739b
      Kweku Adams authored
      Partially undo I7fff451b641eee43a13e77df7b40db5b3af16d58.
      Allow users to customize Doze parameters as they used to be able to do
      before.
      Also pull out related logic into a tested helper class.
      
      Bug: 305056706
      Test: atest CtsBatterySavingTestCases
      Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/tare
      Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/tare
      Test: atest FrameworksMockingServicesTests:DeviceIdleControllerTest
      Test: atest FrameworksServicesTests:BatterySaverPolicyTest
      Test: atest FrameworksServicesTests:UserSettingDeviceConfigMediatorTest
      Test: atest SettingsProviderTest:SettingsBackupTest
      Change-Id: Ieda9ee354b1dde01fed186f19e8ed957b2bbfe00
      44e8739b
  18. 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
    • Kweku Adams's avatar
      Add APIs to let apps attach debug info to jobs. · c7cd8d19
      Kweku Adams authored
      1. Let apps specify a specific trace tag for when their jobs are
         running.
      2. Allow apps to attach some tags to a job for debugging purposes.
      
      Bug: 293491637
      Bug: 297106461
      Test: atest CtsJobSchedulerTestCases:JobInfoTest
      Test: atest FrameworksServicesTests:JobStoreTest
      Change-Id: I7398210fc4730043f618579bad0d2e5140b912a7
      c7cd8d19
    • Hari Raj Vijayakumar's avatar
      Fix AlarmManager high CPU issue · d90dd503
      Hari Raj Vijayakumar authored
      - clampPositive assumes negative value is due to overflow and so sets
         to MAX_VALUE. However it also possible that negative value occurs
          due to addition of negative value(of higher magnitude) with positive
          of lower magnitude. In issue case, NTP sync causes RTC to move
          forward thus pushing whenElapsed to negative range. This means
          maxWhenElapsed would also be negative but is clamped to MAX_VALUE
          causing AlarmManager to go into infinite loop.
      
      Bug: b/308389917
      Test: manual
      Change-Id: Ie12d5125f1feeeb1a5dd661a744f86d00796d126
      Merged-In: I946333b86b2658ec1b70cb1e3110f5eae1b81486
      d90dd503
    • Hari Raj Vijayakumar's avatar
      Fix AlarmManager high CPU issue · 3e988f0d
      Hari Raj Vijayakumar authored
      - clampPositive assumes negative value is due to overflow and so sets
         to MAX_VALUE. However it also possible that negative value occurs
          due to addition of negative value(of higher magnitude) with positive
          of lower magnitude. In issue case, NTP sync causes RTC to move
          forward thus pushing whenElapsed to negative range. This means
          maxWhenElapsed would also be negative but is clamped to MAX_VALUE
          causing AlarmManager to go into infinite loop.
      
      Bug: b/308389917
      Test: manual
      Change-Id: I946333b86b2658ec1b70cb1e3110f5eae1b81486
      3e988f0d
  19. Nov 15, 2023
    • Kweku Adams's avatar
      Account for unseen constraint combinations. · c82b9a61
      Kweku Adams authored
      Don't force jobs to wait for constraint combinations that haven't been
      seen in the recent past. By default, if a set of constraints have not
      been seen together in the past 3 days, then assume they won't be
      satisfied together and don't wait for those constraints to be met in
      order to run a job. Other constraint combinations may still be valid, so
      the job may be forced to wait for those.
      
      Bug: 236261941
      Bug: 299329948
      Bug: 299346198
      Test: atest CtsJobSchedulerTestCases:FlexibilityConstraintTest
      Test: atest FrameworksMockingServicesTests:ConnectivityControllerTest
      Test: atest FrameworksMockingServicesTests:FlexibilityControllerTest
      Change-Id: I8f68b76afa2cc68e062f7ce09477aafb237dc6f1
      c82b9a61
  20. 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
  21. 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
  22. 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
  23. Nov 08, 2023
  24. Nov 07, 2023
  25. 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
Loading