The previous package name was wrong. When the kWhiteListedAtoms was
removed, the breadcrumb atom was no longer being logged properly due to
the incorrect package name.
Bug: 159768218
Test: atest LibStatsPullTests
Change-Id: I2277d205d66ef0cdc4954990db0cd783d5d5401e
Tethering package.
Tethering needs StatsEvent and StatsLog which are in
framework-statsd.stubs.module_lib to write metrics.
Bug: 153942334
Test: make
Change-Id: I8ba142a9b3678de36e6c4880a64e992e00680f38
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
Removes use of the special framework-modules naming scheme.
Bug: 155164730
Test: m java
Exempt-From-Owner-Approval: Build cleanup.
Change-Id: I3b78fcbcacc3df787e171d6eedeef1e51b087615
Merged-In: I0c31e2183353dfb5bd49f04f3455cb7b10be6866
(cherry picked from 8b864fb45c)
Change package of StatsdStatsLog from com.android.internal.util to
com.android.internal.statsd
Test: atest GtsStatsdHostTestCases
Bug: 157649935
Change-Id: Iee2af03c950b7cc054f7d77e721694a7f429ae9d
Switching from java_library to java_sdk_library switched the meaning
of the module name from referring to the implementation library to
referring to the stubs. This change updates the visibility rules to
reflect that new meaning.
Visibility rules that were previously set for the java_library have
been moved to the impl_library_visibility property and the special
//visibility:override value has been prepended to prevent it from
inheriting the values from the visibility property.
Visibility rules set for the stubs (via stubs_library_visibility)
property have been moved to the visibility property.
Bug: 155164730
Test: m nothing
Exempt-From-Owner-Approval: Build cleanup
Change-Id: Icc9bc5a9ef86cf7ba0f15c2b2a4abd596ec9f640
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
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
Pending changes to libnativehelper API mean modules should not depend
on it as a stable API.
Bug: 157711673
Test: atest FrameworkStatsdTest LibStatsPullTests
Change-Id: I708a1489b5a1e30185b7e3677393c446074dc96c
The names of the individual modules do not quite follow the pattern
that java_sdk_library uses so this temporarily sets the following:
naming_scheme: "frameworks-modules"
That causes java_sdk_library to use a naming scheme that matches the
one used by the individual modules of this. It will be cleaned up
later.
Test: m update-api
Bug: 155164730
Change-Id: Iadb4020a8b97c7f1eed8ee6752d91e827404441e
A bug in Soong prevented the permitted package check from being
performed. Fixing the bug revealed that there was a missing package
on framework-statsd which this change adds.
Test: m framework-statsd
Bug: 157633658
Change-Id: Ic0602b9c4a65b57c1ee87ba2fcfaf82c2606e640
There was a race condition in which pulling alarms can be cancellled
after they are initialized, causing bucket boundary pulls to fail.
Test: manually verifified alarm consistently cancelled before being set
Test: manually verified alarms were properly cancelled on statsd crash
Fix: 156855909
Change-Id: I913b6f3e3d03269fb9283199f8b9d666a298e145
This CL aims to fix two race conditions:
1. When statsd restarts after a crash, the ordering of sayHiToStatsd and
binderDied is not guaranteed. However, previously, we assumed that
binderDied would get called first and reset sStatsd to null. To solve,
we don't assume a function ordering and don't throw an error message in
sayHiToStatsd if sStatsd is not null.
2. When statsd was linked to death, the death recipient was not informed
about all broadcast receivers. Thus, the death recipient might have
known only a partial list of receivers when #binderDied was triggered. To
solve, we make sure that the death recipient knows about all receivers
before we link to death.
Test: atest statsd_test
Test: atest CtsStatsdHostTestCases
Bug: 154275510
Change-Id: I11be65ca2135cde200ab8ecb611a363d8f7c2eb6
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
This adds checking of module api compatibility to the individual module
api rules. Until now, this checking has been done via the monolithic
metalava runs which we are aiming to get rid of.
Now is a good time to do this because we can compare them to the just
finalized version 30 API, which we have no diffs with. Baseline the
existing wifi failures that metalava fails to find in the previous API.
Bug: 144149403
Test: m checkapi
Change-Id: Id222895daa3a769c265965b052a17d5a1ca18462
This makes the filenames of the disted artifacts (api txts and stubs)
match the module name of the modules they're from. This matches the
naming scheme used by java_sdk_library, which should make the future
transition to this build rule easier.
Bug: 149293194
Test: lunch sdk_phone_armv7 && m sdk dist && find out/dist/apistubs
Change-Id: I076f30931bf2524d57703873cd7de25b3f23b457
Also remove sendAppBreadcrumb binder api because it's no longer used.
Bug: 154264326
Test: atest com.google.android.statsd.gts.StatsdHostTestCases
Change-Id: Ic51a057bb01a89a24337521a49c54a52e2073cd1
With b/152655547, all aidl_interface modules are considered as stable
unless it is explicitly with "unstable: true". This change marks the
aidl_interface that are not used across updatable module bounraries
as unstable, so that the build system does not run the API
dumping/checking on them.
Bug: 152655547
Test: m
Change-Id: I1257c66de6dd42b2d32d47ed74cb2878f79d14fb
We no longer need to do this because UserManager.getUserHandles and
PackageManager.getInstalledPackagesAsUser are now called in a separate
background thread.
Bug: 130773130
Test: adb shell stop statsd && adb shell start statsd. Manually verified
that the uidmap was sent successfully.
Change-Id: Ifde1ba09575a479952bdbcd98aec4c34b3210974
Because of internal implementation of one way binder calls, in order to
unblock the boot phase, we need to put both the binder call and the
filedescriptor in the background thread.
Original boot time: 17758.6ms
New boot time: 17608.0ms
Bug: 130773130
Test: DeviceBootTest.DeviceBootTest#SuccessiveBootTest
Change-Id: Ib3524418a387c5902af8139e1b2aee82525b8e04
In cf, signing key has been changed to dev key. So LibStatsPullTests
tests is changed to device-tests.
Change-Id: I5971ae584afeebccc0ba3ed55e6579858666db79
Bug: 153482272
Test: m -j
Link libgtest_prod, libprotobuf-cpp-lite, and libc++ statically.
This reduces the size of the statsd apex from 2.8M to 1.6M.
Initial:
blueline:/apex/com.android.os.statsd # du -h
16K ./lost+found
764K ./bin
1.3M ./lib64
8.0K ./etc
600K ./lib
120K ./javalib
2.8M .
After linking proto lite and libgtest_prod statically (saves ~500kb):
blueline:/apex/com.android.os.statsd # du -h
16K ./lost+found
800K ./bin
876K ./lib64
8.0K ./etc
600K ./lib
120K ./javalib
2.3M .
After also linking libc++ statically (saves ~700kb):
blueline:/apex/com.android.os.statsd # du -h
16K ./lost+found
0.9M ./bin
296K ./lib64
8.0K ./etc
204K ./lib
120K ./javalib
1.6M .
After this change, the only libraries in both /lib and /lib64 are:
libstats_jni.so
libstatspull.so
libstatssocket.so
These are the 3 libraries we actually want to ship.
Test: m
Test: bit statsd_test:*
Test: atest GtsStatsdHostTestCases
Test: manually inspecting the size of the apex, statsd binary, and
libraries
Bug: 153349706
Bug: 153349659
Bug: 153350187
Change-Id: I00796fc1cf33e394422c6dc617a8430a5f5c5bbb
APEXes introduced in R need to set min_sdk_version to ensure that they
are built against correct version(30 or R) of stubs (libc/liblog/...).
Bug: 152655956
Test: /vendor/google/build/build_mainline_modules.sh
Change-Id: I4a893c34b09334eea124266287301e479b9e8a59
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
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
It was referring to the systemapi defaults, which is incorrect.
I noticed this as I was adding all the stub txt variants to dist.
Bug: 147768409
Test: m
Change-Id: If12fe22c92fbfc82a6efce9c466990d9c3da242e
Makes it convenient to change all stubs from a central place.
Also remove the framework-statsd-defaults that were only used
in a single place.
Bug: 149293194
Test: m framework-statsd-stubs{public,system,module_libs_}api
Change-Id: Ib2e01cddfaceb7f24fd2e60c3a365a79a035bcae