112064 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
Craig Mautner
e8a9422495 Merge "Return tasks in correct order." into klp-dev 2013-09-19 20:03:24 +00:00
Christopher Tate
9c5cc571e5 Merge "Support for "not the home app you're looking for" metadata" into klp-dev 2013-09-19 19:46:20 +00:00
Christopher Tate
bd413f6c05 Support for "not the home app you're looking for" metadata
* Make sure that pm.getHomeActivities() returns the activity metadata
  as well, so that the caller can trace the reference

* Add a public canonical name for that metadata key

Bug 10749961

Change-Id: Ic4d0750d61001ffe5af180398f042afa30eea1ce
2013-09-19 12:31:49 -07:00
John Spurlock
0286f5e278 Merge "Bar gradients now 55% to 0% black." into klp-dev 2013-09-19 19:26:25 +00:00
John Spurlock
0558a6f0a6 Bar gradients now 55% to 0% black.
Bug:10840205
Change-Id: If30e13ab4f61cd65b7fdf7e5e987191fec1f45f2
2013-09-19 15:22:17 -04:00
Amith Yamasani
7301bd96c4 Merge "Use a separate thread for services that do NTP lookup" into klp-dev 2013-09-19 19:17:51 +00:00
Jeff Sharkey
18b94817a4 Merge "Also catch one more tablet layout NPE." into klp-dev 2013-09-19 18:27:51 +00:00
Jeff Sharkey
f8abf2e387 Also catch one more tablet layout NPE.
Bug: 10837208
Change-Id: I178110431221773658403319b2be7aff22adadc8
2013-09-19 11:25:56 -07:00
Jeff Sharkey
7cb93f4e22 Merge "Fix tablet layout and resources." into klp-dev 2013-09-19 18:22:12 +00:00
Craig Mautner
c0fd805234 Return tasks in correct order.
Fixed ActivityManager.getRunningTasks().

Fixes bug 10705790.

Change-Id: Ia3f66e592e08a87896a1ab59f980618ec5310dfe
2013-09-19 11:20:17 -07:00
Jeff Sharkey
0aaeaab0bf Fix tablet layout and resources.
Bug: 10837208
Change-Id: I563a3b66976b5b02cdb25e077bf0709bb6e66926
2013-09-19 11:19:39 -07:00
Amith Yamasani
450a16b33f Use a separate thread for services that do NTP lookup
Some services do periodic network time lookups and can wedge the other operations on
BackgroundThread and IO Thread, causing Watchdog to kill the runtime. So best to put
those handlers on separate threads.

Going forward, should convert NTP lookups to be async with callbacks.

Bug: 10646480
Change-Id: I8c7ba6052cb3539575712c2099a706b14ff60196
2013-09-19 10:57:16 -07:00
Derek Sollenberger
a2c6209f61 Merge "Update SkTypeface::CreateFromName to handle NULL if familyName does not match" into klp-dev 2013-09-19 17:52:00 +00:00
Baligh Uddin
25f9f364f5 Merge "Import translations. DO NOT MERGE" into klp-dev 2013-09-19 17:39:50 +00:00
Baligh Uddin
07cf648761 Merge "Import translations. DO NOT MERGE" into klp-dev 2013-09-19 17:39:32 +00:00
Geoffrey Borggaard
5b05a1159b Merge "Remove char limit." into klp-dev 2013-09-19 17:39:22 +00:00
Baligh Uddin
8074862d9b Merge "Import translations. DO NOT MERGE" into klp-dev 2013-09-19 17:39:17 +00:00
Geoffrey Borggaard
8e7586fa0b Remove char limit.
This dialog box has plenty of room.
Bug: 10628262
Bug: 10618549
Bug: 10628357
Bug: 10618708

Change-Id: If1057fcbe1e40704958727e0a0337bdd6b8480a2
2013-09-19 13:28:59 -04:00
Svetoslav
81d4014c59 Hiding a method that was never meant to be public.
The hide javadoc annotation had a type, thus leaking the API.

bug:10552358

Change-Id: Iec4e203d0786efbe6afbd9b6995f11642935336c
2013-09-19 10:09:49 -07:00
John Spurlock
f95c9aa7e1 Merge "Don't disable animations until screen state is known." into klp-dev 2013-09-19 16:28:09 +00:00
John Spurlock
8c52042264 Don't disable animations until screen state is known.
Bug:10602521
Change-Id: I54a0c7a9dfd7d9c248854738414613d32d85476a
2013-09-19 12:23:35 -04:00
Chris Wren
f82e73c572 Merge "disable heads up feature in klp." into klp-dev 2013-09-19 16:18:59 +00:00
John Spurlock
219d0f32dd Merge "Draw gradient behind fully transparent system bars." into klp-dev 2013-09-19 16:04:15 +00:00
Jean-Michel Trivi
1608f496a3 Merge "Public API for RemoteController" into klp-dev 2013-09-19 15:49:40 +00:00
John Spurlock
e631b41d8b Draw gradient behind fully transparent system bars.
Use a transition-drawable to crossfade between the gradient and
solid color backgrounds, avoiding custom onDraw.

Rename colors to their final names.  Since both bars now receive the
gradient treatment, centralize in base BarTransitions.

Bug:10602521
Change-Id: Id094fa1767eabab88a3709d6026c23858c83fb5b
2013-09-19 11:28:54 -04:00
Daniel Sandler
1816375ff7 Merge "New sounds for K." into klp-dev 2013-09-19 14:52:07 +00:00
Craig Mautner
81d1689ceb Merge "Remove debug logging for b/106899184." into klp-dev 2013-09-19 14:50:41 +00:00
Derek Sollenberger
89ec829908 Update SkTypeface::CreateFromName to handle NULL if familyName does not match
This is a multi-project change with a dependency on external/skia

bug: 10730965
Change-Id: Ida880a86ebd182a221333bbd85eaa30d047a1618
2013-09-19 08:14:53 -04:00
Baligh Uddin
bbe7af04a8 Import translations. DO NOT MERGE
Change-Id: I21beea4e8c038684fed962494b3a5213fea4c818
Auto-generated-cl: translation import
2013-09-19 00:00:37 -07:00
Baligh Uddin
59db60e498 Import translations. DO NOT MERGE
Change-Id: I0da9befa56ba6e4a599b5796182898cc7093043d
Auto-generated-cl: translation import
2013-09-18 23:42:59 -07:00
Baligh Uddin
1a403edb4e Import translations. DO NOT MERGE
Change-Id: I4409b360313b275ac5e6cec0af55fcc5f3962c7a
Auto-generated-cl: translation import
2013-09-18 23:11:07 -07:00
Dave Langemak
a2d65108dd Merge "Latest UX asset drop." into klp-dev 2013-09-19 05:02:55 +00:00
Joe Fernandez
f1fc0ad39e am 149eb677: am 1c774af0: am 608a48af: Merge "docs: SDK 22.2.1 Release Notes" into jb-mr2-docs
* commit '149eb677156ddd2c815c185642c9b5d9e6294287':
  docs: SDK 22.2.1 Release Notes
2013-09-18 21:34:41 -07:00
Joe Fernandez
bc15f8b02d am bf0f0701: am fe2d0c4c: am 3ce21086: Merge "docs: RenderScript Dev Guide fixes" into jb-mr2-docs
* commit 'bf0f07018c50d858900af8114eaf5133ea293b0f':
  docs: RenderScript Dev Guide fixes
2013-09-18 21:34:39 -07:00
Joe Fernandez
149eb67715 am 1c774af0: am 608a48af: Merge "docs: SDK 22.2.1 Release Notes" into jb-mr2-docs
* commit '1c774af0d30349b7512cf2461c939a1d45770989':
  docs: SDK 22.2.1 Release Notes
2013-09-18 21:31:11 -07:00
Joe Fernandez
bf0f07018c am fe2d0c4c: am 3ce21086: Merge "docs: RenderScript Dev Guide fixes" into jb-mr2-docs
* commit 'fe2d0c4cbe852de9d3b247cff3013db73d98dce4':
  docs: RenderScript Dev Guide fixes
2013-09-18 21:31:08 -07:00
Joe Fernandez
1c774af0d3 am 608a48af: Merge "docs: SDK 22.2.1 Release Notes" into jb-mr2-docs
* commit '608a48afe4a852ec543f5fe15ea67807e326a8b2':
  docs: SDK 22.2.1 Release Notes
2013-09-18 21:28:33 -07:00
Joe Fernandez
fe2d0c4cbe am 3ce21086: Merge "docs: RenderScript Dev Guide fixes" into jb-mr2-docs
* commit '3ce210869725619c3222dc8147d1117d9a8c47c9':
  docs: RenderScript Dev Guide fixes
2013-09-18 21:28:30 -07:00
Joe Fernandez
608a48afe4 Merge "docs: SDK 22.2.1 Release Notes" into jb-mr2-docs 2013-09-19 04:27:16 +00:00
Joe Fernandez
3ce2108697 Merge "docs: RenderScript Dev Guide fixes" into jb-mr2-docs 2013-09-19 04:26:38 +00:00
Daniel Sandler
dcbdd3b420 New sounds for K.
AudioPackage12 uses the new sounds (specifically the default
versions at 44.1kHz); device-specific makefiles can elect to
use the 48k versions instead by including
AudioPackage12_48.mk.

Bug: 9454760
Change-Id: If714fc4b98f6700163f08c92a6376f28f9616382
2013-09-18 23:09:58 -04:00
Svetoslav
ac7297bdc0 Merge "Fixes in the page range selection and verification logic." into klp-dev 2013-09-19 02:16:11 +00:00
Jean-Michel Trivi
a83487e8c6 Public API for RemoteController
Public API, under system|signature permission for access to
  currently playing metadata and playback state.
Public API for sending media key events.

Bug 8209392

Change-Id: I39b9309ca3fb1bc305492bad98740df0ae0842b2
2013-09-18 18:12:51 -07:00
Jeff Sharkey
0972ae156b Merge "Save directory state and animate." into klp-dev 2013-09-19 01:12:34 +00:00
James Kelly
03f66d5928 am 1f8cf09c: am 2815bb05: am 48c6b573: Merge "more string changes for wi-fi trademark compliance" into jb-mr2-docs
* commit '1f8cf09c53c72d26ca67974d1b7e51112be4a170':
  more string changes for wi-fi trademark compliance
2013-09-18 18:10:14 -07:00
James Kelly
1f8cf09c53 am 2815bb05: am 48c6b573: Merge "more string changes for wi-fi trademark compliance" into jb-mr2-docs
* commit '2815bb05a042975b282f7131514368aa89cf0dd4':
  more string changes for wi-fi trademark compliance
2013-09-18 18:07:02 -07:00
James Kelly
2815bb05a0 am 48c6b573: Merge "more string changes for wi-fi trademark compliance" into jb-mr2-docs
* commit '48c6b5735ef6a8f6afe92ed7c34d848d1f7754a3':
  more string changes for wi-fi trademark compliance
2013-09-18 18:04:45 -07:00
Jeff Sharkey
563ee0fbe9 Latest UX asset drop.
Darker action bar overflow icon, larger grid-mode directory icon,
icon for music albums, generic file icon.

Fix bug that allowed null MIME types to be picked.

Bug: 10700025
Change-Id: I2089678eaf793bc3c7214b21c9de5f38429ebb0f
2013-09-18 18:03:49 -07:00
James Kelly
48c6b5735e Merge "more string changes for wi-fi trademark compliance" into jb-mr2-docs 2013-09-19 01:02:13 +00:00