summaryrefslogtreecommitdiff
path: root/apex/statsd/framework/java/android
Commit message (Collapse)AuthorAgeFilesLines
* Migrate apex/statsd -> packages/modules/StatsD/apexBaligh Uddin2020-12-045-2183/+0
| | | | | | BUG: 167962588 TEST: TH Change-Id: Ifbf8f6310031254f5a53b382cfa7d44e9d3b7bf0
* Tighten up Binder.clearCallingIdentity() usage.Jeff Sharkey2020-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | The recently added AndroidFrameworkBinderIdentity Error Prone checker examines code to ensure that any cleared identities are restored to avoid obscure security vulnerabilities. This change is a purely mechanical refactoring that adds the "final" keyword to the cleared identity to ensure that it's not accidentally modified before eventually being cleared. Here's the exact command used to generate this CL: $ find . -name "*.java" -exec sed -Ei \ 's/ (long \w+ = .+?clearCallingIdentity)/ final \1/' \ {} \; Bug: 155703208 Test: make Exempt-From-Owner-Approval: trivial refactoring Change-Id: I832c9d70c3dfcd8d669cf71939d97837becc973a
* Increase size limit for pulled StatsEvent.Muhammad Qureshi2020-06-041-8/+42
| | | | | | | | | | | | | | | | | Increase StatsEvent max byte size to 50 KB when not using pooled buffer. - Set the default max size to 50 KB - The starting buffer size is still ~4 KB for pushed and pulled events. - If a write would exceed the buffer bounds, double buffer size until write fits or 50 KB limit is exceeded in which case the overflow bit is set to true. - If usePooledBuffer() is called, max size is set to ~4 KB but buffer isn't resized. And if the current payload exceeds this limit, set overflow bit to true. - Only "recycle" Buffer object if its size is <= ~4 KB. Bug: 158214941 Test: atest FrameworkStatsdTest Change-Id: I9b6f73688b0bccb5a70f4ef51750464ec9c87fb9
* Change package of StatsdStatsLogTej Singh2020-06-011-1/+1
| | | | | | | | | Change package of StatsdStatsLog from com.android.internal.util to com.android.internal.statsd Test: atest GtsStatsdHostTestCases Bug: 157649935 Change-Id: Iee2af03c950b7cc054f7d77e721694a7f429ae9d
* Merge "Retry pullfinish with empty payload if call fails" into rvc-devTej Singh2020-06-011-1/+9
|\
| * Retry pullfinish with empty payload if call failsTej Singh2020-05-291-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | If the first call for pullFinished fails, it is likely because the transaction is too large. Currently, if this happens statsd will just sleep until the timeout. With this change, the client will retry calling pullFinish if the first attempt fails, but with an empty payload (and with success = false) to cause the puller to fail fast, and so statsd does not wait for the timeout. Test: atest GtsStatsdHostTestCases Bug: 157768117 Change-Id: I1af29b6c83039ab56ef847832a600d4afea34000
* | Decrease default pull timeout to 2 seconds.Tej Singh2020-05-291-1/+1
|/ | | | | | | | | | | This can result in more pull failures, but can prohibit slow pullers from slowing down statsd. Test: atest GtsStatsdHostTestCases Test: atest statsd_test Test: atest FrameworkStatsdTest Bug: 154056912 Change-Id: Ie30bd3584d808bb11aaaf0fe2057c9adfb198644
* Fix statsd NPE on setPullAtomCallbackTej Singh2020-05-051-4/+0
| | | | | | | | | | | | | | | | Suspected root cause: if a process crashes right after calling setPullAtomCallback, it's possible that oneway binder calls can queue but do not execute before the process crashes. Then, when the process crashes, nothing has a strong reference to the IPullAtomCallback, so it gets deallocated. Then, when the oneway call actually executes, the callback is null. This is being followed up in b/155793159 Regardless, statsd should handle null input properly. Test: GTS test in ag/11348719 now passes Test: atest GtsStatsdHostTestCases Bug: 153822941 Change-Id: Ic6d415e10eca8d133290de80cb61e1634590ca6a
* Remove IStatsd reference from StatsLog.javaJeffrey Huang2020-04-211-77/+22
| | | | | | | | Also remove sendAppBreadcrumb binder api because it's no longer used. Bug: 154264326 Test: atest com.google.android.statsd.gts.StatsdHostTestCases Change-Id: Ic51a057bb01a89a24337521a49c54a52e2073cd1
* Merge "Remove Exception in getRegisteredExperimentIds" into rvc-devJeffrey Huang2020-04-011-4/+0
|\
| * Remove Exception in getRegisteredExperimentIdsJeffrey Huang2020-03-311-4/+0
| | | | | | | | | | | | | | | | | | | | | | This check was not useful since service can only be null if system server is not running or the app does not have permissions to access statsd. This check is not done anywhere else, so removing it for consistency. Bug: 150645647 Test: atest StatsdHostTestCases Change-Id: I6465697f0157c5a9583025979c55cb2e3dc1ef84
* | Guardrail for pull cooldown/timeoutTej Singh2020-03-301-2/+3
|/ | | | | | | | | | | Enforce a 1 second minimum cooldown and a 10 second maximum timeout on pullers. Test: bit statsd_test:* Test: atest LibStatsPullTests Test: atest GtsStatsdHostTestCases Bug: 152543610 Change-Id: Ida0047235a7e56d7b700f1a7ab5cfbc2a147caeb
* Merge "Allow annotations to be added to Atom Id" into rvc-devMuhammad Qureshi2020-03-241-13/+35
|\
| * Allow annotations to be added to Atom IdMuhammad Qureshi2020-03-231-13/+35
| | | | | | | | | | | | | | | | | | | | | | | | Add atom-level annotations support in StatsEvent.java setAtomId must be called right after StatsEvent.newBuilder(). Calling setAtomId out of order results in ERROR_ATOM_ID_INVALID_POSITION. Bug: 151158793 Test: atest FrameworkStatsdTest Change-Id: Ib574f079227660193e12b3aa37136d36e154479a
* | Wrap StatsDimensionsValue over structured parcelRuchir Rastogi2020-03-231-161/+83
|/ | | | | | | | | | | | | | Reduces code complexity by leveraging the readFromParcel and createFromParcel functions created in the autogenerated StatsDimensionsValueParcel class. Wrote a unit test that checks the conversion from a StatsDimensionsValueParcel to a StatsDimensionsValue. Test: atest FrameworkStatsdTests Test: atest GtsStatsdHostTestCases Bug: 149103391 Change-Id: I64850c6b962a68799d51a26138e95cb1e0c99aee
* Address Puller API FeedbackTej Singh2020-03-051-40/+42
| | | | | | | | | | | | | | | | | | | | 1. Rename registerPullAtomCallback to setPullAtomCallback 2. Rename unregisterPullAtomCallback to clearPullAtomCallback 3. Add getters to PullAtomMetadata 4. Change Ns to Millis (when I tried to make it Nanos, I received a built time error saying to prefer millis unless we need the precision. We do not need the precision, so I changed it). 5. Fix out of order params. I did not change usePooledBuffer to setPooledBuffer because I think use is more appropriate for our use case. Test: make Test: atest PullAtomMetadataTest Test: atest GtsStatsdHostTestCases Bug: 149475498 Change-Id: Ib07aa57a6e02c77917fe0e65a3d4a77c00ce8565
* Catch IllegalStateException in StatsManagerJeffrey Huang2020-02-201-0/+15
| | | | | | | | | StatsManagerService throws IllegalStateException when statsd is not available. This causes GMSCore to crash. Bug: 149914783 Test: Manual, verify play store no longer crashes Change-Id: I45cd679600ccfdb7977ecfd4437b62f56034fed2
* Remove libstats_jni from the platformTreeHugger Robot2020-02-141-0/+5
| | | | | | | | | | | As part of statsd becoming a mainline module in R, libstats_jni needs to live in the apex. Bug: 148620413 Test: m Test: fastboot flashall Change-Id: I22c2816c863e7a4462a79ac99238b06aca40a2d6
* Finalize @SystemApi annotation for StatsFrameworkInitializer (retry)Makoto Onuki2020-02-111-2/+2
| | | | | | Change-Id: I3c8bce84fbdbe4e65ec430eb5046a1a46cc6fbfb Fix: 148225705 Test: build / treehugger
* Merge "Revert "Finalize @SystemApi annotation for StatsFrameworkInitializer""Makoto Onuki2020-02-101-2/+2
|\
| * Revert "Finalize @SystemApi annotation for StatsFrameworkInitializer"Makoto Onuki2020-02-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | This reverts commit d74a3b3ca753b3308ac9ebb56b253c5a658d789d. Reason for revert: Broke build(?) Bug: 148225705 Change-Id: I46e4aec3385d178234d3ea609c190b14aca5c8a1
* | Merge "Finalize @SystemApi annotation for StatsFrameworkInitializer"Makoto Onuki2020-02-101-2/+2
|\|
| * Finalize @SystemApi annotation for StatsFrameworkInitializerMakoto Onuki2020-02-071-2/+2
| | | | | | | | | | | | Change-Id: I2a7f8fcecbd12da4d8244fd848dff53ba86d4e31 Fix: 148225705 Test: build / treehugger
* | ServiceManager --> StatsFrameworkInitializerMuhammad Qureshi2020-02-091-2/+5
| | | | | | | | | | | | Bug: 149128236 Test: m Change-Id: I6b506128b4990fa24d745da978608fe3d68a1d8f
* | FrameworkStatsLog --> StatsdStatsLogMuhammad Qureshi2020-02-091-5/+5
| | | | | | | | | | | | | | | | Create a new StatsLog module for statsd apex Bug: 149128236 Test: m Change-Id: I48bc2b47c0fbcffd6a8ac646323cafb107358ec9
* | Remove more Slog usages in statsd apexMuhammad Qureshi2020-02-093-28/+28
| | | | | | | | | | | | | | | | Slog.* --> Log.* Bug: 149128236 Test: m Change-Id: I926f292dd5562af132774670c35fe2ca4e853bf8
* | Merge "Add support for multi train logging"Howard Ro2020-02-081-43/+2
|\ \
| * | Add support for multi train loggingJonathan Nguyen2020-02-071-43/+2
| |/ | | | | | | | | Test: atest GtsStatsdHostTestCases Change-Id: I4ca7089347d6dfab8a33c07acd5ef9c252413ec9
* / Use StatsDimensionsValueParcel within statsd apexRuchir Rastogi2020-02-071-0/+41
|/ | | | | | | | | | Because statsd now uses StatsDimensionsValueParcel instead of StatsDimensionsValue.h/c, statsd no longer has to depend on libservices. Test: m -j Test: atest StatsdHostTestCases#testBroadcastSubscriber Bug: 148604617 Change-Id: I6d65383ccec99f4672d6575232981c0f6cc40fcf
* Merge "Move StatsLog.java to fw-statsd.jar"TreeHugger Robot2020-02-061-0/+273
|\
| * Move StatsLog.java to fw-statsd.jarTej Singh2020-02-051-0/+273
| | | | | | | | | | | | Test: atest GtsStatsdHostTestCases Bug: 146578693 Change-Id: I7244c6099d16c5c7da14060a1a5fa0c866199754
* | Create REGISTER_STATS_PULL_ATOM permissionMuhammad Qureshi2020-02-051-2/+4
|/ | | | | | | | | | Create a permission to allow clients to register pull atom callbacks to statsd. This permission should allow mainline modules and other platform clients register puller callbacks, but is not intended for 3p apps. Bug: 146462168 Test: atest CtsPermission2TestCases Change-Id: Iea50d137e2cc9f34644c8aa9548a7445f5ec16b8
* Move StatsDimensionsValue.java to statsd apexTej Singh2020-02-031-0/+354
| | | | | | Test: builds, boots Bug: 146578788 Change-Id: Iaeb9eaf8c412964ccf57debca1445063e9120ef9
* Cleanup StatsPullAtomServiceJeffrey Huang2020-01-271-20/+0
| | | | | | | | | | Move all variable declarations to top of file Delete unused puller registrations Migrate to new API Test: m -j Bug: 145565211 Change-Id: I03890e333dd179be3b8d075657cf84a2247a473c
* Migrate away from using ServiceManagerJeffrey Huang2020-01-232-2/+82
| | | | | | | | | Create a wrapper class to access binder objects published by statsd mainline module Bug: 147923515 Test: atest com.google.android.statsd.gts.StatsdHostTestCases Change-Id: I9ea3677d88c790c856e4e89318ae2ce67ac7df1e
* Migrate StatsManager to apexJeffrey Huang2020-01-231-0/+722
| | | | | | | | | | | | | | | | Link frameworks-statsd.jar against framework-all since it is currently infeasible to to link against stubs Linking against stubs in frameworks/base cannot be done because we still have StatsLog that calls StatsEvent.getBytes which is a hidden API. We can't move StatsLog to the apex because of hidden APIs in the autogenerated code which is currently being migrated. Test: m -j Bug: 147923515 Change-Id: I0a59dce83a8075bdde3e72d1d8eceef2ed572791
* StatsEvent @SystemApiMuhammad Qureshi2020-01-151-18/+12
| | | | | | | | | Make StatsEvent and StatsLog.write(StatsEvent) @SystemApi. Bug: 146383532 Test: m Change-Id: I15050734e757bdb622fb83e3ef244a6ebd26923b
* Create framework-statsdMuhammad Qureshi2019-12-161-0/+829
Create framework-statsd jar in statsd apex. Move StatsEvent to framework-statsd.jar. Right now, frameworks jar links against framework-statsd directly. This should be changed to link against framework-statsd-stubs. Bug: 145923096 Bug: 145923116 Bug: 142810493 Test: m Test: flashes successfully Test: adb shell cmd stats print-logs && adb logcat "*:S statsd:*" Change-Id: Ife224abd5c9b9b0eeab681dc4b7f71c0bdb856b1