summaryrefslogtreecommitdiff
path: root/core/java/android/util/EventLog.java
Commit message (Collapse)AuthorAgeFilesLines
* EventLog: Disable event writing in production buildsDanny Lin2023-01-031-10/+64
| | | | | | | | | | | | | | | | | | | When opening and closing activities in Settings, a measurably significant amount of CPU time is spent writing to the EventLog, as reported by simpleperf: 0.01% /system/lib64/libandroid_runtime.so android::EventLogHelper<(log_id)2, &(android::kEventLogEventClass)>::writeEventArray(_JNIEnv*, _jobject*, int, _jobjectArray*) We have no use for EventLog events in production builds, so disable event writing entirely on non-debuggable builds. To avoid having to check ro.debuggable in native code and pay the overhead of a JNI call for every event, perform checks on the Java side and make the native method implementations private for delegation. Test: simpleperf record -a; verify that EventLogHelper no longer appears in sample hits Change-Id: I3505c460f234d9a5038bd1f9d41ce911697ca76e (cherry picked from commit 34800851c95ddb4c9f5b680225647eb3cbd4da2f)
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-1/+2
| | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. This is a resubmit of ag/12929664 with some APIs excluded that caused test failures; see bugs 171886397, 171888296, 171864568. APIs excluded: Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord; Landroid/os/Process;->myPpid()I Landroid/os/SharedMemory;->getFd()I Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I Bug: 170729553 Test: Treehugger Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
* Revert "Add maxTargetSdk restriction to unused APIs."Hongwei Wang2020-10-281-2/+1
| | | | | | | | | This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6. Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397 Bug: 171886397 Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-271-1/+2
| | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
* Merge "Cleanup references to system/core/liblog -> system/logging/liblog" ↵Treehugger Robot2020-10-271-1/+1
|\ | | | | | | | | | | | | | | am: f8f8acfe12 am: 5a42765d79 am: 5074242416 am: 787e21b77b Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1474156 Change-Id: Idfe4567808bf33f29bbe4c8072640e6d4955aba7
| * Cleanup references to system/core/liblog -> system/logging/liblogBaligh Uddin2020-10-261-1/+1
| | | | | | | | | | | | BUG: 170387172 Test: TH Change-Id: Ifb2bd2c3db97c52baeac6f2e3643dabf6fcfde6e
* | Add @Nullable annotation to the parameter of Object.equals() methods.Roman Kalukiewicz2020-10-151-1/+1
|/ | | | | | | | | | | | | | | | | | Those annotations could be inferred by some tools (like Kotlin), but the https://checkerframework.org/ doesn't check inherited annotations complaining about all equals() invocations that get nullable argument. The change was generated by running find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /' in the frameworks/base directory and by automatically adding and formatting required imports if needed. No manual edits. Bug: 170883422 Test: Annotation change only. Should have not impact. Exempt-From-Owner-Approval: Mechanical change not specific to any component. Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
* Support security logging on org-owned managed profile devicesRubin Xu2020-02-201-13/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When security logging is enabled on org-owned profile devices, Security events will be redacted to preserve privacy on the personal profile as follows: * TAG_ADB_SHELL_CMD Shell command will be redacted. * TAG_MEDIA_MOUNT * TAG_MEDIA_UNMOUNT The media's volume name will be redacted. * TAG_APP_PROCESS_START * TAG_CERT_AUTHORITY_INSTALLED * TAG_CERT_AUTHORITY_REMOVED * TAG_KEY_GENERATED * TAG_KEY_IMPORT * TAG_KEY_DESTRUCTION * TAG_KEY_INTEGRITY_VIOLATION Only events happening inside the managed profile will be returned to the admin. Bug: 148437300 Test: atest FrameworksServicesTests:DevicePolicyManagerTest Test: atest FrameworksServicesTests:SecurityEventTest Test: atest FrameworksCoreTests:EventLogTest Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSecurityLoggingWithSingleUser Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSecurityLoggingWithTwoUsers Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSecurityLoggingEnabledLogged Test: atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testSecurityLogging Change-Id: I2e52229a3163b3e0dc3d80d71700023394d84587
* Use new UnsupportedAppUsage annotation.Artur Satayev2020-01-071-1/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I288969b0c22fa3a63bc2e71bb5009fe4a927e154
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-141-0/+2
| | | | | | | | | | | | | | | | | | | For packages: android.util.proto android.util.jar android.util.apk android.util This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: Ia0f48c244b0fbe33d40d797702a82303648196ed
* expose the UID in the EventLog APIChris Wren2017-04-281-0/+15
| | | | | | Bug: 32806111 Test: runtest --path frameworks/base/core/tests/coretests/src/android/metrics Change-Id: I16800a33bc6d4d37b3addd71b675fd760bd5d7b8
* Request logs from logd with 3s overlap to avoid missing events.Pavel Grafov2017-03-211-0/+23
| | | | | | | | | | | | | | | | Example: If we got a batch with timestamps [1, 4, 8] and an event with timestamp 7 was delayed and was added to the buffer later, if we request the next batch starting from timestamp 8 or 9 that event will be lost. The last 3 seconds of events are kept and checked against the next batch. Test: afw-test-tradefed-ci run afw-do-security-logging Change-Id: I55727cfc6143c172edc7dabfd995776f9a0f7eab Bug: 35373582 Bug: 35026180 Bug: 35648675
* add a signaled reader to the eventlogChris Wren2017-01-231-0/+15
| | | | | Test: manual using a logspammer app Change-Id: I89e3dda82d4d1d3fc6d343b634642687e550f70a
* resolve merge conflicts of 082a1721b516 to masterMark Salyzyn2017-01-111-1/+1
|\ | | | | | | | | | | | | Test: compile Bug: 26552300 Bug: 31289077 Change-Id: I17f178f425975c1c0dbd48091d25b101956d505e
| * Replace cutils/log.h and log/logger.h with log/log.hMark Salyzyn2017-01-091-1/+1
| | | | | | | | | | | | | | Test: compile Bug: 26552300 Bug: 31289077 Change-Id: I578b15b48f0fc2807a92abbc69a377c3d2191496
* | Don't WTF when reading empty data from the eventlogChris Wren2016-12-191-0/+26
|/ | | | | | | Bug: 33446064 Fixes: 33446064 Test: run cts -m CtsUtilTestCases -t android.util.cts.EventLogTest Change-Id: I4951202cd7d6ca441700b7122cfa3aae2167c7b0
* Add JNI bridge to the new logd security buffer.Rubin Xu2016-01-151-0/+12
| | | | | | Bug: 26127031 Bug: 22860162 Change-Id: I14e08850ece7d9c0229b7213ee2e25cd089defc1
* Add thread safety documentationNeil Fuller2015-11-261-1/+1
| | | | | | | | | An upcoming change will remove "synchronized" from the API docs. This change documents those cases where the guarantees can be determined from code inspection. Bug: 25767152 Change-Id: I75083ce01513ed315222304fe3f34190d40748cb
* Add float support to binary event log.Jeff Brown2015-04-281-3/+15
| | | | | Bug: 20664753 Change-Id: I90456400b878f943e39cbddec45649662176e2aa
* EventLog: event log translation errorsMark Salyzyn2014-04-251-7/+17
| | | | | | - Deal with L using v3 event log format, or K using v1 or v2 event log format Change-Id: Id4fb205f51b7e506135888d565acf1604497b91f
* Remove default constructors from static utility classes.Jesse Wilson2011-02-241-0/+2
| | | | | Change-Id: Id8dc55a30a03e1da87500b66c429de9268033b9e http://b/3344646
* Bumper un-@hide (un-@pending actually) of previously reviewed APIs:Dan Egnor2010-01-071-2/+0
| | | | | | - new Log methods for reportable conditions - EventLog publication, EventLogTags deprecation - a new stackTrace field in ProcessErrorStateInfo
* Remove old EventLog tests from here, they will be replaced by aDan Egnor2010-01-071-0/+1
| | | | | | (better) EventLog test in CTS. Fix some minor errors in the handling of too-large event log values.
* Simplify EventLog interface -- remove supported for nestedDan Egnor2010-01-061-167/+126
| | | | | | | | | | | | sequences (which nobody used) and streamline the API, adding documentation in preparation for inclusion in the SDK. Gut and deprecate EventLogTags, which unfortunately was put into the public SDK (an oversight). Include the functionality in EventLog proper, in a simpler and easier to use manner. This change doesn't actually un-@hide anything, but it does change it to @pending.
* Allow zero-length lists in EventLog entries.Dan Egnor2009-07-291-5/+1
| | | | | (I'm verifying that the consumers of EventLog -- logcat, checkin -- are OK with this.) Improve the error handling in RestoreSession.
* Add method to read events from a file. Remove unused method. Fixed after ↵Jim Miller2009-07-061-1/+10
| | | | review.
* Add getRawData() method for AggregationService.Jim Miller2009-06-081-2/+6
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+288
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-288/+0
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+288