- Nov 17, 2023
-
-
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
-
- Nov 08, 2023
-
-
Roshan Pius authored
Bug: 244264995 Test: Compiles Merged-In: Ifabc201418c54c2f910ff4b95b5240a58a683001 Change-Id: Ifabc201418c54c2f910ff4b95b5240a58a683001
-
- Oct 12, 2023
-
-
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
-
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
-
- Sep 14, 2023
-
-
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)
-
- Aug 24, 2023
-
-
Chan Kim authored
See https://source.android.com/setup/contribute/respectful-code for reference For this round, the fixes are only applied to the following to minimize breaking dependencies: * comments (excluding javaDoc annotations) * private constants * private functions * parameters within functions BYPASS_INCLUSIVE_LANGUAGE_REASON=Just updating a few select inclusive language violations. No-Typo-Check: Changes focused on inclusive language violations. BUG: 295342157 Change-Id: I690b29e1c26dc97cfbdee274ba61c76229b568e0
-
- Aug 23, 2023
-
-
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
-
Jiangyou Li authored
JobServiceContext will leak when fail to bindService. issue: 291625922 test: monkey Change-Id: Icca4aa1f1fe32b6f39d18f7ee819cc682cac6f18
-
- Aug 22, 2023
-
-
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
-
- Aug 21, 2023
-
-
Chan Kim authored
See https://source.android.com/setup/contribute/respectful-code for reference For this round, the fixes are only applied to the following to minimize breaking dependencies: * comments (excluding javaDoc annotations) * private constants * private functions * parameters within functions BYPASS_INCLUSIVE_LANGUAGE_REASON=Just updating a few select inclusive language violations. No-Typo-Check: Changes focused on inclusive language violations. BUG: 295342157 Change-Id: Ib6c6616202d2795174ff253f863173857f9c79c9
-
- Aug 09, 2023
-
-
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)
-
- Jul 17, 2023
-
-
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
-
- Jun 23, 2023
-
-
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
-
- Jun 09, 2023
-
-
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
-
- Jun 07, 2023
-
-
Rafal Slawik authored
Bug: 286192024 Bug: 266008139 Change-Id: Ieaea2b181334d40224fd97a7e2280827220cecb8 Test: build
-
- Jun 02, 2023
-
-
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
-
- Jun 01, 2023
-
-
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
-
- May 30, 2023
-
-
Kweku Adams authored
Increase the EJ quota for EXEMPTED apps slightly. Bug: 267949143 Test: atest FrameworksMockingServicesTests:QuotaControllerTest Change-Id: Ie08c0aae69d3f42e97d64c1433c51c614bbf9a59
-
- May 23, 2023
-
-
Kweku Adams authored
Generate a unique logging ID incorporating the namespace and original job ID so that logs can differentiate between jobs in different namespaces. Bug: 138239687 Test: statsd_testdrive 8 Change-Id: I549c2bfaa3a75b7fbcdfae48829e02ffdcc77b64
-
- May 22, 2023
-
-
gang.huang authored
Pulling up the initialization to avoid having earlier code run into uses of mActivityManagerInternal. Bug: 283724099 Test: Manual. Change-Id: I910993401915bc67af73bc7ad3e68a6a76df8026
-
- May 16, 2023
-
-
Kweku Adams authored
Treat an ANR stop as an app failure and back off immediately when that happens. Bug: 258236856 Bug: 282784507 Test: atest FrameworksMockingServicesTests:JobSchedulerServiceTest Change-Id: I3feab21e74d55c4a2940e3ef2ca10175295970a3
-
- May 15, 2023
-
-
Kweku Adams authored
System requested stops theoretically have no reason to trigger an immediate backoff because there's no indication the backoff will help improve success rate, so don't back off a job for the first few system stops. Bug: 282784507 Test: atest FrameworksMockingServicesTests:JobSchedulerServiceTest Change-Id: If30edd312e17a6baba05654075e7ed21ace6338b
-
- May 13, 2023
-
-
Amith Yamasani authored
This allows a privileged app to set an allowlist duration to only delay freezing an app. It doesn't put the app into the temp allowlist nor put it into active state. It only kicks the can down the road on when to freeze the process. Fixes: 278940896 Test: atest BroadcastFreezerTest Change-Id: I2498c29401d1ec2514450e034498de0403f334da
-
- May 10, 2023
-
-
Kweku Adams authored
Avoid overcounting lower concurrency values from jobs finishing execution. Bug: 138239687 Bug: 279935506 Test: atest CtsJobSchedulerTestCases:JobSchedulingTest Change-Id: I000dcfba72d8394486889dbb53aaa7039c62fac3
-
Kweku Adams authored
Remove the demotion flags from a user-initiated job if the app successfully enqueues a new JobWorkItem. If an app successfully enqueues a JobWorkItem to a UI job, then the app is in a state to successfully schedule a UI job. Presumably, the user has asked for this additional bit of work, so it makes sense to remove the demotion flags. For now, we only do this for UI jobs since they have strict scheduling requirements. It's harder to assume other jobs were scheduled due to user interaction/request. This mimics the behavior when a UI job is rescheduled (without adding a JobWorkItem). Internal flags aren't copied over when a job is rescheduled. Bug: 281838527 Test: atest FrameworksMockingServicesTests:JobStatusTest Change-Id: I591afc7c0ac23fa0bda646fd12053be58ff5d4ee
-
Kweku Adams authored
Bug: 280564348 Test: atest CtsJobSchedulerTestCases Change-Id: I4fa917be0594c11ead64cfd98ab9e56045c159e9
-
Suprabh Shukla authored
Log a counter everytime an app is put into or taken out of the power allowlist. In normal conditions, this is only expected to happen when the user toggles this in Settings, so should be relatively rare. Test: N/A Bug: 263411625 Change-Id: Ie0d79d66cf2b480e8d94c7d6b1567d7785cde7be
-
- May 08, 2023
-
-
Kweku Adams authored
Limit namespace length to 1000 characters to avoid memory or other potential issues. Bug: 281553712 Test: atest CtsJobSchedulerTestCases Change-Id: I8c99ce6c5e9a23a38f91a00bdf22e80d08389f32
-
Kweku Adams authored
Add metrics to track how often apps fail to schedule jobs. Bug: 138239687 Bug: 279935506 Test: atest CtsJobSchedulerTestCases:JobSchedulingTest Change-Id: I05fec96feb4ab8b78a0e896b84a31512b4f84fe5
-
- May 05, 2023
-
-
Suprabh Shukla authored
Log a counter every time an app is put under battery restriction. Test: N/A Bug: 280192659 Change-Id: I688f6e33fe74d637a453c5d5ecfbcf0d6c7f9379
-
- May 04, 2023
-
-
Kweku Adams authored
Add a metric to track the maximum number of jobs that are scheduled at a time, in 30 minute increments. Bug: 138239687 Bug: 279935506 Test: atest CtsJobSchedulerTestCases:ConnectivityConstraintTest Test: atest CtsJobSchedulerTestCases:JobSchedulingTest Test: atest CtsJobSchedulerTestCases:NotificationTest Change-Id: If0c190bf8ebcca55ef1907020b37a0e1c72181ae
-
- May 03, 2023
-
-
Kweku Adams authored
The base timestamp wasn't being reset when the job started, so the duration was always being perceived as starting from boot time. Setting the base timestamp as the job start time fixes the cumulative execution tracking. Bug: 280653695 Test: N/A Change-Id: I8fdcde54c21bc53cfdb41c78ba4f19d7b45cc50b
-
Kweku Adams authored
Add express logs to track: 1. How apps interact with the updateEstimatedNetworkBytes() API 2. How apps interact with the updateTransferredNetworkBytes() API 3. How apps interact with the setNotification() API 4. How apps interact with the setEstimatedNetworkBytes() API 5. How apps interact with the setMinimumChunkBytes() API 6. How often apps hit the max scheduled job limit 7. How often apps are too slow in responding to JobService API calls 8. How many times apps crash (or otherwise unexpectedly lose their connection) while running a JobService 9. How many JobWorkItems apps enqueue at a time 10. Job execution concurrency Bug: 138239687 Bug: 279935506 Test: atest CtsJobSchedulerTestCases:ConnectivityConstraintTest Test: atest CtsJobSchedulerTestCases:JobSchedulingTest Test: atest CtsJobSchedulerTestCases:NotificationTest Test: atest FrameworksMockingServicesTests:JobNotificationCoordinatorTest Change-Id: I153eef1120fcdbf64c241707287233c422fa66db
-
- Apr 28, 2023
-
-
Kunal Malhotra authored
Test: manual testing on phone Bug: 260913634 Change-Id: Ie61213a92f27420d0f13bdc4e6712f883aed4d09
-
- Apr 27, 2023
-
-
Kweku Adams authored
The controller was still registering for location updates when location prefetch was disabled. Now, it skips requesting location updates altogether when location prefetch is disabled. Bug: 279725615 Test: atest DeviceIdleTest Test: atest FrameworksMockingServicesTests:DeviceIdleControllerTest Change-Id: If303d5448acbc4e97132f3713a7795e46eacc5ab
-
- Apr 25, 2023
-
-
Suprabh Shukla authored
Listener exact alarms no longer require permission. Adding unit test cases to document and test the same. Added couple string translations that were missing for exact-allow reasons. Test: FrameworksMockingServicesTests:AlarmManagerServiceTest BYPASS_INCLUSIVE_LANGUAGE_REASON=existing code Fixes: 265838027 Change-Id: I0b985b5ee381bf8385e9ed43fa6efb4460bf59e6
-
- Apr 21, 2023
-
-
Vova Sharaienko authored
- to be used as a static lib by mainline modules Bug: 271127104 Test: m Change-Id: I80b03fb6dbcff95dd7fc0d5c4af6e868629cce64 Merged-In: I80b03fb6dbcff95dd7fc0d5c4af6e868629cce64
-
- Apr 20, 2023
-
-
Suprabh Shukla authored
Sensor wakeup events are already being reported to batterystats. For cellular, the code in network stack will be enabled independently. Test: atest FrameworksServicesTests:CpuWakeupStatsTest Test: statsd_testdrive -e 588 Bug: 276498460 Bug: 275436924 Change-Id: I1fc925193b4f0e3713d29de552138287c9a9768e
-
- Apr 18, 2023
-
-
Kweku Adams authored
Sometimes controllers actually update their relative bit on the job when the JobSchedulerService double checks with controllers. However, if JSS is looping through the changedJobs list when this happens, the controller will tell JSS of the change, but adding it to the changedJobs list will be a no-op so the job won't be added to the pending job list. And if the controller gets a callback and evaluate the job on its own, the bit won't change and so the job won't be added to the changedJobs list. This leads to inconsistent behavior based on timing/order of operations. Shifting the controller re-evaluation to when we're determine the job's readiness fixes the issue. Bug: 263216453 Bug: 263699506 Bug: 271128261 Test: atest --rerun-until-failure 50 android.jobscheduler.cts.JobThrottlingTest#testRestrictedEJAllowedWhenAutoRestrictedBucketFeatureOn Test: atest FrameworksMockingServicesTests:JobSchedulerServiceTest Change-Id: Idb41cf030f63c697adb8e7bfebc132019f9dffbc
-
- Apr 17, 2023
-
-
Kweku Adams authored
Log class name in the error message so developers can track down classes that don't override the method. Bug: 152942222 Test: atest CtsJobSchedulerTestCases:ConnectivityConstraintTest Change-Id: Ifeef4fa8b801bd6c551cd095dabd7603b70b53bf
-