Age | Commit message (Collapse) | Author |
|
When saving to PDF, request a truncated output stream in case the user
selects to overwrite an existing file.
Bug: 423815728
Test: Overwrite existing PDF
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d65493c65a94415208d4be2454181f214fb2ed03)
Merged-In: Id598cd1a9d2456566f3905432eb7b5ffeab9d33e
Change-Id: Id598cd1a9d2456566f3905432eb7b5ffeab9d33e
|
|
|
|
When a PDF file is invalid (corrupt PDF file, password-protected, etc)
and can't be rendered, switch to an invalid state. No further updates
happen when the file is known to be invalid and the spooler is in an
invalid state. This prevents a crash where an update was trying to be
performed when in the finished state.
Additionally, don't allow the user to attempt to restart a print job
with an invalid file since it will simply fail again.
Bug: 389956791
Flag: EXEMPT bug fix
Test: Manual test on akita and brya with password-protected file
Change-Id: I8217463ba3d43a7b898019bdc84443cc43f9d042
|
|
Send the new checked event. Updated to the new checked api.
This widget is using getSelected() as the checked state. We can't send
the event in setSelected() because setSelected in called in
onBindViewHolder and the widget is not attached yet. So we send the
new event when the widget is clicked.
Test: tested on the print preview and checked the new event is sent
when clicked.
Flag: android.view.accessibility.tri_state_checked
Bug: 380327448
Change-Id: I1591425bf7d35ef361cae94ee394cb26b20014ff
|
|
PrintContentView now fits system windows. Handle the insets in
PrintContentView to accomodate the padding introduced by this.
Reverts ag/26955039 and ag/27354397.
Bug: 378652618
Test: Manual verification that all the elements are visible,
interactable and in the expected position
Flag: com.android.printspooler.flags.print_edge2edge
Change-Id: Ib6c533fedbbc45e0340a389fba71f81be17fedf4
|
|
To assist with debugging from bug reports, log when print jobs are
created, removed, or updated.
Bug: 385340868
Test: manual printing
Flag: com.android.printspooler.flags.log_print_jobs
Change-Id: Id15a8d126b4a34f7b27fcd36d398a1c83ec85b20
|
|
Bug: 379263789
Bug: 376407910
Test: CtsPrintTestCases
Test: Manual, i.e. verified that PrintActivity has same back navigation behaviour with and without this CL applied. (tested within Files app after `m PrintSpooler; adevice update`)
Flag: EXEMPT bugfix
Change-Id: I53a34b448b520da7193eadadef09fc2cd99debbd
|
|
The PrintSpooler now handles malformed PDFs by marking the print job as failed and calling finish(), preventing RuntimeException
Bug: 367448551
Flag: EXEMPT bug fix
Test: atest IPrintManagerParametersTest, tested in test app on a physical device
Change-Id: I54d14b270741172eff7e4147ad59b2e0d39ab188
|
|
|
|
- Fix concurrency issue in renderPage using synchronization
- Avoid race condition in renderPage by updating callback instead of throwing exception
Test: N/A (manual test)
Bug: 344104578
Flag: EXEMPT No automated test available for this concurrency fix
Change-Id: I5c8f34eebf830e3c0a131d6fb940b1ef848c3a0d
|
|
When an external keyboard is attached, users expect to be able to cancel
dialogs with the Escape key. Since PrintSpooler already handles this
behavior when the Back key is pressed, simply give the Escape key the
same behavior.
Bug: 364883486
Flag: EXEMPT bug fix
Test: Manual comparison of ESC and Back on a keyboard with both
Change-Id: I3e54deb1a1cb781fe1d54ea4e19e4476d423e339
|
|
When user selects printer from Select printer screen, we started
tracking last selected printer instead of selected printer. It is
happening due to race condition between onStart and onActivityResult
callback.
Add a support to start tracking printer from onActivityResult function.
Bug: 341016728
Bug: 335214357
Test: atest frameworks/base/packages/PrintSpooler/tests/outofprocess/src/com/android/printspooler/outofprocess/tests/WorkflowTest.java
Change-Id: I096bf15d3d3ebc45ffbb05db33ac5936dedc14fa
|
|
It seems that it is relatively a common pattern used in the Framework
code when trying to hide a software keyboard.
var imm = view.getSystemService(InputMethodManager.class);
if (imm != null && imm.isActive(view)) {
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
The above code can be easily optimized by introducing a counterpart of
InputMethodManager#showSoftInput(View view, int flags);
so that the hide request can be issued when and only when the
specified view has already established a connection to the IME. The
optimized code would look like as follows.
var imm = view.getSystemService(InputMethodManager.class);
if (imm != null) {
imm.hideSoftInputFromView(view, 0);
}
Major advantages of such an approach are:
* IMM#checkFocus() can never be called.
* IMM needs to take a lock only once.
With above, this CL introduces IMM#hideSoftInputFromView() as @hide
method so that we can start making sure that such an approach works
well.
Fix: 296466613
Test: atest CtsInputMethodTestCases:EditTextImeSupportTest
Change-Id: I01e5a29c0f82d068751774a2c58a1bd7b7b7f91a
|
|
This allows the info button on each printer to open an activity as
expected.
Bug: 277761614
Test: manual test, presubmit
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0633d417ebe399fae024572ae2008e1f86ee437d)
Merged-In: Ibe4bd6eabdc61be3b1237aa313b575cd85a69226
Change-Id: Ibe4bd6eabdc61be3b1237aa313b575cd85a69226
|
|
This commit is part of a large scale change to fix errorprone
errors that have been downgraded to warnings in the android
source tree, so that they can be promoted to errors again.
The full list of changes include the following, but not all
will be present in any one individual commit:
BadAnnotationImplementation
BadShiftAmount
BanJNDI
BoxedPrimitiveEquality
ComparableType
ComplexBooleanConstant
CollectionToArraySafeParameter
ConditionalExpressionNumericPromotion
DangerousLiteralNull
DoubleBraceInitialization
DurationFrom
DurationTemporalUnit
EmptyTopLevelDeclaration
EqualsNull
EqualsReference
FormatString
FromTemporalAccessor
GetClassOnAnnotation
GetClassOnClass
HashtableContains
IdentityBinaryExpression
IdentityHashMapBoxing
InstantTemporalUnit
InvalidTimeZoneID
InvalidZoneId
IsInstanceIncompatibleType
JUnitParameterMethodNotFound
LockOnBoxedPrimitive
MathRoundIntLong
MislabeledAndroidString
MisusedDayOfYear
MissingSuperCall
MisusedWeekYear
ModifyingCollectionWithItself
NoCanIgnoreReturnValueOnClasses
NonRuntimeAnnotation
NullableOnContainingClass
NullTernary
OverridesJavaxInjectableMethod
ParcelableCreator
PeriodFrom
PreconditionsInvalidPlaceholder
ProtoBuilderReturnValueIgnored
ProtoFieldNullComparison
RandomModInteger
RectIntersectReturnValueIgnored
ReturnValueIgnored
SelfAssignment
SelfComparison
SelfEquals
SizeGreaterThanOrEqualsZero
StringBuilderInitWithChar
TreeToString
TryFailThrowable
UnnecessaryCheckNotNull
UnusedCollectionModifiedInPlace
XorPower
See https://errorprone.info/bugpatterns for more
information on the checks.
Bug: 253827323
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I8446f9076a45ebf7e7ffa06cb0d4ddb1001b6c00
|
|
Added the PrintSpoolerLib module that is used as one dependency of the
ArcPrintSpooler module.
Bug: 205649904
Bug: 211801887
Test: compared the two apk files built by Make and Soong
Test: TreeHugger
Change-Id: I9b6d0c9f4620ed58d5be55862f9a18dcfefa9cfa
|
|
Fixes: 177873499
Test: Manual
Change-Id: Ia77e6d2c9d7e552beb0a2df10d6d4f13c7230446
|
|
Expose quality APIs publically after refactoring them to match external
usage of quality constants. Removes list of location requests from
provider request, as there is no client that really uses this, and it
feels like too much information to give to providers.
Bug: 168624248
Test: presubmits
Change-Id: Icf8a9f6096da0071d97190d3f7196948492e52a1
|
|
LocationRequest and associated APIs have historically always been
SystemApi, for no real reason. In keeping with the Android-wide push to
clean up API surfaces like this, we make LocationRequest a public API.
Bug: 166692379
Test: manual + presubmits
Change-Id: I6a93fca1a5613c96bf35da158bc542e47864dbff
|
|
They are not meant fro modification.
Test: Clicked on a notification to follow the intent
Fixes: 156009434
Change-Id: I04abfb4def70f05b30a2a35c8889c5a1a6857de0
|
|
Otherwise it can happen that we swallow previous printer updates and
never end up getting a valid on-printers-updated call.
Fixes: 156222510
Test: atest PrinterDiscoverySessionLifecycleTest
Change-Id: Idab7399a6ab41ba9051cfcbbeebf4c45d6bfc053
|
|
Replace requestSingleUpdate() with getCurrentLocation().
Bug: 133356925
Test: none
Change-Id: I2416c5526f0c7cd54c8d7a6d7b042a32cc768218
|
|
The printer list is tried to be updated when the network is changed
but the 'changed' event was fired even if the printer list is not
changed at all.
This CL suppresses events if the list is not changed.
Bug: 132840441
Test: run 'cts-tradefed run commandAndExit cts-dev --module
CtsPrintTestCases --test android.print.cts.
PrintDocumentAdapterContractTest#unexpectedLayoutCancel' 30 times
Change-Id: I9236e56ea9e19e37be29d6a1d0015ee0b2676460
|
|
Bug: 122263617
Test: make
Change-Id: I11ce02f3f65f429fd4375a5522c060c8080f4813
|
|
In this case the mUpdateSpec will be marked as stale once the command
is done, hence we have to start from scratch.
Fixes: 117124112
Test: - Reproduced scenario in bug
- atest CtsPrintTestCases
Change-Id: I98e11d28147bae638d68b2124507d04f825a392f
|
|
|
|
Part of getting DocumentsUI ready for building against public API.
Test: builds
Bug: 110959821
Change-Id: I7cc0acd5ac3bcc89790cb49f34291ae523e44019
|
|
- replace png's by vector graphics
- Use alredy existing icons if possible
- Remove unnnecessary hard coded color values
- hard code all colors for preview-page as the background colors are
hard coded, hence foreground also needs to be hard coded.
- Unify layout of loading/error/select printer UI
Test: Looked at print spooler. Switched theme to dark and checked if all
looks ok too.
Change-Id: I07cc619d575c7372bd18550db8f2582df657cc5c
|
|
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
|
|
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
|
|
|
|
This replaces the usage of handler message types with PooledLambda
Test: atest CtsPrintTestCases
Change-Id: I19b01278b67b5fe18d48a2e0bb8300bbe1413a63
|
|
This guarantees that the print job is created before the print activity
deals with it.
Test: CtsPrintTestCases
Change-Id: I3451fff71bd981beb45882b7b42d4cc49d63a91c
Fixes: 73127052
|
|
|
|
Before:
onServiceConnected
AsyncTask 1: doInBackground
doTransform
PdfEditor service crashes
system restarts PdfEditor service -> onServiceConnected
AsyncTask 2: doInBackground
doTransform
onPostExecute
Unbind from service
AsyncTask 1: onPostExecute
Unbind from service again -> crash
Hence we have to only ever create a single async task even if we get
another onServiceConnected.
Test: atest CtsPrintTestCases
Change-Id: Ia18e82fe6258bac9395557b2056645e87a752889
Fixes: 73127227
|
|
As the 'printer' variable becomes null and the activity crashes.
This could also be solved to register context menu's for each printer
entry (and not for the 'add printer' entry). Then we would need to
create a custom view for the printer entry that returns a
ContextMenuInfo containing the printer ID. While this solution is
cleaner, it is much more complex.
Test: Tried to open context menu in 'add printer' entry
Change-Id: I23dcba2dd876cff27b5cad9736f5ec4524985bac
Fixes: 73126748
|
|
This allows to dump the USB state as proto-buf. This in turn allows to
automatically process this data.
Test: adb shell dumpsys usb
incident_report usb
No automated test possible as no field is guaranteed to be set
Change-Id: Ifdf22bfaf9c78226c420b11c43278013ce69f849
|
|
|
|
Tuned rates that we collect PSS, to reduce how much we do
that heavy operation. Added a new way to determine
whether a process has changed to a state for the
"first" time -- now this is when it has gone to that
state for the first time since it was in a lower state.
This will reduce the amount of time we consider a
process to be first to only when it has previously
gone into a higher state than it had before.
Keep track of more fine-grained information about why we
collect a PSS sample (not just internal, but for a single
process, all processes because of a mem state change, all
processes because of a poll).
Started collecting RSS in various places, so we can start
looking at that w.r.t. PSS and see about transitioning to
it is a new primary metric.
Added logging for many of the places where the system
writes its configuration files, so we can more easily
see any bad behavior going on in those areas.
Added some currently disabled code to read smaps directly
instead of using fgets(). Probably won't help, but want
tot test.
Bug: 70859548
Test: atest CtsAppTestCases
Change-Id: I400dba0f3ae9c024df51c946cfa592561028b598
|
|
This reverts commit e4d31b3c103045d5b2b141a05084dced595cc64f.
Fixes: 71904218
Test: presubmit
Change-Id: Id73bde1a0c11696cf561c84cde027cdca4c6a00f
|
|
Beside addressing the comments on this change, this adds a check that
the token in end( is correct and prints a message if not. This is useful
when creating new dumping methods.
Test: adb shell dumpsys print
Change-Id: Ic2e6152cbd82f98d9d305a15edffc69c55fd1fd3
|
|
Add a class DualDumpOutputStream that maps proto-dump commands onto
print writer commands.
The effect of this is that there is only one - very proto dump like -
way to dump the print manager which is much easier to maintain.
The DualDumpOutputStream tries to produce a result similar to the
incident-report tool.
Test: adb shell dumpsys print
Change-Id: I1f0c56651eaa59f0ce90cdb08c71e89a96c48dd4
|
|
|
|
..and also extract common code into a common superclass
This also preserves the order of the throttled events
(TYPE_VIEW_SCROLLED & TYPE_WINDOW_CONTENT_CHANGED) with regards to the rest
of events by flushing any pending throttled events immediately if another
event is requested to be sent.
Test: ensure no new a11y CTS failures
Change-Id: I948a16716521974393aaa1cf822d0a0324e9ce3a
|
|
Bug: 69693271
Test: manual, in a RTL system language, build, sync, open a PDF, print
Change-Id: I90e0dabfee1256663a4bececb0538f91389cfaac
|
|
This makes very high resolution versions of the icon appear sharper.
Fixes: 69175097
Test: Looked at places where the icon shows in the UI. Looks like
before, just sharper.
Change-Id: I2bf24c08605e6e4949892dcb720005497f1fadfa
|
|
|
|
|
|
When we cancel a layout there are two cases. Either we already scheduled
the next layout. In this case operate as before as the update-spec was
updated to the new update.
In there is no new layout we have to reset the update spec as the last
command was canceled and the state of the remotePrintDocument has
become invalid. The resetted update spec forces a new update the next
time update() is called.
Fixes: 64911776
Test: cts-tradefed run cts-dev -m Print
Added two new tests reproducing the scenarios mentioned in the
bug.
Change-Id: Icad8da5fd985aed1cc201076ee7262f6d6541380
|
|
Otherwise tapping the button quickly enough can cause the activity to
open twice.
Change-Id: I007d7ee7d8d271111dc919f195a487a9c65d2bdf
Fixes: 63647922
Test: cts-tradefed run cts-dev -m Print
|