summaryrefslogtreecommitdiff
path: root/core/java/android/print
Commit message (Collapse)AuthorAgeFilesLines
* Add method PrintManager#isPrintServiceEnabled(ComponentName)Erik Wolsheimer2022-03-292-0/+28
| | | | | | Bug: 180582919 Test: atest FrameworksCoreTests Change-Id: I2f7e87d9e56f3abc22c04eee3e0863d5de48a9f9
* Revert "Revert "Migrate unsafe parcel APIs in framework-minus-apex""Bernardo Rufino2022-01-193-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 331be9a6431d6489f8d1e1b80cb510d0ee073c50. Reintroducing ag/16366278 since it seems unrelated to b/214053959 (more details on b/214053959#comment55). Original commit message: Migrate unsafe parcel APIs in framework-minus-apex Migrate the following unsafe parcel APIs in framework-minus-apex: * Parcel.readSerializable() * Parcel.readArrayList() * Parcel.readList() * Parcel.readParcelable() * Parcel.readParcelableList() * Parcel.readSparseArray() This CL was generated by applying lint fixes that infer the expected type from the caller code and provide that as the type parameter (ag/16365240). A few observations: * In some classes we couldn't migrate because the class also belonged to another build module whose min SDK wasn't current (as is the case for framework-minus-apex), hence I suppressed the lint check (since I'll eventually submit the lint check to the tree). * In some cases, I needed to do the cast in https://stackoverflow.com/a/1080525/5765705 to make the compiler happy since there isn't another way of providing a class of type Class<MyClassWithGenerics<T>>. * In the readSerializable() case, the new API also requires the class loader, that was inferred to by InferredClass.class.getClassLoader(). * Note that automatic formatting and import rely on running hooked up to the IDE, which wasn't the case here. Bug: 195622897 Change-Id: I272432e6e082a973f7a50492ec35d79c2b577c93 Test: TH passes
* Merge "Revert "Migrate unsafe parcel APIs in framework-minus-apex""Ashwini Oruganti2022-01-123-8/+8
|\
| * Revert "Migrate unsafe parcel APIs in framework-minus-apex"Bernardo Rufino2022-01-123-8/+8
| | | | | | | | | | | | | | | | This reverts commit 90bb3709dc75f7e44914222114752de5bce133d4. Reason for revert: b/214053959 Change-Id: Ic271bab1d3eaf677a5989dda9deb944ee2ad6850
* | Migrate unsafer parcel APIs [2]Bernardo Rufino2022-01-061-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | Manually migrate the few cases of: * readArray() * readParcelableArray() To the new parcel APIs that take the expected type as the last parameter. This enhances security because it prevents unexpected types *before* running unparcelling code. More details at go/safer-parcel. Owners, please check that the type of the objects expected is always a subtype of the type provided as the 3rd parameter. This is usually easy to verify due to casts that happen shortly after. These changes often allowed further transformations but I decided to avoid them to keep this change small and targeted. This was manual since it's tricky to get lint to infer the type in those cases and it was only a few. Bug: 195622897 Test: TH passes Change-Id: I262ed7cd6d3bc15b32e9296e88a8a67fdb59e880
* Migrate unsafe parcel APIs in framework-minus-apexBernardo Rufino2021-12-153-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrate the following unsafe parcel APIs in framework-minus-apex: * Parcel.readSerializable() * Parcel.readArrayList() * Parcel.readList() * Parcel.readParcelable() * Parcel.readParcelableList() * Parcel.readSparseArray() This CL was generated by applying lint fixes that infer the expected type from the caller code and provide that as the type parameter (ag/16365240). A few observations: * In some classes we couldn't migrate because the class also belonged to another build module whose min SDK wasn't current (as is the case for framework-minus-apex), hence I suppressed the lint check (since I'll eventually submit the lint check to the tree). * In some cases, I needed to do the cast in https://stackoverflow.com/a/1080525/5765705 to make the compiler happy since there isn't another way of providing a class of type Class<MyClassWithGenerics<T>>. * In the readSerializable() case, the new API also requires the class loader, that was inferred to by InferredClass.class.getClassLoader(). * Note that automatic formatting and import rely on running hooked up to the IDE, which wasn't the case here. Bug: 195622897 Test: TH passes Change-Id: I11a27b9bdab7959ee86e90aa1e1cbebd7aaf883c
* Merge "update L photo size name with JPN_ prefix" am: 2a46c6491f am: ↵Treehugger Robot2021-05-051-2/+2
|\ | | | | | | | | | | | | | | 70100919d0 am: 9e0ab4a327 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1697309 Change-Id: Id300ef712eda7bfab164044c95c807ebf4e9798f
| * update L photo size name with JPN_ prefixKurtis Schlepp2021-05-051-2/+2
| | | | | | | | | | | | | | | | Updates the Japanese Photo L media size name with JPN_ prefix Test: L is present in API with updated name Signed-off-by: Kurtis Schlepp <mopriadevteam@gmail.com> Change-Id: Ib4e52b23571b166f6c000676fb81b4ac7c1f9a7a
* | Merge "Add Japanese Photo L size" am: d8464708f6 am: edea4fa173 am: 6275761bbdTreehugger Robot2021-04-221-0/+4
|\| | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1527008 Change-Id: I12470fa6debd0ffb49ba18fdf9e1e5cef49a363a
| * Merge "Add Japanese Photo L size"Treehugger Robot2021-04-221-0/+4
| |\
| | * Add Japanese Photo L sizeKurtis Schlepp2021-04-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | L size media is very common in Japan, as listed at https://en.wikipedia.org/wiki/Photo_print_sizes. DPS and other print services must add their own definitions of this popular size. Including it in PrintAttributes will allow other software to leverage it instead of re-defining it, leading to a more consistent experience in the future. Test: L is present in API Change-Id: I7022881846d1bf46bda80b4825c5cba01b794821 Signed-off-by: Glade Diviney <mopriadevteam@gmail.com>
* | | Merge "add large format media sizes" am: 62bc98dd54 am: 33cc3922c1 am: ↵Treehugger Robot2021-04-211-0/+44
|\| | | | | | | | | | | | | | | | | | | | | | | 016db3711a Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1574587 Change-Id: Id294d2edc0f8d84a65f1a47318c2a23a75d87fd9
| * | add large format media sizesKurtis Schlepp2021-04-201-0/+44
| |/ | | | | | | | | | | | | | | | | Adds large format media sizes to expand media sizes supported by the BuiltInPrintService. Test: Print to a large format printer that supports arch media sizes Signed-off-by: Kurtis Schlepp <mopriadevteam@gmail.com> Change-Id: I83494d4e313c933cc8200646c77a6a0364ac2e44
* | Merge "Remove me from OWNERS files" am: 25ee5a7fb7 am: bf8de269cb am: 39198ddd84Philip P. Moltmann2021-02-112-2/+0
|\| | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1573324 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I429557a8537fb6417fcb9539978964ade75c8dee
| * Remove me from OWNERS filesPhilip P. Moltmann2021-02-112-2/+0
| | | | | | | | | | | | Test: n/a Change-Id: I6113011e6ab0997285d5b7a86303fc60a3b98a2b Exempt-From-Owner-Approval: Previously approved
* | resolve merge conflicts of 358f0d4fc8c248498cf113c41e043877a14e89a1 to masterJeff Sharkey2020-12-082-0/+10
|\| | | | | | | | | | | | | Bug: 174932174 Test: I solemnly swear I tested this conflict resolution. Exempt-From-Owner-Approval: refactoring with team leads buy-in Change-Id: I9262a08ffc1ccede8e519d0eed90ed2bfcf0232c
| * Improve OWNERS coverage across frameworks/base/.Jeff Sharkey2020-12-082-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As general background, OWNERS files expedite code reviews by helping code authors quickly find relevant reviewers, and they also ensure that stakeholders are involved in code changes in their areas. Some teams under frameworks/base/ have been using OWNERS files successfully for many years, and we're ready to expand them to cover more areas. Here's the historical coverage statistics for the last two years of changes before these new OWNERS changes land: -- 56% of changes are fully covered by OWNERS -- 17% of changes are partially covered by OWNERS -- 25% of changes have no OWNERS coverage Working closely with team leads, we've now identified clear OWNERS on a per-package basis, and we're using "include" directives whenever possible to to simplify future maintenance. With this extensive effort, we've now improved our coverage as follows: -- 98% of changes are fully covered by OWNERS -- 1% of changes are partially covered by OWNERS -- 1% of changes have no OWNERS coverage This specific change is automatically generated by a script from detailed ownership information confirmed by team leads. Bug: 174932174 Test: manual Exempt-From-Owner-Approval: refactoring with team leads buy-in Merged-In: I9789c97c1de8e5d962b48c29c57d82fe83729eba Change-Id: I9789c97c1de8e5d962b48c29c57d82fe83729eba
* | Add @Nullable annotation to the parameter of Object.equals() methods.Roman Kalukiewicz2020-10-158-11/+18
|/ | | | | | | | | | | | | | | | | | 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
* Update language to comply with Android's inclusive language guidanceJeff Sharkey2020-09-141-1/+1
| | | | | | | | | See https://source.android.com/setup/contribute/respectful-code for reference Test: none Bug: 168334533 Exempt-From-Owner-Approval: docs updates Change-Id: I245b8d9cac722da76ea67983738a3cbb9deb68df
* Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-184-4/+4
| | | | | | | | 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
* Add TEST_MAPPING for print and pdf testsPhilip P. Moltmann2019-10-112-0/+19
| | | | | Test: TH Change-Id: I7157c630fccb8b4d50672ac014e5cd020f1ac71f
* All Parcelable CREATOR fields are @NonNull.Jeff Sharkey2019-02-288-8/+8
| | | | | | | | | 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
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-07-314-0/+10
| | | | | | | | | | | | | | | | | | | For packages: android.printservice.recommendation android.printservice android.print.pdf android.print 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: I97fb9c95dad2f93a8e989f3f48f323e9f76eaf31
* Utility methods useful for working with files.Jeff Sharkey2018-07-111-1/+1
| | | | | | | | Part of getting DocumentsUI ready for building against public API. Test: builds Bug: 110959821 Change-Id: I7cc0acd5ac3bcc89790cb49f34291ae523e44019
* Hold wake lock while printingPhilip P. Moltmann2018-05-151-0/+9
| | | | | | | | | | | | | | | more specifically while any print job is - queued (ready to be printed but not yet printing) - started (actually printing right now) - cancelling (printing, but cancel request has been sent) Test: - Printed successfully - Canceled print job - Had print job that blocked Wake locks looked fine while doing all this Fixes: 74811014 Change-Id: Ia1a3327bd55fb7f3cc7ecb330d7d2c141d4fdb34
* Allow Print subsystem to work with services provided by instant appPhilip P. Moltmann2018-05-101-0/+17
| | | | | | | | | | | | | | Most functionality works, but the PrintActivity cannot directly interact with the instant service. As instant services should only appear in tests this functionality needs to be enabled via shell commands. Fixes: 79484768 Test: cts-tradefed run commandAndExit cts-instant-dev -m CtsPrintTestCases cts-tradefed run commandAndExit cts-dev -m CtsPrintTestCases Change-Id: Ie4663c72b8c0f959b5d172ef28875479d120e386
* Add RequiresFeature annotation.Jeff Sharkey2018-02-161-0/+3
| | | | | | | | | | Certain APIs require that a device have a specific feature to operate correctly, so start annotating them. Test: builds, boots Bug: 72284763 Change-Id: Ie2f30284bdfdb6acc4067f434eba3b5433837606 Exempt-From-Owner-Approval: simple annotations
* Move more folks to FileUtils.copy().Jeff Sharkey2018-02-011-22/+11
| | | | | | | | | | | | Also extend API to accept a "count" argument of exactly how many bytes to copy, and return the actual number of copied bytes. Improve docs. Test: bit FrameworksCoreTests:android.os.FileUtilsTest Test: vogar --mode app_process --benchmark frameworks/base/core/tests/benchmarks/src/android/os/FileUtilsBenchmark.java Bug: 71932978 Change-Id: I8d255e4f97462838c02a8ecb6d2d221188c4eff0
* Add more IntDef prefixes for auto-documenting.Jeff Sharkey2017-12-134-11/+25
| | | | | | | Test: builds, boots Bug: 70177949 Exempt-From-Owner-Approval: annotation-only changes Change-Id: I76dde6054e06f52240bd4b1a0f196dcb74623608
* Merge "Remove unused AIDL files" am: d0abc863f4 am: 43f665c95eColin Cross2017-12-051-30/+0
|\ | | | | | | | | | | am: 3dbbd3d3a9 Change-Id: Ida23b5013fa6a3e1fd6ba3e5a699f798f29b4b84
| * Merge "Remove unused AIDL files"Colin Cross2017-12-051-30/+0
| |\ | | | | | | | | | | | | | | | am: d0abc863f4 Change-Id: Ia6d798f6acf3930945cac488db81ccec3792648d
| | * Remove unused AIDL filesColin Cross2017-12-041-30/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These files show up in a glob for all AIDL files, but are not listed in AIDL files to be built, and have no references in codesearch except for one unused import. Bug: 70046217 Test: m checkbuild Change-Id: I7d6a3bb19d2e16b5f09473f3058afcf5b4edd9b6
* | | Dump print manager as protoPhilip P. Moltmann2017-07-253-15/+18
|/ / | | | | | | | | Test: incident_report print. Having no entries Change-Id: I3c7d611e44c0d3bf8e00775b1708bd82a334121a
* | Enforce permission for print system APIsPhilip P. Moltmann2017-07-141-3/+7
| | | | | | | | | | | | | | | | | | | | The permission is preinstalled as we want to leave the PrintSpooler unpriviledged. Test: Checked that Settings, PrintSpooler and BuiltInPrintService still behave as expected. Fixes: 62350107 Change-Id: Id33896f2899533f2d05cafa926df29cf1c6bfa77
* | Document what ALL_PAGES returning from onWrite meansPhilip P. Moltmann2017-06-161-1/+3
|/ | | | | | Bug: 37802299 Test: Doc only change Change-Id: I816e22b11951f9800eac988a5d86d96b9afa8912
* Ensure only test print services enabled - frameworkSvetoslav Ganov2017-06-071-0/+3
| | | | | | | | Test: cts-tradefed run cts-dev -m CtsPrintTestCas bug:62232727 Change-Id: I1050272586d1c03dc1b1dfdb8b10e258912a249b
* Annotate @SystemApi with required permissions.Jeff Sharkey2017-06-051-8/+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
* Return inet addr for discoverable printersPhilip P. Moltmann2017-04-063-46/+58
| | | | | | | | | | | | | ... by extending the RecommendationInfo to store the inet addresses not just the count. Thankfully the recommendation plugins already contained all the printers, not only the count. Also expose the print service state as system APIs as they will be used by the default print service. Bug: 35765644 Test: Ran AddPrinterActivity on network that had printers to discover Change-Id: I929a177adb75f6848848ba30a472cf0343d2e67e
* Allow print services to read advanced options.Philip P. Moltmann2016-10-041-6/+0
| | | | | | Test: Ran adjusted test that is subitted along side Change-Id: Ic662c6a6e56c3184611b30947fd715b57df196c0 Fixes: 28913410
* Fix doc for default print document content typePhilip P. Moltmann2016-07-061-1/+1
| | | | | | Since Kitkat the default was always 0 == document. Change-Id: I9c6236073898f5e62ec80f95a21fd394802fe1dd
* Merge \"Merge \\"Do not remove handlers for loaders.\\" into nyc-mr1-dev am: ↵Philip P. Moltmann2016-06-272-12/+5
|\ | | | | | | | | | | | | | | b6ee468b3e\" into nyc-mr1-dev-plus-aosp am: 1134308842 Change-Id: I80459fe11f37ad937c5855d296a81b2d002370d2
| * Do not remove handlers for loaders.Philip P. Moltmann2016-06-242-12/+5
| | | | | | | | | | | | | | | | In rare situations we might trigger a force-load if the handler is stopped. Change-Id: I103744654805dcbe0744b09b5be9da1f505817d3 Fixes: 29581798
* | Add event tracking to print UI.Philip P. Moltmann2016-06-201-0/+11
|/ | | | | Bug: 29391676 Change-Id: Iec09ac7296e50329e87268bcb70f5e60d566961c
* Rename 'thousands of an inch' to 'thousandths of an inch'in the docs.Philip P. Moltmann2016-04-211-16/+16
| | | | | Fixes: 28268203 Change-Id: I4246bc7431d1e0ecb75a6d101ba6ccd548567704
* Prevent printing from finishing activity.Philip P. Moltmann2016-04-201-0/+6
| | | | | Bug: 27861927 Change-Id: I00177ca0ec75cc8f7fd422907a2b5827b5db406b
* Fix Print CTS tests.Philip P. Moltmann2016-04-011-1/+1
| | | | | Fixes: 27971210 Change-Id: Ied11b2f1c528fe5e204e683d988b4efbd2562ef0
* Make sure PrinterCapabilitiesInfo always have sane values.Philip P. Moltmann2016-03-311-16/+32
| | | | Change-Id: I1ae7fe6aabdbe7f9480c4067690338103adaafa2
* Make sure PrintDocumentInfo is always sane.Philip P. Moltmann2016-03-311-7/+9
| | | | Change-Id: I73cf554d42dc33b7a1f6577088ec53b447f14c8c
* Make sure PrintAttributes have sane values.Philip P. Moltmann2016-03-311-83/+68
| | | | | | | Please note that null and 0 values mean "unset" and that margins historically allowed negative values. Change-Id: I1773bc552142345e18c1c31fb25e583d0ed070a2
* Add the print service recommendation servicePhilip P. Moltmann2016-03-304-9/+312
| | | | | | | | | | | | | | | | | | | | | | | | This service connects through the print manager to the print spooler: PrintSpooler.AddPrintersActivity <-> PrintManager <-> PrintManagerService <-> UserState <-> RemotePrintServiceRecommendationService <-> PrintRecommendationService <-> PrintRecommendationServiceImpl Hence there is a lot of mindless plumming. The actual changes are only in the AddPrintersActivity which is extended to show another list of services: The recommended services. The PrintServiceRecommendationService is based on the experimenal print service stubs provider. This provider was contributed the Android by Mopria. As this services uses Android own network discovery service most code from the experimental provider goes away. In fact the only logic left over is the selections of mdns-txt fields to look at and the printer vendor configuration. This relies on the Android MDNS to get fixed (Bug: 27696905). This also does not deal with how to update the recommendation service. Bug: 24533249 Change-Id: I6edc6e25fc08a50d478b61c71bb8ea158b08624c