Skip to content
Snippets Groups Projects
  1. Sep 28, 2023
  2. 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
  3. Sep 20, 2023
  4. Sep 19, 2023
  5. 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
  6. Sep 11, 2023
  7. Sep 08, 2023
    • Kweku Adams's avatar
      Tear down the Agent after each test. · a693ce15
      Kweku Adams authored
      Tear down the Agent after each test so that it doesn't continue to
      operate on the Handler thread.
      
      Bug: 299645803
      Test: atest --rerun-until-failure 50 com.android.server.tare.AgentTest
      Change-Id: I07f4742a1a438ce61919bf5d75a75484fb3815db
      a693ce15
    • Anna Zhuravleva's avatar
      Use androidx LargeTest annotation for device tests. · 440b6178
      Anna Zhuravleva authored
      Platform_testing LargeTest annotation is for
      host side tests, device
      tests should use androidx annotation.
      
      Bug: 293837621
      Test: build
      Change-Id: I8ea6f256b542a4ed0030b3d366c37f6fdafa6b3b
      440b6178
  8. Sep 01, 2023
  9. Aug 30, 2023
    • Tej Singh's avatar
      Move system server pullers off background thread · 5c85f29b
      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
      5c85f29b
  10. Aug 24, 2023
  11. Aug 23, 2023
    • Kweku Adams's avatar
      Cache frequently used LocalServices. · 9602bec9
      Kweku Adams authored
      Any LocalServices object that is reused in a class should be cached locally
      so that we avoid repeated lookups within the LocalServices map,
      especially during tight loops.
      
      Bug: 295877092
      Test: atest CtsJobSchedulerTestCases
      Test: atest FrameworksMockingServicesTests:JobStatusTest
      Test: atest FrameworksMockingServicesTests:QuotaControllerTest
      Change-Id: Ie8d90a0f8aebbb23138613095859e1f9ce1b207f
      9602bec9
    • Kweku Adams's avatar
      Avoid loading duplicate jobs. · 104d21d0
      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
      (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c8fbd937940b83944492c4ccaf2830611285999a)
      Merged-In: I3179261309031801f0506cf905206376e59af1fe
      Change-Id: I3179261309031801f0506cf905206376e59af1fe
      104d21d0
    • Jiangyou Li's avatar
      Fix JobServiceContext leak issue · d8a414d3
      Jiangyou Li authored
      JobServiceContext will leak when fail to bindService.
      
      issue: 291625922
      
      test: monkey
      Change-Id: Icca4aa1f1fe32b6f39d18f7ee819cc682cac6f18
      d8a414d3
  12. Aug 22, 2023
    • Kweku Adams's avatar
      Avoid loading duplicate jobs. · b74d32fa
      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
      b74d32fa
    • Kweku Adams's avatar
      Avoid loading duplicate jobs. · c8fbd937
      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
      c8fbd937
  13. Aug 21, 2023
  14. Aug 10, 2023
    • Kweku Adams's avatar
      Add ANR behavior to javadoc. · 1e901692
      Kweku Adams authored
      Note how JobScheduler behaves when apps don't respond in a timely manner
      to onStartJob() and onStopJob().
      
      Bug: 19536175
      Test: `m offline-sdk-docs` and view page at out/target/common/docs/offline-sdk/reference/android/app/job/JobService.html
      Change-Id: Ib5586801addd3ff83ce19476f98e9ef1cee4e51d
      1e901692
  15. Aug 09, 2023
    • Eric Biggers's avatar
      Fix logspam from AppIdleHistory on first boot · 2ac7a0c2
      Eric Biggers authored
      Before /data/system/users/0/app_idle_stats.xml has been created, it is
      expected that it doesn't exist.  Log a simple debug message instead of
      an error message with stacktrace.
      
      Bug: 290410617
      Test: booted Cuttlefish and checked logcat
      Change-Id: I19a72e3bd74038e7447a2d47529022a68a13b1e9
      Merged-In: I19a72e3bd74038e7447a2d47529022a68a13b1e9
      (cherry picked from commit 4aa768b4)
      2ac7a0c2
  16. Aug 08, 2023
    • Prem's avatar
      Enable quick doze using mode manager · 008fa43f
      Prem authored
      Bug: 289979530
      
      Test: atest FrameworksMockingServicesTests: com.android.server.DeviceIdleControllerTest
      
      Change-Id: I86c932fa756a1c09bfbcf81f2cf966c45d8f0af7
      008fa43f
  17. Aug 07, 2023
  18. Aug 02, 2023
  19. Jul 17, 2023
    • Suprabh Shukla's avatar
      Log when job quota is reduced for buggy apps · 65a72578
      Suprabh Shukla authored
      Count the times job scheduler artificially lowers quota for a job
      because it considers the caller buggy due to excessive job timeouts.
      
      The logic is refactored to allow simpler logging, but no other
      functional change is intended.
      
      Test: statsd_testdrive 528
      
      Existing job tests:
      Test: atest FrameworksMockingServicesTests:JobSchedulerServiceTest
      Test: atest FrameworksMockingServicesTests:JobStatusTest
      
      Bug: 291146667
      Change-Id: I62654be0a0cdc713a17146c3ec612b37e8283b3e
      Merged-In: I62654be0a0cdc713a17146c3ec612b37e8283b3e
      65a72578
  20. Jul 14, 2023
    • Suprabh Shukla's avatar
      Log when job quota is reduced for buggy apps · b4914523
      Suprabh Shukla authored
      Count the times job scheduler artificially lowers quota for a job
      because it considers the caller buggy due to excessive job timeouts.
      
      The logic is refactored to allow simpler logging, but no other
      functional change is intended.
      
      Test: statsd_testdrive 528
      
      Existing job tests:
      Test: atest FrameworksMockingServicesTests:JobSchedulerServiceTest
      Test: atest FrameworksMockingServicesTests:JobStatusTest
      
      Bug: 291146667
      Change-Id: I62654be0a0cdc713a17146c3ec612b37e8283b3e
      b4914523
  21. Jul 07, 2023
    • Eric Biggers's avatar
      Fix logspam from AppIdleHistory on first boot · 4aa768b4
      Eric Biggers authored
      Before /data/system/users/0/app_idle_stats.xml has been created, it is
      expected that it doesn't exist.  Log a simple debug message instead of
      an error message with stacktrace.
      
      Bug: 290410617
      Test: booted Cuttlefish and checked logcat
      Change-Id: I19a72e3bd74038e7447a2d47529022a68a13b1e9
      4aa768b4
  22. Jun 23, 2023
    • Kweku Adams's avatar
      Support test skipping when power save modes aren't enabled. · 1656f9a8
      Kweku Adams authored
      Some classes of devices will not have auto power save modes enabled. On
      those devices, we should skip tests that require the modes be enabled.
      
      Bug: 240108412
      Bug: 240630396
      Test: Manually go through CTS-V "Ignore Battery Optimizations Test"
      Test: atest CtsUsageStatsTestCases:UsageStatsTest
      Change-Id: Icc64fbe75213386a1f41fae258e50c4032920b0a
      (cherry picked from commit ba3b5d7e)
      Merged-In: Icc64fbe75213386a1f41fae258e50c4032920b0a
      1656f9a8
    • Kweku Adams's avatar
      Reduce memory usage. · 28b2c8a8
      Kweku Adams authored
      1. Make sure strings are interned so that memory isn't wasted on duplicate
         strings.
      2. Most of the memory used by the TARE system was made up of the
         Transaction objects. The Transaction history is only kept for
         debugging purposes, so it can be reduced without affecting the
         policy. Reduce the number of transactions kept in memory by 92% for
         user builds to reduce the memory used by the TARE system by 90-92%.
      
      Bug: 288479057
      Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/tare
      Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/tare
      Change-Id: Ic12a54a3d12be60a7fe20bb62931e8f2e62f1475
      28b2c8a8
  23. Jun 22, 2023
    • Kweku Adams's avatar
      Clarify expired deadline meaning for periodic jobs. · 19116901
      Kweku Adams authored
      Clarify that a periodic job only runs when its constraints are met
      and therefore an expired deadline for a periodic job doesn't mean the
      constraints aren't satisfied.
      
      Bug: 19536175
      Test: N/A
      Change-Id: Id1dc4b5f900b93a6ab8c9724f2952f56205dab11
      19116901
  24. Jun 19, 2023
  25. Jun 16, 2023
    • Sijie Chen's avatar
      Add a shell command to update mIsOffBody · 4957db6c
      Sijie Chen authored
      This CL adds a shell command to updade mIsOffBody. This will later be
      used in setup_wear.sh for lab testing.
      
      Bug: 272528508
      Test: Start a emualtor and issue the command
      sijiec@sijiec:~/master_workspace/main$ adb shell dumpsys deviceidle force-offbody
      mForceIsOffBody: true
      mIsOffBody: true
      sijiec@sijiec:~/master_workspace/main$ adb shell dumpsys deviceidle force-onbody
      mForceIsOffBody: true
      mIsOffBody: false
      
      Change-Id: Ife80a402b1856d9fd36c2069b98d6b2291299f06
      4957db6c
  26. Jun 15, 2023
    • Suprabh Shukla's avatar
      Removing config KILL_ON_SCHEDULE_EXACT_ALARM_REVOKED · 816e08c1
      Suprabh Shukla authored
      The default behavior has been active for multipe releases without any
      need for switching.
      The config and all its code and string references should now be removed
      as they are no longer expected to be useful.
      
      Test: atest CtsAlarmManagerTestCases
      Test: atest FrameworksMockingServicesTests:AlarmManagerServiceTest
      
      Bug: 228652215
      Change-Id: If6d6ad5855989f549e44bd5673e352b9059d84ae
      816e08c1
  27. Jun 14, 2023
    • Suprabh Shukla's avatar
      Rework and simplify alarm dispatch priorities · bfc93c9a
      Suprabh Shukla authored
      Multiple alarms can be sent together in a batch. When this happens, the
      ordering of alarms in this batch can be important. Existing code tracked
      priorities per package but not per uid. This was inaccurate and could
      cause subtle inefficiencies.
      
      In addition to moving the tracking to {user, package} pair, simplified
      and tweaked the logic so that:
      - All alarms from the system always get priority over other alarms: Most
        alarms from the system are important as they enable system components
        to complete their state transitions.
      - TIME_TICK is now explicitly moved to the head of the queue whenever it
        is present: This ensures we enqueue the ACTION_TIME_TICK broadcast as
        soon as possible.
      
      Refactored the code mechanics so there is no need to track the global
      priorities assigned to each package and batch sequence number anymore.
      Since UserPackage objects are already cached, using a local set of these
      should incur minimal allocation churn. This also enables tracking
      priorities by a single integer primitive per alarm.
      
      Test: atest FrameworksMockingServicesTests:AlarmManagerServiceTest
      Test: atest CtsAlarmManagerTestCases
      
      Bug: 223918281
      Change-Id: I2bc8d04ed97d1d7fbbd493e6ef14af24138c89df
      bfc93c9a
  28. Jun 12, 2023
    • Kweku Adams's avatar
      Intern additional strings at boot. · cf83961b
      Kweku Adams authored
      Follow-on from Id0c9448483cec65aa6f2d30a3295b1300e02c830.
      
      Bug: 273758274
      Bug: 247127880
      Test: atest FrameworksServicesTests:JobStoreTest
      Change-Id: I3d761bf333ecb76492f752669b2e5e74364ae154
      cf83961b
  29. Jun 09, 2023
    • Kweku Adams's avatar
      Intern strings loaded from persisted file. · 13c90ce2
      Kweku Adams authored
      Intern the strings loaded and kept from the persisted file so we don't
      retain unnecessary duplicates.
      
      Bug: 273758274
      Bug: 247127880
      Test: atest FrameworksMockingServicesTests:ScribeTest
      Test: atest FrameworksServicesTests:JobStoreTest
      Change-Id: Id0c9448483cec65aa6f2d30a3295b1300e02c830
      13c90ce2
    • Kweku Adams's avatar
      Ensure apps can't bypass FAS using UIJ. · 6a8a1bf6
      Kweku Adams authored
      Make sure UIJs are set to stop after an app leaves the TOP state if the
      user Background Restricted the app. Also remove associated notifications
      so that users don't get confused about the state of the app.
      
      Also modifying IDLE_UIDS_MSG queuing to enable deterministic testing.
      
      Bug: 285623302
      Test: atest CtsJobSchedulerTestCases:JobThrottlingTest
      Test: atest CtsJobSchedulerTestCases:NotificationTest
      Test: atest --rerun-until-failure 25 CtsJobSchedulerTestCases:UserInitiatedJobTest
      Test: atest FrameworksMockingServicesTests:JobNotificationCoordinatorTest
      Test: atest FrameworksMockingServicesTests:MockingOomAdjusterTests
      Test: atest FrameworksServicesTests:OomAdjusterTests
      Change-Id: I59f9880b0cfc4e5ba143cd522ed4c3df012f7154
      6a8a1bf6
  30. Jun 07, 2023
    • Rafal Slawik's avatar
      Use valid metric ids · bb673e2f
      Rafal Slawik authored
      Bug: 286192024
      Bug: 266008139
      Change-Id: Ieaea2b181334d40224fd97a7e2280827220cecb8
      Test: build
      bb673e2f
  31. Jun 02, 2023
    • Kweku Adams's avatar
      Log namespace hash. · 7a030400
      Kweku Adams authored
      Log the hash of the namespace to reduce privacy concerns while still
      being able to distinguish between namespaces.
      
      Bug: 138239687
      Test: statsd_testdrive 8
      Change-Id: I94d0e927e287339d5e74fa3db2f0e226f2fe3048
      7a030400
  32. Jun 01, 2023
    • Kweku Adams's avatar
      Add app-level timeout & ANR limits. · a57583df
      Kweku Adams authored
      If an app's jobs keep timing out, then the app potentially has a bug.
      Timeouts resulted in backoff of the individual job that timed out,
      but didn't affect other jobs. This meant that apps could bypass backoff
      by scheduling one-off jobs instead of rescheduling using the return
      parameter to onStopJob. Now, JobScheduler will track the number of job
      timeouts across all of the app's jobs and reduce the app's max job time
      if it exceeds a threshold. If the total number of timeouts exceeds
      another limit, JobScheduler will consider the app buggy and
      attempt to put the app in the RESTRICTED bucket.
      
      Similarly, if an app keeps ANRing from JobScheduler's perspective, it
      will consider the app buggy and attempt to put it in the RESTRICTED
      bucket.
      
      When an unexempted app is considered buggy, don't treat any of its jobs
      as in the ACTIVE unless the app is current active.
      
      Also, reduce the delay for forcing an app in the RESTRICTED bucket
      (eg. when the app is buggy) to 1 hour. The normal bucket timeout
      continues to be 8 days.
      
      Bug: 284080732
      Test: atest AppStandbyControllerTests
      Test: atest FrameworksMockingServicesTests:JobSchedulerServiceTest
      Test: atest FrameworksMockingServicesTests:JobStatusTest
      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: I8eb333a922658ba6137012dffd7a143cd990376d
      a57583df
  33. May 30, 2023
    • Kweku Adams's avatar
      Increase exempted apps' EJ quota. · 6f78eacc
      Kweku Adams authored
      Increase the EJ quota for EXEMPTED apps slightly.
      
      Bug: 267949143
      Test: atest FrameworksMockingServicesTests:QuotaControllerTest
      Change-Id: Ie08c0aae69d3f42e97d64c1433c51c614bbf9a59
      6f78eacc
Loading