summaryrefslogtreecommitdiff
path: root/core/java/android/os/DropBoxManager.java
Commit message (Collapse)AuthorAgeFilesLines
* Merge "DropBoxManager: use BufferedInputStream when using GZIPInputStream" ↵Tom Cherry2021-08-051-1/+3
|\ | | | | | | | | | | | | | | am: 92889d10fe am: afeee6a12b Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1786608 Change-Id: I23ff5312e8e3f42415b744fbd9184d5e42646a3c
| * DropBoxManager: use BufferedInputStream when using GZIPInputStreamTom Cherry2021-08-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | GZIPInputStream has a bug (b/195554062) where it uses unbuffered IO when reading the gzip header. This triggers the UnbufferedIoViolation strict mode violation for apps that target API level 28+. Independently of fixing GZIPInputStream, DropBoxManager can use BufferedInputStream to take a proactive step against this and future bugs. Bug: 195554712 Test: Successfully read gzip dropbox entries from API level 28+ app. Change-Id: Id539efcb366b3e3d53513a098975b25866ed16ff
* | DropBoxManager: Fix doc build errorShuzhen Wang2021-07-201-1/+1
| | | | | | | | | | | | Test: make doc-comment-check-docs Bug: 194230402 Change-Id: I38da2bbfbe7ed0a660274ec4d07e2b176a2a7542
* | Interface to dynamically generate DropBox data.Jeff Sharkey2021-01-121-35/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing DropBoxManager APIs require that data be entirely pre-cooked before it can be added. This adds significant overhead to Log.wtf() style messages which collect logcat data, since we need to copy that log data through a pipe to an in-memory buffer. To avoid that overhead, this change introduces an EntrySource interface which can either be pre-cooked data or dynamically generated data written directly to an open FD on disk. Future changes will adjust the Log.wtf() logic to use this new interface to have logcat write directly into an FD. In addition, this interface paves the way for leveraging a newer F2FS feature which transparently compresses and decompresses data in the kernel, instead of forcing us to use DEFLATE in userspace. This change drops periodic quota checking while recording new entries, and instead adjusts to pre-flight the quota checks before writing starts. It also drops the expensive fsync(), since these logs are collected on a best-effort basis. Bug: 176843501 Test: atest CtsDropBoxManagerTestCases Test: atest FrameworksServicesTests:com.android.server.DropBoxTest Change-Id: Ic78e99a32cfaf4edac066a73a6864c9c9e9fdeef
* | Merge "Update language to comply with Android's inclusive language guidance" ↵Treehugger Robot2020-07-311-1/+1
|\| | | | | | | | | | | | | | | am: e2d9b14b60 am: 6f22d2c310 am: 9bade16516 am: acbb11f541 am: 69194793fd Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382541 Change-Id: I0be07dc3bf70507f82a4005ccd7fe2d687d58d81
| * Update language to comply with Android's inclusive language guidanceLais Andrade2020-07-311-1/+1
| | | | | | | | | | | | | | | | | | See https://source.android.com/setup/contribute/respectful-code for reference BUG=162536543 Change-Id: Iea1f8c3d2a253cad5a6a429389bbe3fc5fd4bc6b
| * Use new UnsupportedAppUsage annotation.Artur Satayev2020-01-131-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: I534e3fd1305e2f4af076986770033478448a665c Merged-In: I534e3fd1305e2f4af076986770033478448a665c
* | Carry attributionTag for DropBoxManagerPhilip P. Moltmann2020-07-161-1/+2
| | | | | | | | | | | | | | | | | | - Use PermissionChecker instead of manully implement permission check - Need to keep old @UnsupportedUsage method Fixes: 161443379 Test: atest CtsAppOpsTestCases:android.app.appops.cts.AppOpsLoggingTest#getNextDropBoxEntry Change-Id: I5c3290c23312e8009a9345e8a58a6f734885f928
* | Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-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: I534e3fd1305e2f4af076986770033478448a665c
* Limit broadcast rate for low priority DropBox entriesMichael Wachenschwanz2019-03-271-1/+2
| | | | | | | | | | | | | | DropBox entry spamming can negatively impact system and apps listening to the ACTION_DROPBOX_ENTRY_ADDED broadcast. Global settings with the DropBox tag prefix can now mark low priority tags. Low priority tagged entries will have their ACTION_DROPBOX_ENTRY_ADDED broadcast delayed and the broad cast will be dropped in spammy situations. Bug: 119132031 Test: atest CtsDropBoxManagerTestCases Change-Id: I56554a15e0afb6e1686a33c59b3d6a8d426c2fc6
* Merge "Add EXTRA_DROPPED_COUNT for ACTION_DROPBOX_ENTRY_ADDED"Michael Wachenschwanz2019-03-221-0/+7
|\
| * Add EXTRA_DROPPED_COUNT for ACTION_DROPBOX_ENTRY_ADDEDMichael Wachenschwanz2019-03-211-0/+7
| | | | | | | | | | | | Bug: 119132031 Test: builds Change-Id: Ia6e67e9221f1cf99c6b7a49856b7e1e7d68272a9
* | Add @UnsupportedAppUsage annotationsAndrei Onea2019-03-151-0/+2
|/ | | | | | | | | | | | | | | | For packages: android.os 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: I4ece0a3f37f88fc2508cb965092aed7cabc61819
* All Parcelable CREATOR fields are @NonNull.Jeff Sharkey2019-02-281-1/+1
| | | | | | | | | If they were null, then the Parcelable would fail to work. Bug: 126726802 Test: manual Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014 Exempt-From-Owner-Approval: Trivial API annotations
* Protect usage data with OP_GET_USAGE_STATS.Jeff Sharkey2018-05-231-5/+17
| | | | | | | | | | | | APIs that return package usage data (such as DropBoxManager) must ensure that callers hold both the PACKAGE_USAGE_STATS permission and the OP_GET_USAGE_STATS app-op. Bug: 78355661 Test: Search output directory for binaries that have READ_LOGS but not USAGE_STATS and find none. Change-Id: I85e3bad680bb510439d73c7db5cc50cdcb7bbb42
* Annotate @SystemApi with required permissions.Jeff Sharkey2017-06-051-4/+2
| | | | | | | | | | | | | | | | | Most @SystemApi methods should be protected with system (or higher) permissions, so annotate common methods with @RequiresPermission to make automatic verification easier. Verification is really only relevant when calling into system services (where permissions checking can happen on the other side of a Binder call), so annotate managers with the new @SystemService annotation, which is now automatically documented. This is purely a docs change; no logic changes are being made. Test: make -j32 update-api && make -j32 offline-sdk-docs Bug: 62263906 Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
* Fix some issues found by new doclava linter.Jeff Sharkey2017-04-251-0/+3
| | | | | | | | | Add missing API annotations for permissions and SdkConstants, and invoke doclava with new "-android" flag. Test: make -j32 offline-sdk-docs Bug: 37526420 Change-Id: I970bb2655eb568fd25004636f134c794663a6c33
* Log when pre-N apps send too much to DropBox.Jeff Sharkey2016-03-091-2/+23
| | | | | | | | | Once they target N, they'll start getting exceptions, which is intended to make sure they pay attention to data that would have otherwise been dropped on the floor. Bug: 27571535 Change-Id: I49163679c629cd0788327d2c3a654e757ecdcb99
* When system server goes down, crash apps more.Jeff Sharkey2016-02-271-5/+21
| | | | | | | | | | | | | | Similar to first patch, but now using new "rethrowFromSystemServer()" method which internally translates DeadObjectException into DeadSystemException. New logic over in Log.printlns() now suppresses the DeadSystemException stack traces, since they're misleading and just added pressure to the precious log buffer space. Add some extra RuntimeInit checks to suppress logging-about-logging when the system server is dead. Bug: 27364859 Change-Id: I05316b3e8e42416b30a56a76c09cd3113a018123
* Fix DropBoxManager.Entry parcels with fds.Tim Kilbourn2015-06-031-1/+2
| | | | | | | | | | | | When the socketpair communication channel was added to ParcelFileDescriptor, the CREATOR method for DropBoxManager.Entry was not updated to read the extra fd from the Parcel. This was causing reads to end too early. Also removed comments referring to the now-deleted native methods in the native Parcel implementation. Change-Id: I49a9691da6ea927382ceb2fcbfdc7985a601111b
* Remove unused imports from frameworks/base.John Spurlock2013-11-201-3/+0
| | | | Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
* resolved conflicts for merge of 4b94c451 to stage-korg-masterJean-Baptiste Queru2010-12-131-0/+24
|\ | | | | | | Change-Id: I07b974f96ca598677e58623050e4668822e68f23
| * Added dropbox broadcast notificationHakan Still2010-12-081-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | To monitor the dropbox an application have to either poll the dropbox and keep track of all entries or observ the /data/system/dropbox directory. The later requires that the application runs as system-user. This commit adds that a broadcast intent is sent when something is written to the dropbox and an application can just listen on this intent and then reads the entry with help of the DropboxManager class. The application have to hold the permission android.permission.READ_LOGS to get the intent. Change-Id: I1f77f206a243df69f4ed5306078c47f7bf6181ec
* | am 383e95e2: Merge "DropBox: Read until the end of stream has been reached"Brad Fitzpatrick2010-11-161-1/+6
|\| | | | | | | | | * commit '383e95e245ceb87a2a6ad6422404ce641f0e08eb': DropBox: Read until the end of stream has been reached
| * DropBox: Read until the end of stream has been reachedChristian Lindeberg2010-11-161-1/+6
| | | | | | | | | | | | | | Read the requested length or until the end of the input stream has actually been reached. Change-Id: I01bc0b81eca0225209bdd288dde6a778a19d1e2c
* | DropBoxManager.Entry implements CloseableBrad Fitzpatrick2010-10-081-1/+2
| | | | | | | | Change-Id: I61716c06b92fa1b9b5b271b5805550bdb2d51b46
* | More DropBoxManager javadoc love.Brad Fitzpatrick2010-10-071-2/+2
| | | | | | | | Change-Id: I9b14f6905533e0af66bd64fc76352ed8fc365058
* | DropBox.Entry javadoc syntax fixBrad Fitzpatrick2010-10-071-1/+1
| | | | | | | | Change-Id: I32d055b39ca89ec9f6a7bf189263844424533b60
* | am e8605af5: Merge "Avoid leaking file descriptors when returning drop box ↵Dan Egnor2010-07-211-32/+57
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | events." into froyo Merge commit 'e8605af513e846f6cd223c9e92461189727d8c9b' into gingerbread * commit 'e8605af513e846f6cd223c9e92461189727d8c9b': Avoid leaking file descriptors when returning drop box events.
| * | Avoid leaking file descriptors when returning drop box events.Dan Egnor2010-07-211-32/+57
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | We can't use Parcel.writeValue() to write the ParcelFileDescriptor, otherwise it leaks when returning the value to the caller (the flag gets lost). Change the way DropBoxManager.Entry gets serialized so that it uses a bit of its own flags value to track whether the data is a byte[] or a ParcelFileDescriptor. Modify the dropbox unit test to add extensive checking of Entry serialization and deserialization under various circumstances, and to include a regression test to ensure that FD leaking doesn't happen. Bug: 2847738 Change-Id: I4ccd17dd03ffab234340cd359e6f3510fdf81193
* / Dropbox: remove redundant Entry construction.Brad Fitzpatrick2010-06-141-1/+1
|/ | | | Change-Id: I55d8da82acea7f1cf0a69912fe5d4d46d704b570
* Change the DropBoxManager API slightly (this is public, but not yet released) --Dan Egnor2009-11-251-7/+14
| | | | | | take a File instead of a ParcelFileDescriptor (gets opened internally) -- that way the caller doesn't have to worry about closing their PFD and so on. (Pretty much 100% of the time the caller will be uploading a file, anyway.)
* Fix the SDK build.Dan Egnor2009-11-141-1/+1
|
* Rename [I]DropBox[Service] to [I]DropBoxManager[Service].Dan Egnor2009-11-121-0/+274
Un-hide the DropBoxManager interface, and update the public API accordingly.