14698 Commits

Author SHA1 Message Date
Svetoslav Ganov
b84aa9fee3 am b415525a: Merge "Print job files and print job records not always cleaned up." into klp-dev
* commit 'b415525a16074b6dc8e295655648b7c7c1074bbb':
  Print job files and print job records not always cleaned up.
2013-09-30 17:10:08 -07:00
Craig Mautner
98b96d2c42 am 16e6e203: Merge "Centralize handleAppDied and fix return to home." into klp-dev
* commit '16e6e203c0c86a1cbc1a7c1cf20cb5447f705a32':
  Centralize handleAppDied and fix return to home.
2013-09-30 17:10:02 -07:00
Craig Mautner
768836b116 am 231bd6c5: Merge "Dismiss keyguard when resuming visible activities" into klp-dev
* commit '231bd6c514f15cb0b42a04d4fc7fc9631c743686':
  Dismiss keyguard when resuming visible activities
2013-09-30 17:07:07 -07:00
Jason Monk
915015a797 am da51d36c: Merge "Fix Sending PAC Broadcast before downloaded" into klp-dev
* commit 'da51d36c74f62a1c50f3960919cb74c5da178cd2':
  Fix Sending PAC Broadcast before downloaded
2013-09-30 17:06:23 -07:00
Craig Mautner
5c60d6b657 am c449613e: Merge "Revert behavior to perform onResume." into klp-dev
* commit 'c449613ec6ffed7b4605a6708a3341ab2dd5320f':
  Revert behavior to perform onResume.
2013-09-30 16:42:11 -07:00
Svetoslav Ganov
b415525a16 Merge "Print job files and print job records not always cleaned up." into klp-dev 2013-09-28 01:06:51 +00:00
Craig Mautner
16e6e203c0 Merge "Centralize handleAppDied and fix return to home." into klp-dev 2013-09-28 00:43:56 +00:00
Svetoslav Ganov
dd68da2741 Print job files and print job records not always cleaned up.
1. We want the files for a print job to be removed as early as possible
   typically because the print job was cancelled, completed, the app
   or the spooler crashed during print job construction. We were keeping
   around in the spooler and hence to disc infos for jobs that are in
   final state since the app that created them may hold a reference to
   a local print job objec whose info it can access to get the latest
   print job state potentially after the job reached final state. The
   issue was that we were persisting to disc created print jobs which
   were during construction which requires careful handling for the
   various cases above. This is tricky and error prone.

   We used to tell the spooler to forget the print jobs infos when the
   app that created them died. The implementation to forget a print
   job was not careful and was nuking currently running print jobs in
   addition to the ones in a terminal state. Further, if the app dies
   before a print job is completed we were left with a stale print
   job in the spooler since we missed the signal to forget it (assuming
   we forget only inactive jobs). These issues suggest that the approach
   is problematic.

   Now we have a cache of print job infos for the jobs an app created.
   This cache is updated when the state of a print jobs changes using
   the new print job state observation code. When the app dies we
   remove the cached jobs for that app. Now if the app calls to get
   the print jobs it gets the cached ones, i.e. the print jobs it
   created during its lifetime, plus the print jobs that are still
   active fetched from the spooler. Note that transient state cannot
   be kept in the spooler since we unbind from it if there is no
   work and it may get killed.

2. Improved the print sub-system logging code to show the cached
   print job infos for apps and also dump the print job PDF file
   names.

bug:10958357

Change-Id: I6f7c1968b6b7ba5be182a10df044ff7ea1fc3a61
2013-09-27 17:26:44 -07:00
Craig Mautner
6b74cb5df5 Centralize handleAppDied and fix return to home.
The home activity was being returned to when any activity in a task
that was launched from home crashed. If there were still activities
left in the task then the crash should have brought up those
activities next, not home.

This may be a partial fix for crashes where the back stack was showing
up under launcher icons. Bug 10858941.

Change-Id: I840a25bd8395bfce46f4e21b112d78b12884706d
2013-09-27 17:02:21 -07:00
Craig Mautner
0756632aa0 Dismiss keyguard when resuming visible activities
If an activity is visible behind the keyguard when it is launched
by another activity then there would be no call to dismissKeyguard.
Because the other activity is pausing the call to dismissKeyguard
is skipped in startActivityLocked(). And because it is already
visible the call to ActivityRecord.windowsVisible() is never made and
the call to reportActivityVisibleLocked() which calls
dismissKeyguard() is also never made.

This change recognizes when an activity is resumed and visible and
calls dismissKeyguard() in that case.

Fixes bug 10732489.

Change-Id: I3de1350a55231aaa14dadc8709fd0fcf4960742c
2013-09-26 17:41:05 -07:00
Jason Monk
da51d36c74 Merge "Fix Sending PAC Broadcast before downloaded" into klp-dev 2013-09-26 23:23:19 +00:00
Jason Monk
d443479a45 Fix Sending PAC Broadcast before downloaded
The PacManager now waits until the local proxy is bound and the PAC file
is downloaded before sending out the proxy broadcast.

Bug: 10895515
Change-Id: Iaa7fc0989b52453aeeb720b44df0fca0fcb959ca
2013-09-26 23:06:32 +00:00
Craig Mautner
5314a40b96 Revert behavior to perform onResume.
Back out changes from CLs ag/363992 and ag/363859. These introduced
the bugs found in bug 10917435 which is now fixed. Note that backing
out these changes reintroduces bug 10732489.

Change-Id: Ic5105dd4cfc8bf79c6f06188283d1ee3680c370c
2013-09-26 14:24:02 -07:00
Christopher Tate
a63816c1bb am 4e9c7d8b: Merge "Sigh." into klp-dev
* commit '4e9c7d8ba3caa8b558e2a1de796c100a562445ae':
  Sigh.
2013-09-26 14:14:54 -07:00
Svetoslav Ganov
ef7242326a am c6afd813: Merge "PackageManager#queryIntentServices breaks its contract." into klp-dev
* commit 'c6afd813ac2ddaa576fc7866479e933627622248':
  PackageManager#queryIntentServices breaks its contract.
2013-09-26 14:14:51 -07:00
Christopher Tate
4e9c7d8ba3 Merge "Sigh." into klp-dev 2013-09-26 21:10:39 +00:00
Svetoslav Ganov
c6afd813ac Merge "PackageManager#queryIntentServices breaks its contract." into klp-dev 2013-09-26 21:10:19 +00:00
Amith Yamasani
946395ec7f am d2534f8c: Merge "Don\'t remove restrictions files that are valid" into klp-dev
* commit 'd2534f8c05ccdf692f1e265ae719b67290d15050':
  Don't remove restrictions files that are valid
2013-09-26 14:04:21 -07:00
Amith Yamasani
d2534f8c05 Merge "Don't remove restrictions files that are valid" into klp-dev 2013-09-26 21:02:10 +00:00
Jeff Sharkey
66ee877f5d am 8c6c0419: Merge "Tighten flags enforcement, API to test Uris." into klp-dev
* commit '8c6c04197e58be6f3e46ba6a38f5d16e4fb091fa':
  Tighten flags enforcement, API to test Uris.
2013-09-26 13:37:21 -07:00
Jeff Sharkey
8c6c04197e Merge "Tighten flags enforcement, API to test Uris." into klp-dev 2013-09-26 20:33:29 +00:00
Christopher Tate
ae269d5727 Sigh.
Bug 10746233

Change-Id: I18c84f2bd53a511fc86be42b5d72062650e5b289
2013-09-26 13:23:43 -07:00
Amith Yamasani
fc95e70abd Don't remove restrictions files that are valid
This fixes a bug in parsing the package name from a file name. The suffix
was not taken into account, resulting in all restrictions files being
removed on switching to a user.

Bug: 10947554
Change-Id: I62725bbbdc0e15609872de3896130d4acbc35386
2013-09-26 13:20:17 -07:00
Jeff Sharkey
ee2f7df9ee Tighten flags enforcement, API to test Uris.
Check and throw if callers request invalid grant flags.  Add API to
test if a Uri is backend by a DocumentsProvider.

Bug: 10919391, 10935608
Change-Id: Ifa6afefb95983558c8c64dc15ddf650e9fe07080
2013-09-26 13:14:45 -07:00
Svetoslav Ganov
cb247866ac PackageManager#queryIntentServices breaks its contract.
PackageManager#queryIntentServices javadoc contract states that this
method (and the like) never returns null, rather an empty list if
no result is found. However, there is a path in the PackageManagerService
that returns null, thus breaking the contract. Handling the null list
explicitly.

bug:10930560

Change-Id: I708c51b8b7075e529145c8b0bf159efd6b697532
2013-09-26 12:34:49 -07:00
Svetoslav Ganov
4609d9a9eb am 5cab967b: Merge "Adding hidden APIs for observing the print jobs state." into klp-dev
* commit '5cab967bf2bab49777bfa86dff8b0f892192ede6':
  Adding hidden APIs for observing the print jobs state.
2013-09-26 12:25:10 -07:00
Svetoslav Ganov
5cab967bf2 Merge "Adding hidden APIs for observing the print jobs state." into klp-dev 2013-09-26 19:22:20 +00:00
Dianne Hackborn
63cff11b8a am c222f57b: Merge "Fix issue #10919261: Don\'t clear OP_WRITE_SMS when resetting app prefs" into klp-dev
* commit 'c222f57b5c992fb661b7112a7cd5e5dbe1c6030c':
  Fix issue #10919261: Don't clear OP_WRITE_SMS when resetting app prefs
2013-09-26 09:45:10 -07:00
Dianne Hackborn
8828d3a153 Fix issue #10919261: Don't clear OP_WRITE_SMS when resetting app prefs
Add a new array indicating whether each op allows itself to
be reset, and use it.

Change-Id: I494f630bda170e061196a380563512e9e77b51a8
2013-09-26 09:40:19 -07:00
Svetoslav Ganov
704697b619 Adding hidden APIs for observing the print jobs state.
This is needed for implementing the print job settigns UI.

bug:10935736

Change-Id: I63b42cbf4ce6a259fa1af47fa368b148ca5621c1
2013-09-25 17:57:07 -07:00
Dianne Hackborn
f9ad7b9d92 am 66a9b2d7: Merge "Fix issue #10903002: com.facebook.katana keeps itself in A Services" into klp-dev
* commit '66a9b2d7392a7f6334b5fe23d00ba718f3fa1851':
  Fix issue #10903002: com.facebook.katana keeps itself in A Services
2013-09-25 16:09:13 -07:00
Jeff Sharkey
687c6221c8 am be17a614: Merge "Require that persistable Uri permissions be taken." into klp-dev
* commit 'be17a61447e1a7992a6c855059a3c43ab3216610':
  Require that persistable Uri permissions be taken.
2013-09-25 16:05:36 -07:00
Dianne Hackborn
66a9b2d739 Merge "Fix issue #10903002: com.facebook.katana keeps itself in A Services" into klp-dev 2013-09-25 23:04:50 +00:00
Dianne Hackborn
cbd9a52f25 Fix issue #10903002: com.facebook.katana keeps itself in A Services
Now when memory low, if a service's process is above
a selected pss, then the process is not allowed to go
in to the service a list.

Also simplified the normal meminfo details dump to not
include the shared dirty and shared clean sizes by
default, since these can be very confusing.  You will
still get to see them with the "-a" flag.

Finally some small steps to better managing service
processes in the LRU list, so hopefully we can some
day be better about letting them drop down in the list
when there isn't really much interesting happening in
the process.  Not yet used at this point.

Change-Id: I654bfd6d05de2a63120185ebb15ffda8cbeb5dac
2013-09-25 15:45:56 -07:00
Jeff Sharkey
e66c1778f8 Require that persistable Uri permissions be taken.
Change our Intent flag to indicate that a Uri permission grant is
persistable, but don't actually persist it until explicitly taken by
the receiving app.  This prevents apps from spamming each other if
persisted permissions aren't really required.

Remember the last time a persisted grant was taken by an app, and
use this to prune away the oldest grants when the number of grants
grows too large.  Allow apps to query persisted grants they are
holding, and allow them to release previously persisted grants. Add
public UriPermission class to return grant details and timestamp.

Track various permission strengths separately, and combine together
after each mutation pass.  Persistable grants are currently treated
like global grants, but they could be moved to have owners in the
future.  Require that grant holders trying to extend a persistable
permission actually hold a persistable permission themselves.

Bug: 10835779
Change-Id: I95b2f797c04ce7fd2612f9a644685dbd44e03759
2013-09-25 15:16:41 -07:00
Christopher Tate
6098618d8e am 044fd573: Merge "Don\'t crash when no alarms are scheduled" into klp-dev
* commit '044fd573ce58142309f9fc503cf5d52af447d082':
  Don't crash when no alarms are scheduled
2013-09-24 18:23:16 -07:00
Christopher Tate
044fd573ce Merge "Don't crash when no alarms are scheduled" into klp-dev 2013-09-25 01:20:38 +00:00
Craig Mautner
f77c1eb1e0 am 8488f9fa: Merge "Be less aggressive when not resuming top activity" into klp-dev
* commit '8488f9fa2e38e75e7ecbaac7d776900f8f1e5917':
  Be less aggressive when not resuming top activity
2013-09-24 17:31:57 -07:00
Craig Mautner
8488f9fa2e Merge "Be less aggressive when not resuming top activity" into klp-dev 2013-09-25 00:28:20 +00:00
Christopher Tate
6578ad17ca Don't crash when no alarms are scheduled
Backing until you hear glass is generally contraindicated.

Bug 10056484

Change-Id: Ie1331fbbc5fbb5d6384a6cfc975aa1840a5c9a2d
2013-09-24 17:12:46 -07:00
Craig Mautner
6ff6d010d1 Be less aggressive when not resuming top activity
The previous fix for keeping activities from running on startup,
ag/363992, was keeping the home task from launching when the
keyguard should have allowed it.

This fix permits the home activity to launch in such situations.

Fixes bug 10916877.

Change-Id: I429f0d5a13e06a247b9b6b7241f9a3514044c371
2013-09-24 16:21:54 -07:00
Dianne Hackborn
9b7d148466 am 5f86b90b: Merge "Fix issue #10848916: "Always" button is not working." into klp-dev
* commit '5f86b90b8a224e21db89bacf78d4bd4d3f44342d':
  Fix issue #10848916: "Always" button is not working.
2013-09-24 14:49:17 -07:00
Dianne Hackborn
5f86b90b8a Merge "Fix issue #10848916: "Always" button is not working." into klp-dev 2013-09-24 21:46:17 +00:00
John Spurlock
8d87227c02 am 0ab7d4d1: Merge "Remove Rect allocation in each layout pass." into klp-dev
* commit '0ab7d4d1a114b888889862ec7a5e2dc3bcd23fa5':
  Remove Rect allocation in each layout pass.
2013-09-24 14:19:19 -07:00
John Spurlock
0ab7d4d1a1 Merge "Remove Rect allocation in each layout pass." into klp-dev 2013-09-24 21:18:00 +00:00
Dianne Hackborn
6d8dfbd814 Fix issue #10848916: "Always" button is not working.
The problem was that the ResolverActivity filters some activities
out of the list it shows, but it uses that display list as the
list of components the preference is set against when ultimately
setting it on the package manager...  but that filtered list is *not*
the right component set, since it is not the same as the package
manager's view on it.

The fix here is to retain the original set of matching components
and use that when setting the preferred activity.  Note that this
does mean that in very unusual cases where filtering is happeing
(such as one of the activities not being exported but being seen
as a possible completion from another app), then you will be setting
the preference for the complete set.  Ultimately we probably need
to have the package manager apply these filtering rules up-front so
this is all consistent, but this is a very rare case so not that
important.

And then most of the change here is just improving the debug
output for intent resolution.

Change-Id: Ie35ac2c05a45946439951bbf41433c8b7de79c05
2013-09-24 14:16:38 -07:00
John Spurlock
4e92a7cf03 Remove Rect allocation in each layout pass.
Bug:10786445
Change-Id: I0cb1ab7697f33e02adeb5319bae19d3a1d20753c
2013-09-24 17:09:05 -04:00
Svetoslav
d454beb854 am 0d38d0b4: Merge "Multiple printer discovery session instances and other bugs." into klp-dev
* commit '0d38d0b42fba7dc50454d5c0652cf351c58a9db6':
  Multiple printer discovery session instances and other bugs.
2013-09-24 13:40:02 -07:00
Svetoslav
0d38d0b42f Merge "Multiple printer discovery session instances and other bugs." into klp-dev 2013-09-24 20:37:59 +00:00
Craig Mautner
4099dc8981 am 9bf6c5ce: Merge "Fix method for determining focused window." into klp-dev
* commit '9bf6c5cec834343104aa326b65b86c064c86c6cb':
  Fix method for determining focused window.
2013-09-24 12:35:25 -07:00