14623 Commits

Author SHA1 Message Date
Dianne Hackborn
57d96f0e92 Merge "Fix issue #10948509: Crash in procstats when there is no data" into klp-dev 2013-09-30 00:21:48 +00:00
Dianne Hackborn
cb4285537b Fix issue #10948509: Crash in procstats when there is no data
Not dealing with the case where there is a null list.

Also fixed some bugs I found while looking at this:

- When resetting the stats, we would use a newly computed time stamp
  for the total durations rather than the one we used to reset the
  proc/service entries.  This would result in them being able to be
  slightly > 100%.
- There was a bug in how we split a single process state into its
  per-package representation, where we would but the cloned process
  state into the new package's entry (instead of properly for its
  own package entry), to be immediately overwritten by the new
  process state we make for that package.  This could result in
  bad data for processes that have multiple packages.
- There was a bug in resetting service stats, where we wouldn't
  update the overall run timestamp, allowing that time to sometimes
  be > 100%.
- There was a bug in computing pss data for processes with multiple
  packages, where the pss data was not distributed across all of the
  activity per-package process states.
- There was a bug in computing the zram information that would cause
  it to compute the wrong value, and then never be displayed.

Finally a little code refactoring so that ProcessState and ServiceState
can now share a common implementation for the table of duration values.

Change-Id: I5e0f4e9107829b81f395dad9419c33257b4f8902
2013-09-29 17:14:15 -07:00
Craig Mautner
564e8e6f54 Merge "Ensure correct window ordering." into klp-dev 2013-09-29 14:26:12 +00:00
Craig Mautner
64ce6b78cc Merge "Don't kill home process with the rest of its package." into klp-dev 2013-09-29 14:25:08 +00:00
Craig Mautner
5a0c54a511 Merge "Remove home package name methods." into klp-dev 2013-09-29 14:24:28 +00:00
Craig Mautner
5ee6d19fd7 Ensure correct window ordering.
Make sure that moveStackWindowsLocked() is called every time that the
stack ordering changes. This will rebuild the window list. Previously
the call was being made after the moveStack() call which got forgotten
in the addAppToken() causing the home stack to obscure incoming phone
and video calls.

Fixes bug 10023223.
Fixes bug 10678010.
Maybe fixes bug 10858941.

Change-Id: I59922dc979a19210008eac1f528704984c63c886
2013-09-28 15:58:38 -07:00
Craig Mautner
8025935573 Remove home package name methods.
Do not use the shortcut of the package name to identify the home
activity.

Fixes bug 10963726.
Fixes bug 10920950.

Change-Id: I725781a26672b055a816994aee6ea458a7f07c88
2013-09-28 13:49:16 -07:00
Craig Mautner
f31ea07d64 Don't kill home process with the rest of its package.
Killing the GEL search results was killing everything in its package.
This fix keeps the home process from being killed when a task in its
package is killed.

Fixes bug 10927223.

Change-Id: I56e75f0a0118885a1604cbd70320bbdb4f8cf1a2
2013-09-28 13:46:38 -07:00
Svetoslav
d8dbc13b47 Ignore historical printer records for installed services
When loading historical records for previously used printers we
now ignore the ones whose target print service is not installed.

bug:10955652

Change-Id: Ib295e7d88ed3c308ef6d8a11bdc1792ebbb6d526
2013-09-27 18:46:24 -07:00
Jim Miller
fb2e3c8d47 Merge "Fix permissions on WindowManagerService.showAssistant()" into klp-dev 2013-09-28 01:18:17 +00: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
Jim Miller
6c9df5054a Fix permissions on WindowManagerService.showAssistant()
Since binder call permissions are not transitive by design,
the proper way to fix this is to have the call talk directly
to keyguard from the navigation bar.

Fixes bug 9409008

Change-Id: Ibd90a79bb638c969b514455a2ad93c6ff668222d
2013-09-27 16:29:36 -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
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
d2534f8c05 Merge "Don't remove restrictions files that are valid" into klp-dev 2013-09-26 21:02:10 +00: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
5cab967bf2 Merge "Adding hidden APIs for observing the print jobs state." into klp-dev 2013-09-26 19:22:20 +00: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
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
044fd573ce Merge "Don't crash when no alarms are scheduled" into klp-dev 2013-09-25 01:20:38 +00: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
5f86b90b8a Merge "Fix issue #10848916: "Always" button is not working." into klp-dev 2013-09-24 21:46:17 +00: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
0d38d0b42f Merge "Multiple printer discovery session instances and other bugs." into klp-dev 2013-09-24 20:37:59 +00:00
Craig Mautner
9bf6c5cec8 Merge "Fix method for determining focused window." into klp-dev 2013-09-24 19:33:17 +00:00
Craig Mautner
254f5ffc47 Merge "Pause activities behind keyguard after boot." into klp-dev 2013-09-24 17:39:17 +00:00
Craig Mautner
2acc389d61 Pause activities behind keyguard after boot.
Following boot the initial activity was automatically resumed even if
a lockscreen is obscuring it. Refer to CL 363859 for why this breaks
things.

This fix pauses all activities the first time a lockscreen appears.

Completes the fix for bug 10732489.

Change-Id: I6fcac14b574c495aa0e16d798cddc1263c6b4c25
2013-09-24 10:36:05 -07:00
Craig Mautner
ac56514ea7 Fix method for determining focused window.
Method had been rewritten to be task-based and there were errors
when a task had no apptokens. New version is much easier to
maintain.

Maybe fixes bug 10689184.

Change-Id: I5e4c8447a33a4f5686296c20b9f9fe302c9ae49f
2013-09-24 09:01:48 -07:00
Svetoslav
b5f180608d Multiple printer discovery session instances and other bugs.
1. The fused printers provider was dropping on the floor received printers
    if it was not active. It is in fact a loaded and if not active it should compute
    the printers and not deliver them until activated. This fixes an issue where
    opening the print dialog, then enabling a print service results in the printers
    reported by the service not showing up in the print dialog.

2. Printer discovery session was created twice which leads to incorrect behavior
    as the pint system is designed around the contract that there is a single
    printer discovery session per service at a time. This was possible due to an
    incorrect initialization of a member variable resulting in double session creation
    when the print service is connected.

3. When a print service is enabled during discovery we did not use the correct
    condition to start printer discovery resulting in starting it all the time even if
    not needed. Also if some of the printers that had to be tracked are reported
    by the service just enabled (typically historical printers) we did not ask the
    service to start tracking them.

4. Removed some logging.

bug:10903343

Change-Id: I46c049471a4b099fc668df3aee2aaedc8d7786ac
2013-09-23 23:41:12 -07:00
Dianne Hackborn
2d4eee3829 Merge "Implement issue #10895990: Better durations for proc stats" into klp-dev 2013-09-23 22:10:09 +00:00
Dianne Hackborn
6d9ef38b06 Implement issue #10895990: Better durations for proc stats
Reduce the batching down to 3 hours, so that we can show shorter
durations in the UI.

Change-Id: I46af674b0024b828595ed3cdad2b47fe47d71ed8
2013-09-23 14:39:23 -07:00
Ken Sumrall
d3fbba1579 Merge "Upload fsck logs to the dropbox when error found" into klp-dev 2013-09-23 20:07:10 +00:00