OSDN Git Service

Rewrite workflow on how the destination printer is selected.
authorPhilip P. Moltmann <moltmann@google.com>
Tue, 8 Mar 2016 19:16:56 +0000 (11:16 -0800)
committerPhilip P. Moltmann <moltmann@google.com>
Mon, 14 Mar 2016 17:18:23 +0000 (10:18 -0700)
commit63ce0b737c022281ce4c36e1d90ed9b0270512f0
treea834264c89d6f5e77264d624c7c9945c80b2e383
parent2c4c90d2461101cc3de4db08d705bfd0cc282ecf
Rewrite workflow on how the destination printer is selected.

This fixes two bugs
(1)
1. Printer was unknown when "all printer" activity was opened
2. Printer gets selected in "all printers" activity
3. Printer is unknown at the time the activity returns and thereby does
not get selected

(2)
If a print service gets disabled _all_ printers of the print service
will be marked as "removed" but do not removed from the adapter. This
is superflous as none of them can be selected anymore. The only thing
we want to make sure of is that the currently selected printer does
not get removed.

The workflow is now always:
- set mCurrentPrinter if needed
- Adjust mPrinterHolders
- adapter.notifyDataSetChanged()
  -> PrintersObserver.onChanged()
     -> onItemSelected

Bug: 27643305
Change-Id: I35ea7078367ad5a918c6362c04a26c4326e6c3f4
packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
packages/PrintSpooler/src/com/android/printspooler/ui/SelectPrinterActivity.java