2674 Commits

Author SHA1 Message Date
Dianne Hackborn
3bc8f78d7a Implement issue #10691475: Kill cached processes if about to...
...be uncached and too large

When the device is in a low RAM state, when we go to pull a cached
process out to use for some background operation, we can now kill
the current process if we consider its size to be too large.

Note that the current implementation for killing processes is to
just use the same killUnneededProcessLocked() method that we already
have for other things like too many cached processes.  This is a
little wrong here, though, because in this case we are at the
point where the caller is actually looking for a process to use.
This current code is not actually removing or cleaning up the
process, so we still need to return the now killed ProcessRecord
and let things fall out from there, which typically means the caller
trying to make an IPC on it and failing and falling into its "oh
no the process died unexpectedly" path.  All code using this
*should* be able to handle this correctly, anyway, since processes
really can be killed at any time.

At some point we may to make this implementation cleaner, where it
actually tears down the process right in the call and returns a
null ProcessRecord.  That is very dangerous however (we'd need to
go through all paths into this to make sure they are going to be
okay with process state changing on them like that), and I'm not
sure it is really worthwhile.  This intention is that killing
processes like this is unusual, due to processes being too large,
and anyway as I wrote all of our incoming code paths must already
be able to handle the process being killed at this point and one
could argue this is just another way to excercise those code paths.
Really, the main negative to this is that we will often have spam
in the log with exceptions about processes dying unexpectedly.
If that is the only issue, we could just add some conditions to
quiet that up at in this case.

We don't want to compute the size of the process each time we try
to evaluate it here (it takes 10s or ms to do so), so there is now
a new field associated with the process to give us the last pss
size we computed for it while it was in the cached state.

To be able to have better cached pss data when we now need it, the
timing for computing process pss has been tuned to use a much
shorter delay for the situations when the process has first switch
into a new state.  This may result in us having a fair amount more
pss data overall, which is good, as long as it doesn't cause us to
be computing pss excessively and burning cpu.

Procstats now also has new state to keep track of the number of
times each process has been killed by this new system, along with
the min, avg, max pss of all the times it has happened.  This has
slightly changed the checkin format to include this additional data
at the end of pkgkills/prockills lines.

Other changes here:

- Fixed a problem where GPU RAM was not being seen when dumping
  the full RAM details of a process.  This was because in that
  case the system would ask the process to compute its own MemInfo,
  which it returned, but the process doesn't have permission to
  access the files containing the GPU RAM data.  So now the system
  always computes the MemInfo and hands it to the app.

- Improved broadcast delays to not apply the delay if the next receiver
  of the broadcast is going to run in the same process as the last
  one.  A situation I was seeing was an application that had two
  receivers, one of which started a service; we are better off letting
  the second receiver run while the service is running.

- Changed the alarm manager's TIME_TICK broadcast to be a foreground
  broadcast.  This really should have been anyway (it is supposed to
  go out even minute, on the minute, very accurately, for UI elements
  to update), and is even more important now that we are doing more
  things to delay background broadcasts.

- Reworked how we maintain the LRU process list.  It is now divided
  into the two parts, the top always containing the processes holding
  activities.  This better matches the semantics we want (always try
  to keep those around modulated by the LRU order we interleave with
  other cached processes), and we now know whether a process is being
  moved on the LRU list because of an activity operation so we can
  only change the order of these activity processes when user operations
  happen.  Further, this just makes that common code path a lot simpler
  and gets rid of all the old complexity that doesn't make sense any
  more.

Change-Id: I04933ec3931b96db70b2b6ac109c071698e124eb
2013-09-19 14:35:53 -07:00
Jim Miller
f429247867 Merge "Fix keyguard/Keystore storage issue" into klp-dev 2013-09-19 00:00:22 +00:00
Amith Yamasani
a6f387a055 Merge "Don't handle click if the resolver is already finishing." into klp-dev 2013-09-18 20:35:12 +00:00
Amith Yamasani
07cd351b4a Don't handle click if the resolver is already finishing.
Fixes bug that double tapping on an entry in the intent disambig dialog
can result in the picked activity being launched twice.

Bug: 10770501
Change-Id: Ibb7c6bea5f3c25fa204a2f0e65c8044c2a2549f7
2013-09-18 13:16:00 -07:00
Dianne Hackborn
222920c460 Merge "Maybe fix issue #10797796: IllegalStateException in ProcessState..." into klp-dev 2013-09-18 00:34:02 +00:00
Dianne Hackborn
53459a7020 Maybe fix issue #10797796: IllegalStateException in ProcessState...
...caused runtime restart

There were some situations where the package list could be set
with process stats when it shouldn't.  Not sure if this is causing
the problem, since there is no repro.

Also some improvements to debug output -- new commands to clear
all stats, print full details of stats, and print a one-day
summary (which should match what the UI shows).

Change-Id: I9581db4059d7bb094f79f2fe06c1ccff3e1a4e74
2013-09-17 17:30:34 -07:00
Adam Powell
70aafea91e Merge "Action bar transitions - handle expanding/collapsing action views" into klp-dev 2013-09-17 20:47:08 +00:00
Adam Powell
c46d33393f Action bar transitions - handle expanding/collapsing action views
Make sure we beginDelayedTransition when we expand and collapse action
views, specifically before any callbacks go out that might alter the
hierarchy.

Change-Id: Iffc286cccd9be83ad03aeede605870ac12cc6bab
2013-09-17 10:08:41 -07:00
Dianne Hackborn
50ef0b62f0 Work on issue #10771346: runtime restart
Haven't found the underlying cause, but this will give us more
information when we get into the bad state.

Change-Id: I9aebd3a025a7c0d931f43098461b64ee3c220746
2013-09-16 17:40:27 -07:00
Jim Miller
de1af08dd3 Fix keyguard/Keystore storage issue
Keystore stored keys broke when keyguard was moved out of the system process
due to Keystore enforcing the calling app to be in the system process.

The fix moves the critical code into LockSettingsService, which continues
to live in the system process.

Fixes bug 10201270

Change-Id: I16e2de018e85b01265634dcfbefd7f06740dafa8
2013-09-16 15:34:26 -07:00
Daniel Sandler
80c3c4e960 New platlogo for K.
Bug: 10605145
Change-Id: I23f285ec24118982b10f5d801b75925b9dc81c64
2013-09-16 14:40:03 -04:00
Daniel Sandler
a30b7035ce Fix RenderScript crash.
Also lay the groundwork for a future checkin.

Bug: 10240151
Bug: 10505742
Change-Id: I62d61c9048188c93863c8c43839e713b75a65102
2013-09-16 11:19:15 -04:00
Dianne Hackborn
a0332377e1 Maybe fix issue #10748810: Runtime restart: crash under...
...ActivityManagerService.setProcessTrackerState

And if not, at least we'll have a little more debug info
when it happens again.

Change-Id: I685f0f72c2e1b17608a8d069d6c7f2cff2fd0abd
2013-09-13 18:34:13 -07:00
Adam Powell
3157e73fb0 Merge "Don't recycle action button views" into klp-dev 2013-09-13 23:46:38 +00:00
Dianne Hackborn
8e69257a9c Implement #10749688: Improve low memory reporting
This significantly reworks the logging we do when
all cached processes are killed:

- We now collect the list of processes in-place so we
  have a snapshot of exactly when the low memory situation
  happened.
- In that snapshot we include the key process state: oom
  adj, proc state, adj reasons.
- The report then asynchronously collects pss information
  for those processes.
- The ultimate data printed to the log looks like a mix
  between the "dumpsys meminfo" and "dumpsys activity"
  output.  This code no longer uses "dumpsys meminfo"
  itself, so some of that data is no longer included,
  in particular pss organized by allocation type.

In doing this, I realized that the existing code that is
supposed to run "procstats" is not currently working.  And
at that point I realized, really, when we are collecting
this pss data we'd really like to include all those native
processes using ghod-only-knows how much RAM.  And guess
what, we have a list of processes available in
ProcessCpuTracker.

So we now also collect and print information for native
processes, and we also do this for "dumpsys meminfo" which
really seems like a good thing when we are printing summaries
of all pss and such.

I also improved the code for reading /proc/meminfo to be
able to load all the interesting fields from there, and
am now printing that as well.

Change-Id: I9e7d13e9c07a8249c7a7e12e5433973b2c0fdc11
2013-09-13 16:02:01 -07:00
Adam Powell
76d915955f Don't recycle action button views
Recycling action button views interferes with transition
animations. Suppress menu item view recycling for them.

Change-Id: I69d7561e337be7e4a89b7cf30b6c9439f2d49cc2
2013-09-13 10:57:06 -07:00
Adam Powell
a2906cb4d9 Merge "Show alternate menu panel on devices with menu key" into klp-dev 2013-09-12 18:12:05 +00:00
Adam Powell
5fcf5b9fd3 Show alternate menu panel on devices with menu key
Provide a softer transition to the overflow-everywhere world for
devices with menu keys. The panel menu will still be used on these
devices in response to a menu key press even in the presence of an
action bar with overflow.

Fix a few lingering bugs around dispatching the open-overflow
transition that caused problems with this along the way.

Change-Id: I9d77c70f6d15c47160ac06292984101d619c44e6
2013-09-11 19:17:38 -07:00
Adam Powell
ad79b90f21 Action bar refactoring and transitions
* Remove the extra occurrence of the Up caret view and reuse the
  standard home view.

* Use new transition APIs to animate changes in action bar content.

Change-Id: I7af3bb580ef4bff7d8dec9e21649b856fe73c77b
2013-09-10 18:09:03 -07:00
Mindy Pereira
99cea983de Merge "Update default ramp up time for autoscroller." into klp-dev 2013-09-09 20:51:16 +00:00
Dianne Hackborn
80213addda Merge "Fix issue #10671878: Proc stats needs to remove old data structures" into klp-dev 2013-09-09 20:37:02 +00:00
Alan Viverette
013634cc44 Merge "Add WebVTT caption renderer" into klp-dev 2013-09-09 20:31:14 +00:00
Eric Rowe
35980b2cf5 Add PID and application to Java crash printout
Bug: 10568405
Change-Id: I508e89bf7ea58e15a8460099036e270139b2e2a9
2013-09-09 11:40:31 -07:00
Alan Viverette
498301d8b5 Merge "Add drag-to-open for action bar submenus" into klp-dev 2013-09-09 17:24:05 +00:00
Dianne Hackborn
be4c1d74a7 Fix issue #10671878: Proc stats needs to remove old data structures
We now keep track of which process and service states are actively
in use, and remove any that are not in use during a commit.  The
activity manager needed to be tweaked to report this data, and ensure
it does not try to operate on one of these structures when not in
use.

Also some other fixes:

- We now keep track of process names associated with services, for
display in the UI.
- Keep track of total run time for each service, also for UI.
- The parceled format is more efficient, not storing duplicates of
process/package names, and writing times as ints when possible.
- Reduced commit period from 1 day to 12 hours, so that our UI can
be a little closer at its attempt to display the stats over 1 day.

Change-Id: Ifeda0ffe963a7b49d8eb2a3f6923f3a5e71a4e43
2013-09-09 09:49:52 -07:00
Alan Viverette
d43daf361e Add WebVTT caption renderer
Currently missing support for region anchor points, robust layout
when snapping to lines, and vertical text.

BUG: 10260603
Change-Id: I3463b4aa0039442159144e66922d67f5dfee58ed
2013-09-06 18:06:23 -07:00
Mindy Pereira
6a18f4ab29 Update default ramp up time for autoscroller.
2500 was too much and drowning the behavior where closeness to
the edge should set the speed.

Change-Id: If32999893d9ab59a0b77bd2b79b698a3baa64113
2013-09-06 13:58:15 -07:00
Alan Viverette
fbe4a586c2 Add drag-to-open for action bar submenus
BUG: 10649895
Change-Id: I5076e0d09453a75ed20c44eede4b43e8a2f535fd
2013-09-06 13:45:54 -07:00
Dianne Hackborn
d4a8b9d3c1 Fix issue #10650718: Camera DOA on KLP
Methods not kept in sync.

Change-Id: I2621255707bbc569ac476b8fb0f7e82f68585b12
2013-09-06 13:36:57 -07:00
Jeff Sharkey
911d7f411f Provide calling package to ContentProviders.
The calling package is important for ContentProviders that want to
grant Uri permissions as a side effect of operations, so offer it
through a new API.  Validates the provided package against the
calling UID before returning.

Bug: 10626527
Change-Id: I7277880eebbd48444c024bcf5f69199133cd59e4
2013-09-06 08:08:18 -07:00
Amith Yamasani
f1eebfc2cf Merge "Remove unused APIs and rename others based on API review" into klp-dev 2013-09-05 22:48:17 +00:00
Amith Yamasani
d304af6989 Remove unused APIs and rename others based on API review
Restrictions challenge is only to be used by device admins.

Bug: 10461761
Change-Id: I3db1249e2ce99f386602de59ed930302bb0a97fb
2013-09-05 09:30:23 -07:00
Chet Haase
e8222dddaf Change build version from KEY_LIME_PIE to KITKAT
Issue #10631619 Change build version to KitKat

Change-Id: I6ad13f6169ad74204078d36929479998b498ad8b
2013-09-05 08:44:33 -07:00
Dianne Hackborn
3cd28adc5d Merge "Fix issue #10427108: Google+ has long running process" into klp-dev 2013-09-04 20:22:27 +00:00
Dianne Hackborn
ae36b236d2 Fix issue #10427108: Google+ has long running process
There was a bug in counting the number of starting services
in a process that would cause it to count too many (it would
increment at any state change while the service is started, not
just when starting/stopping).

Also reduce dumpsys output -- only print summaries for old
data.  There is probably no utility in printing the long details
of all that data.

Change-Id: I1c1e901b0214c01eb7d071f23166fc6f3702ca67
2013-09-03 18:12:53 -07:00
Geoffrey Borggaard
4cf435a038 Merge "UX improvements to the restrictions PIN" into klp-dev 2013-09-04 00:41:26 +00:00
Amith Yamasani
7eed075a43 Merge "Don't call setLastChosen if it's a chooser activity instance" into klp-dev 2013-09-03 20:22:15 +00:00
Amith Yamasani
588dd2a3d6 Don't call setLastChosen if it's a chooser activity instance
Bug: 10605359
Change-Id: If76f5cf2f45442dc25f9bfbd20a4d671b9caa358
2013-09-03 12:31:42 -07:00
Alan Viverette
bc7e4b2cd5 Merge "Update internal AutoScrollHelper to match support lib version" into klp-dev 2013-08-30 23:58:08 +00:00
Geoffrey Borggaard
8135f3a9d3 UX improvements to the restrictions PIN
As per Rachel.  Remove the title, change the hint text.
Don't make the dialog disappear after failed attempts.
Bug: 10542734

Change-Id: I1cae3d74bd4da06364626d63faf945f629cf6537
2013-08-30 23:02:10 +00:00
Alan Viverette
cb168795fe Update internal AutoScrollHelper to match support lib version
BUG: 10547956
Change-Id: I7d5b1b9fb89ae8ff4294cc2dfd01e29b55ed3eba
2013-08-30 14:33:13 -07:00
Amith Yamasani
79a45c6f18 Merge "Improve Intent disambig dialog behavior" into klp-dev 2013-08-29 21:45:04 +00:00
Mindy Pereira
0d3da1232b Fix case when user touches the very edge of a view
This now counts touches at the exact top edge of the view as valid

Change-Id: I9e81a7001632c38d567dde40954e079e7145fa36
2013-08-28 15:00:14 -07:00
Amith Yamasani
e9ecc8b499 Improve Intent disambig dialog behavior
Keep track of last chosen activity for a particular intent, similar
to how it is tracked for "Always" choices.
Pre-select the last chosen activity if previously the user picked
"Just once".
Downgrade "Always" to "Last chosen" if there's a new kid on the block,
instead of removing it entirely.
Add methods to set and get last chosen entry.

UI - switch from Grid to List.

Bug: 9958096

Change-Id: Ied57147739a3ade1d36c3a7ec1e8ce77e5c5bb16
2013-08-27 18:05:00 -07:00
Christopher Tate
d381680b63 Merge "Make sure to actually log when Log.wtf() hiccups" into klp-dev 2013-08-27 21:15:03 +00:00
Christopher Tate
941adc95e1 Make sure to actually log when Log.wtf() hiccups
Bug 10494724

Change-Id: I687d7df73a8f4594d42955f100d928e98bbd9b30
2013-08-27 14:10:44 -07:00
Chris Wren
d220a830f4 Merge "Change DBG to false to eliminate logcat messages." into klp-dev 2013-08-27 18:20:44 +00:00
Svetoslav Ganov
6b8c69edd2 Merge "Update AccessibilityNodeInfo API as per API council request" into klp-dev 2013-08-27 18:14:01 +00:00
Svetoslav Ganov
cb8ed39b3f Update AccessibilityNodeInfo API as per API council request
bug:10461302

Change-Id: I9709a271ab3720e064b98c79c0950d811fe37b73
2013-08-27 08:26:13 -07:00
Alan Viverette
faf7a2087e Merge "Add auto-scrolling in ListPopupWindow drag-to-open mode" into klp-dev 2013-08-26 20:49:28 +00:00