309 Commits

Author SHA1 Message Date
Svetoslav
30d9161b8e Merge "Printer list items have wrong width." into klp-dev 2013-10-18 20:27:06 +00:00
Svetoslav Ganov
858a1850e2 Hide the print dialog if the printing activity is destroyed.
1. For an app to print it creates a PrintDocumentAdapter implementation
   which is passed to the print dialog activity. If the activity that
   created the adapter is destroyed then the adapter, which may rely on
   the activity state, may be in an invalid state. For example, an app
   creates an adapter and calls print resuting in the app activity and
   the print dialog activity being stacked. Now the user rotates the
   device which triggers the recreating of the activity stack (assume the
   app does not handle rotation). The recreated print dialog activity
   receives the intent that originally created it with containing the
   adapter that was constructed in the context of the old, now destroyed,
   app activity instance.

   To handle this we are limiting an app to be able to print only from
   and activity and when this activity is destroyed we mark the adapter
   as invalid which will result in hiding the print dialog activity. Note
   that if the app process is killed we already handle this in the print
   dialog activiy by registering a death recipient on the adapter binder.

2. In the PrintManager.PrintDocumentAdapterDelegate some of the state is
   accessed only on the main thread and some from miltiple threads. The
   code was trying to avoid locking for state that is not accessed by
   multiple threads but this is error prone and the benefit does not
   justify the complexity and added fragility. Now grabbing a lock all
   the time.

3. The PrintJobConfigActivity waits for it to bind to the print spooler
   service before instantiating its print controller and editor. However,
   these can be accessed by invoking some of the activity cycle callbacks.
   This change is adding null checks for the case where the activity
   callbacks are called before the binding to the spooler is completed.

bug:11242661

Change-Id: Id906b3170e4f0a0553772dfa62686f06fdca0eaf
2013-10-18 13:12:06 -07:00
Svetoslav Ganov
da5132c2b0 am 6f570bd8: am a225bbdd: am 54e55759: Merge "All printers list has incorrect padding and item height." into klp-dev
* commit '6f570bd8c08df3eac750b7b0d7dae470bb23673d':
  All printers list has incorrect padding and item height.
2013-10-17 11:18:22 -07:00
Svetoslav Ganov
6f570bd8c0 am a225bbdd: am 54e55759: Merge "All printers list has incorrect padding and item height." into klp-dev
* commit 'a225bbddeccff76b92f18e620df0a8b773d4befd':
  All printers list has incorrect padding and item height.
2013-10-17 11:14:56 -07:00
Svetoslav Ganov
a225bbddec am 54e55759: Merge "All printers list has incorrect padding and item height." into klp-dev
* commit '54e5575924d3abba8129268d2d0553efc9a841eb':
  All printers list has incorrect padding and item height.
2013-10-17 11:11:35 -07:00
Svetoslav Ganov
ed513d7e4a All printers list has incorrect padding and item height.
1. We were using the layout for the printer drop down from the
   print dialog as the list item in the all printers activity.
   This layout was not high enough. Now we have a separate
   layout for the drop down and for the list. Note that they
   are almost identical but this is better that writing java
   code to lookup the height from the theme and change it
   programatically since the java code is almost half the size
   of the layout and leads to spreading the logic in both the
   layout file and the java code.

2. The padding of the printers list was not correct. Now it
   mimics the bahavior in settings where we change the padding
   based on orientation.

bug:11261157

Change-Id: I8507c4ee86e9196fe1777cf9577f1886ccfbb1ad
2013-10-17 10:33:14 -07:00
Svetoslav
b196106a43 Printer list items have wrong width.
1. There was leftover code in the printers adapter that was
   hard coding the item width with no reason to do so.

2. Changed the icon view visibility to invisible to allow
   the text of all list items including save to PDF and all
   printers to be left aligned.

bug:11225340

Change-Id: I5b51d0d30577699f5cd73c7c58521358653d135b
2013-10-16 16:45:33 -07:00
Baligh Uddin
19d0448512 Import translations. DO NOT MERGE
Change-Id: I60e1dfdf59f5790fb58d59946d25b2e14cd252bb
Auto-generated-cl: translation import
2013-10-16 14:41:47 -07:00
Baligh Uddin
d232a6f988 Import translations. DO NOT MERGE
Change-Id: I45af8da3d23c08e5f32133336e1805149dbdba64
Auto-generated-cl: translation import
2013-10-16 14:40:31 -07:00
Baligh Uddin
ffe8b79f36 am e1b6b6c5: Bring deleted files from the dead. These files were dropped by the translation pipelines because they do not contain any translated elements, but in reality they are needed.
* commit 'e1b6b6c5816b321864b6a5d72a46860fda8fa7cd':
  Bring deleted files from the dead. These files were dropped by the translation pipelines because they do not contain any translated elements, but in reality they are needed.
2013-10-15 16:00:13 -07:00
Baligh Uddin
e1b6b6c581 Bring deleted files from the dead.
These files were dropped by the translation
pipelines because they do not contain any
translated elements, but in reality they
are needed.

Bug: 11226380
2013-10-15 22:47:02 +00:00
Svetoslav Ganov
0ec8b5282e am 5a736fcd: Merge "Adding a missing resource file." into klp-dev
* commit '5a736fcd203f67c1d4d072fc4e96bb123d083800':
  Adding a missing resource file.
2013-10-15 10:20:25 -07:00
Svetoslav Ganov
5a736fcd20 Merge "Adding a missing resource file." into klp-dev 2013-10-15 17:17:31 +00:00
Svetoslav
809ddcf1c9 am a3378956: am 2c163ee4: am 1e639d2d: Merge "Update the message for unavailable printers." into klp-dev
* commit 'a337895682d86e9d71b04562a8b6e0dae889c8ac':
  Update the message for unavailable printers.
2013-10-15 04:03:16 -07:00
Svetoslav Ganov
b3918ae418 am 2f807975: am f62e2629: am fe3b58fb: Merge "Update the print spooler action bar icon." into klp-dev
* commit '2f8079753d40e7ee3f3af0d709c83c1e42480349':
  Update the print spooler action bar icon.
2013-10-15 04:02:37 -07:00
Svetoslav
a8068cb02d am 9773b379: am 79662942: am c89e5a6a: Merge "Layout may be called with invalid print attributes." into klp-dev
* commit '9773b379fecb7671bc02c1096ee23875d727f827':
  Layout may be called with invalid print attributes.
2013-10-15 04:02:33 -07:00
Svetoslav Ganov
2d996fb687 Adding a missing resource file.
This is a resource file cotaining the media sizes for the Catalan
locale. Without it the print spooler crashes all the time for that
locale since it cannot construct the PDF printer correctly.

bug:11226380

Change-Id: I7fa9c9bf4ed073e5f4ddf0d0fe9de4998e3467d4
2013-10-15 00:18:13 -07:00
Svetoslav
a337895682 am 2c163ee4: am 1e639d2d: Merge "Update the message for unavailable printers." into klp-dev
* commit '2c163ee4eb1e1ec835bba1c906e4ba1f86983c46':
  Update the message for unavailable printers.
2013-10-14 19:02:00 -07:00
Svetoslav Ganov
2f8079753d am f62e2629: am fe3b58fb: Merge "Update the print spooler action bar icon." into klp-dev
* commit 'f62e262932daaea8b5eda3893a56e2fdbb17ea0a':
  Update the print spooler action bar icon.
2013-10-14 19:00:41 -07:00
Svetoslav
9773b379fe am 79662942: am c89e5a6a: Merge "Layout may be called with invalid print attributes." into klp-dev
* commit '796629422f3023c1cc3c8d970f5b66c1b34599d2':
  Layout may be called with invalid print attributes.
2013-10-14 19:00:38 -07:00
Svetoslav
2c163ee4eb am 1e639d2d: Merge "Update the message for unavailable printers." into klp-dev
* commit '1e639d2d77dc225a6d5f191ce97561f1b987e402':
  Update the message for unavailable printers.
2013-10-14 18:05:45 -07:00
Svetoslav
2fa010cf5b Update the message for unavailable printers.
If a printer disappears or we do not get its capabilities, we
show the user a message that the printer is unavailable. This
message was appended after the printer name but they tend to
be very long and the user does not see that the printer is not
available due to ellipsis. Now we append the message after the
subtitle which tends to be much shorter.

bug:10983508

Change-Id: Ib3f7ad3bd82ff6decd49dc45461fb5131338e8c2
2013-10-14 17:36:19 -07:00
Svetoslav Ganov
f62e262932 am fe3b58fb: Merge "Update the print spooler action bar icon." into klp-dev
* commit 'fe3b58fbed7a02d3e9f559ed2f814b42934dc784':
  Update the print spooler action bar icon.
2013-10-14 17:19:36 -07:00
Svetoslav
796629422f am c89e5a6a: Merge "Layout may be called with invalid print attributes." into klp-dev
* commit 'c89e5a6af1514320f90329dadebdfa26a3ae93d2':
  Layout may be called with invalid print attributes.
2013-10-14 17:19:34 -07:00
Svetoslav Ganov
2f0ec7af06 Update the print spooler action bar icon.
1. Updated the print spooler icon shown in the action bar
   when searching for printers in the all printers activity.

2. If the current printer's capabilities are not immediately
   available the page count label in the dialog contained the
   argument placeholders.

bug:10983508

Change-Id: Id4f78d6cc31647f043f8e3044ab54f30584d1ebe
2013-10-14 13:49:17 -07:00
Svetoslav
9d843e09ca Layout may be called with invalid print attributes.
If a print service reports a printer with no capabilities and then
removes and adds the same printer again with no capabilities we can
call layout with invalid attributes. While the print service should
not do that we must not crash. The reason is that the print dialog
code was lacking a check whether something changed before handling
the change of the current printer. This resulted in calling layout
even though we still do not have the printer capabilities resulting
in passing bogus print attributes to the app.

bug:11216402

Change-Id: Icb9161930a70a7f9ead589a0ab0b4eb35091666f
2013-10-14 13:15:35 -07:00
Svetoslav Ganov
906f33022a am b7180852: am f5adedba: am 188d0953: Merge "The print dialog in bad state after pressing back from prnt to PDF." into klp-dev
* commit 'b71808524c6def5a903e15ad5d6a62c024a32569':
  The print dialog in bad state after pressing back from prnt to PDF.
2013-10-14 10:51:40 -07:00
Svetoslav Ganov
64e4896dbb am b6fd5789: am 64655e81: am 65d7b8d0: Merge "The list of active print jobs in print service retunring wrong result." into klp-dev
* commit 'b6fd5789ee73ae8abeaa69818d74d9461bd38165':
  The list of active print jobs in print service retunring wrong result.
2013-10-14 10:51:37 -07:00
Svetoslav Ganov
09854a9b3e am c7db2855: am 64ee79dd: am 3cccec4c: Merge "The callbacks for tracking a printer called more than once without printer change." into klp-dev
* commit 'c7db28558d737d2d06fc2f0545f19350dc603666':
  The callbacks for tracking a printer called more than once without printer change.
2013-10-14 10:51:29 -07:00
Svetoslav Ganov
e50c500924 am ff98feec: am 79ddf835: am bececbfa: Merge "Printed document size not persisted." into klp-dev
* commit 'ff98feec6f37485b7f5e025d221fe5c9ae147b03':
  Printed document size not persisted.
2013-10-14 10:50:50 -07:00
Svetoslav Ganov
132a9e2a6e am 603ece2e: am bfc8edcf: am 63ce2019: Merge "Fail only scheduled print jobs, i.e. handed to a service, if the service is disabled." into klp-dev
* commit '603ece2e8e3f5a73007fd42d3be52123a351eef0':
  Fail only scheduled print jobs, i.e. handed to a service, if the service is disabled.
2013-10-14 10:50:42 -07:00
Svetoslav
58a22cdf29 am 455e95eb: am 1f5c1f3e: am 036f05b8: Merge "Putting the cursor at the end of the copies and range inputs." into klp-dev
* commit '455e95ebab93c1d5c692114186807a058b454d73':
  Putting the cursor at the end of the copies and range inputs.
2013-10-14 10:49:05 -07:00
Svetoslav
0983f49eff am 00040103: am 8e80d1f9: am 33021d95: Merge "Adding timeout if the current printer or its capabilities disappear." into klp-dev
* commit '0004010369ef713ae9bdbdeb8e16bfbdcd835811':
  Adding timeout if the current printer or its capabilities disappear.
2013-10-14 10:48:19 -07:00
Baligh Uddin
7d8b77f036 Import translations. DO NOT MERGE
Change-Id: Ib9ba58f8e1486581d71443234db99a12f925cf0a
Auto-generated-cl: translation import
2013-10-14 09:17:56 -07:00
Baligh Uddin
d898bb0003 Import translations. DO NOT MERGE
Change-Id: Ic05225f9a7ed59b8534c5637187ced07b660252a
Auto-generated-cl: translation import
2013-10-14 09:16:10 -07:00
Svetoslav Ganov
b71808524c am f5adedba: am 188d0953: Merge "The print dialog in bad state after pressing back from prnt to PDF." into klp-dev
* commit 'f5adedba578f0e776a1c21186dd5a2f9ed7214e2':
  The print dialog in bad state after pressing back from prnt to PDF.
2013-10-13 12:25:34 -07:00
Svetoslav Ganov
b6fd5789ee am 64655e81: am 65d7b8d0: Merge "The list of active print jobs in print service retunring wrong result." into klp-dev
* commit '64655e81640ad5623d6a1b03f04320c16be8b101':
  The list of active print jobs in print service retunring wrong result.
2013-10-13 12:18:53 -07:00
Svetoslav Ganov
c7db28558d am 64ee79dd: am 3cccec4c: Merge "The callbacks for tracking a printer called more than once without printer change." into klp-dev
* commit '64ee79dd2d0b7a5bdff2590f252661d2fa5f76d7':
  The callbacks for tracking a printer called more than once without printer change.
2013-10-13 12:15:13 -07:00
Svetoslav Ganov
ff98feec6f am 79ddf835: am bececbfa: Merge "Printed document size not persisted." into klp-dev
* commit '79ddf835227283979dc353e57711a9d6dff8edb0':
  Printed document size not persisted.
2013-10-12 17:37:38 -07:00
Svetoslav Ganov
603ece2e8e am bfc8edcf: am 63ce2019: Merge "Fail only scheduled print jobs, i.e. handed to a service, if the service is disabled." into klp-dev
* commit 'bfc8edcf55c4f65ec00ca5d921a3cae1b367b248':
  Fail only scheduled print jobs, i.e. handed to a service, if the service is disabled.
2013-10-12 17:37:35 -07:00
Svetoslav Ganov
7ff610ee02 The print dialog in bad state after pressing back from prnt to PDF.
When selecting print to PDF and then pressing back to return from the
storage UI activity, the print dialog was in a state where nothing
is selected.

bug:10983508

Change-Id: I9c14b5fa18e812104ade6a2eacd626b5f7387111
2013-10-12 17:24:05 -07:00
Svetoslav Ganov
d91cb3ea61 The list of active print jobs in print service retunring wrong result.
1. The getActivePrintJobs() method in print service is designed to return
   the active print job i.e. ones scheduled to be processed by the print
   service. Now the correct list is returned.

2. The listeners for observing the state of print jobs may be called even
   after being unregistered. Ex: state change occurs and we schedule a
   message on the app's main thread to make the notificaion. Now the app
   unregisretes the callback and on the next loop the notification message
   is handled.

bug:11200258

Change-Id: I4a497b5c9a7287a22023cafe41ce966d14300ca6
2013-10-12 16:09:29 -07:00
Svetoslav Ganov
d3c197d972 The callbacks for tracking a printer called more than once without printer change.
When the user selectes a printer in the UI we ask the print service to start tracking
the printer, i.e. to observe changes of the printer state and capabilities. The callback
for the initially selected printer is called twice which breaks the contract and also
may trigger potentially expensive operations on the print service side.

More precisely the printer does not change and we ask the service to start tracking,
stop tracking, and again start tracking.

bug:11199851

Change-Id: Ib761e6da03f670b3098c69b1c0927177a8e4ae6b
2013-10-12 14:28:47 -07:00
Svetoslav Ganov
7d7888d1c7 Printed document size not persisted.
We persist ongoing print jobs so they can be restarted if the device
dies. The data size of the printed document was not persisted to disc.

bug:11199352

Change-Id: I53ef1ee285aa4808917dd6a5c7335226aba1ef0a
2013-10-12 13:18:16 -07:00
Svetoslav Ganov
9b6d3a153f Fail only scheduled print jobs, i.e. handed to a service, if the service is disabled.
When a print service is disabled we assume all print jobs for it failed as we have
no way to know what happens to them. However we are also failing created print jobs,
i.e. ones not given to the service. Such jobs are in process of construction and
the print dialog is up. We should not fail such jobs as the dialog can still modify
their state and potentially select a print from a different service. Therefore, we
leave them alone and they will be failed if when constructed are passed to a
disabled/uninstalled service.

bug:11197432

Change-Id: Ie4fe54327e3e25776b1dd572be2dfafdd700c2e5
2013-10-12 12:35:44 -07:00
Baligh Uddin
ea9aec27cc Merge "Import translations. DO NOT MERGE" into klp-dev 2013-10-12 00:27:15 +00:00
Svetoslav
455e95ebab am 1f5c1f3e: am 036f05b8: Merge "Putting the cursor at the end of the copies and range inputs." into klp-dev
* commit '1f5c1f3eee2df06ae42bc9e2bb9b5502316502cc':
  Putting the cursor at the end of the copies and range inputs.
2013-10-11 17:26:42 -07:00
Svetoslav
1f5c1f3eee am 036f05b8: Merge "Putting the cursor at the end of the copies and range inputs." into klp-dev
* commit '036f05b8b0dabc72e6ce68372516c3d98da137e4':
  Putting the cursor at the end of the copies and range inputs.
2013-10-11 17:22:56 -07:00
Svetoslav
89ed9fcf9b Putting the cursor at the end of the copies and range inputs.
bug:10983508

Change-Id: I767876fada2f28b00283ed9140fca1a40729f38f
2013-10-11 17:04:34 -07:00
Baligh Uddin
b48966885e Import translations. DO NOT MERGE
Change-Id: I11e36ca2c03ecbe1a6c99a8cc4f7e4afed3e5427
Auto-generated-cl: translation import
2013-10-11 16:34:38 -07:00