This is a mechanical replacement of Context.getSystemService(String)
with Context.getSystemService(Class<T>) when retrieving
InputMethodManager. Note those are bundled code. Hence we don't need
to make sure Build.VERSION.SDK_INT >= 23.
Change-Id: Icc64942ad8f11e44bf84f8d4fe476b2fdd1257f3
services
If the SelectPrinterActivity is visible it shows different emptyState
depending on if there are print services available or not. Hence the
activity has to listen to changes to the list of enabled services.
This also fixes a small syncronsation problem if two observers are
registered for the enabled print services.
Bug: 25666802
Change-Id: I79af66f25f10e66347b48ce9bb99c1657b30a8dd
* changes:
Create PrintDiscoverySession for future print services
Update printer availability when printSpooler is paused. This makes the window update syncronously when in multi-window mode.
We are not saving the state of this fragment on onSaveState,
so its Okay to loose state while confirming the transaction.
bug:25847358
Change-Id: I2f6587d528b2d8b8f24a83954cc896a6ff514996
When the configration changes there are two modes to handle it:
1. do through a onDestroy - onCreate cycle
2. declare that your activity can handle certain changed and handle them
in onConfigurationChanges
For most apps (1) is zero effort to implement, hence it is the default
behavior. You only want to do (2) if recreating your activity is
expensive.
As recreating the printActivity is expensive (and currently even
impossible) we want to handle the configuration change gracefully. There
is no code to be added as handling portrait mode / landscape mode switch
is not different from an orientation switch.
Bug: 25727559
Change-Id: Iac5b854c9dd080a4432957bc4551162dc3d480e9
The Spinner does not support a prompt, hence temporarily hijack the
first element and install an alternate view. Once the Spinner is touched
revert to the old behavior.
If we showed a prompt the views in the spinner cannot be recycled.
Bug: 24132864
Change-Id: Iaf97878f85388a8c6351e716117b16f34919ad84
print services are enabled
The add printer icon is always visible as this is used for both adding
a printer and adding addition print services
We have three different empty views now:
1. No print services
2. No printers found (not search filter set)
3. No printers found (search filter set)
Bug: 24132367
Change-Id: Ic30812b60986f1e0f023488cefc6aa901ce20824
An app might suggest certain attribute for an print job. This patch
fixes
- PrintActivity should not silently overwrite the attributes with
the default values
- Handle duplex mode in PrintAttributes similar to the other attributes.
I.e. have an "unset" value (0). This is an API change. But the only
use case for PrintAttributes was to pass them to print() and thereby
the PrintActivity. This was broken (see above), hence we are changing
and API that could have never been used.
Bug: 23629618
Change-Id: I43c25704497c799352fb806126dc93f6db4879f5
we print using it the first time.
This warning used to be shown when the print settings app was used
to enable a service.
If two warning as shown for the same print service we automcatially
dismiss all dialogs once one dialog is confirmed. Please note that
we are not confirming the printjob as it is unexpeced to have a
single click to confirm multiple print jobs.
Change-Id: I8bb0a49bac2063c1c55e2f24bd34df2c44e2df89
Bug: 24135353
PrintActivity is recreated when the language setting is changed.
As a result of the recreation mCurrentPrinter is null, which causes
a NullPointerException when onActivityResult() is called.
The issue is solved with a simple null check.
Change-Id: Ic58f0ca01577d2ec02d494739f3bc2f06240dd44