ServiceManager:
- Do an event log every N getService() calls with total time spent
in getService().
where N = 100 for core UIDs and 200 for other apps.
- Do an event log if getService() takes longer than N ms.
where N = 10 for core UIDs and 50 for other apps.
... with some extra throttling.
NPMS:
- Do the basic "stats logger" log for updateNetworkEnabledNL() and
isUidNetworkingBlocked()
This CL also enhances StatsLogegr so it now can show the slowest call
and the max # of calls per-second.
Bug: 77853238
Test: Manual test:
- Insert a SIM card
- Set data limit
- toggle airplane mode
- toggle wifi
- toggle mobile data
Then
- "dumpsys netpolicy" and "dumpsys activity processes" and check the stats
- also check "adb logcat -b all | grep ' service_manager'"
Change-Id: I5789541063f95d0eac501189816c8604a4571ba0
This is so unbundled applications (e.g. dreams) can present a charge
time indicator that is in sync with the rest of the system.
Bug: 77919650
Test: manual
Change-Id: I7d62dea4fd49eb173b4f052a0fc36f4e7ce5b6bb
When StatsManager fails to connect to statsd, it now throws an exception
for the caller to catch. It also throws an exception of the config being
added is of an unreadable format.
Due to backwards compatibility issues, the old APIs could not be
changed, so new ones were made to replace the old ones. The old ones are
now temporary and will be removed when the compatibility issue is
resolved.
Bug: 77648233
Test: gts-tradefed run gts-dev --module GtsStatsdHostTestCases
Change-Id: Ibea05883a29b9b3ef9927d2f8fe295eb99832ab7
The sipper was added in http://ag/3667626 but BatteryStats wasn't
updated to properly output the data.
Bug: 77877717
Test: flash device and check batterystats output
Change-Id: Ibf98545a147f2d62dd29c57dd7efa14ed4c58aa6
To reduce log spam, we do not log all hidden API accesses. This CL allows
configuration of the sampling rate of the log events so it can be tweaked
later if necessary.
Test: m
Test: $ adb shell settings put global hidden_api_access_log_sampling_rate 65536
Bug: 64382372
Bug: 77517571
Change-Id: I659c22bd504564da58d972f94b774a9af4039386
The RELEASE field has no guaranteed internal structure and developers
should not attempt to parse it.
Test: no code changes
Change-Id: I0ea3ab5ba5dd4cc733feb62725cf7c62c00c857b
When removing an FD listener from a MessageQueue, the MessageQueue waits
until the next event callback on that FD to remove it from the
underlying native Looper.
This works as expected most of the time, but due to the epoll rebuild
logic in the native Looper, there is a rare condition where FDs can get
stuck in the Looper:
1. Register two or more FD listeners.
2. Unregister FD1 listener and close FD1.
3. Before the Looper processes FD1, get an event on FD2 and close it.
(3) will trigger a rebuild of the epoll set but as FD1 is no longer
valid it cannot be added back to the epoll set, and the MessageQueue
will never get the final callback to clean it up.
Each time this happens:
* There is a small memory leak (24-32 bytes) in native Looper
* Rebuilding the epoll set incurs slightly more processing
* An error is logged for each lost FD on each epoll rebuild
This is fairly minimal, and does get cleaned up if the lost FDs is
re-opened during an epoll rebuild (since it can now be added back in),
but worst-case if a process somehow triggers this on a large number of
FDs it might be noticeable.
It seems worth it to just remove the FD explicitly right away to avoid
this case altogether.
Bug: 64083817
Test: [aosp_x86-userdebug emulator] adb shell am instrument -w \
-e class android.os.cts.MessageQueueTest \
android.os.cts/android.support.test.runner.AndroidJUnitRunner
Change-Id: I5093ca0d576473f490347ab4244af11a2835d23a
(cherry picked from commit 57f25ad657)
It fails to read exception from Parcel using
Parcel#readException(int, String) because this method doesn't take into
account the remote stack trace info added in writeException().
Test: Manual
Bug: 77495513
Change-Id: I7b646b4a591306832897a42c4ed205d00019cc2b
Methods previously marked as @hide which are used from cts were marked
as @TestApi
Bug: 74227356
Test: Look through the code of VibrationEffect.
Change-Id: I83cd9b9f19c43467bb310598c6b390583908a162
Adds new API methods to enable and disable these warnings.
(cherry-picked from commit ad1b2a9cc1)
Bug: 73896556
Test: StrictModeTest
Change-Id: I096ce4c355c79cde1b98c3f48d392cd0b2ea5d98
Adds new API methods to enable and disable these warnings.
Bug: 73896556
Test: StrictModeTest
Change-Id: I049812fcdc79f191ab627766f66fc6f51b82e3d1
Merged-In: I096ce4c355c79cde1b98c3f48d392cd0b2ea5d98