Commit Graph

12438 Commits

Author SHA1 Message Date
Amith Yamasani
fa80ffa4fd am 638918a2: am 722b15e0: Merge "Fix a regression in pausing activity immediately on sleep" into klp-dev
* commit '638918a2681cff345b9e3bd5ff7b170a874125dc':
  Fix a regression in pausing activity immediately on sleep
2013-09-20 11:20:03 -07:00
Dianne Hackborn
9bef5b67dc resolved conflicts for merge of 20021b30 to master
Change-Id: Ie758de25a277ed0a25bf08e4cd2c57c9519bd52d
2013-09-20 10:40:34 -07:00
Craig Mautner
de4232f721 am 9ea8bf15: am 7908f190: Merge "Debug for b/10689184." into klp-dev
* commit '9ea8bf154cdad4b4cb627d9d6c9a9bc01c31abcd':
  Debug for b/10689184.
2013-09-20 09:58:41 -07:00
Craig Mautner
2c34bd6a9a am cd569b31: am e8a94224: Merge "Return tasks in correct order." into klp-dev
* commit 'cd569b31d398fe846eeee567d2816a3bb93dd493':
  Return tasks in correct order.
2013-09-20 09:58:22 -07:00
Christopher Tate
0719715586 am 654aad21: am 9c5cc571: Merge "Support for "not the home app you\'re looking for" metadata" into klp-dev
* commit '654aad21609642f7d0891962d72c0dfd4077fb94':
  Support for "not the home app you're looking for" metadata
2013-09-20 09:58:18 -07:00
Amith Yamasani
25fd841bd5 am 80af4f7b: am 7301bd96: Merge "Use a separate thread for services that do NTP lookup" into klp-dev
* commit '80af4f7b098aa912dcc7c2ccaf4a559e15e608ff':
  Use a separate thread for services that do NTP lookup
2013-09-20 09:58:08 -07:00
Amith Yamasani
638918a268 am 722b15e0: Merge "Fix a regression in pausing activity immediately on sleep" into klp-dev
* commit '722b15e00065bebfd711a34123a64b1c4a65d8f7':
  Fix a regression in pausing activity immediately on sleep
2013-09-19 15:46:19 -07:00
Amith Yamasani
722b15e000 Merge "Fix a regression in pausing activity immediately on sleep" into klp-dev 2013-09-19 22:42:50 +00:00
Dianne Hackborn
20021b300f am 70817c47: Merge "Implement issue #10691475: Kill cached processes if about to..." into klp-dev
* commit '70817c479aa05778733d9afc809c311e8030b000':
  Implement issue #10691475: Kill cached processes if about to...
2013-09-19 14:49:35 -07:00
Dianne Hackborn
70817c479a Merge "Implement issue #10691475: Kill cached processes if about to..." into klp-dev 2013-09-19 21:44:20 +00:00
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
Amith Yamasani
ce15e157a6 Fix a regression in pausing activity immediately on sleep
At some point during refactoring of ActivityStack, the code to pause the current
activity got deleted. Added back that line of code. Activity will now pause
as soon as the screen is turned off, rather than after 5 seconds (sleep timeout).

Bug: 10632898

Change-Id: If3cc8708d692d29a13dbd8cfd9edda8883b38c2e
2013-09-19 14:30:47 -07:00
Craig Mautner
9ea8bf154c am 7908f190: Merge "Debug for b/10689184." into klp-dev
* commit '7908f19015632bd593965b7a3ac9c685ab23d85f':
  Debug for b/10689184.
2013-09-19 14:10:41 -07:00
Craig Mautner
7908f19015 Merge "Debug for b/10689184." into klp-dev 2013-09-19 21:08:27 +00:00
Craig Mautner
cd569b31d3 am e8a94224: Merge "Return tasks in correct order." into klp-dev
* commit 'e8a9422495d6af9fc68cf4e838a4a5f19177034b':
  Return tasks in correct order.
2013-09-19 13:05:43 -07:00
Craig Mautner
e8a9422495 Merge "Return tasks in correct order." into klp-dev 2013-09-19 20:03:24 +00:00
Craig Mautner
b3370cec71 Debug for b/10689184.
Change-Id: I67b7a4bd7fb902b0d0275af0665625593dc1af00
2013-09-19 12:55:19 -07:00
Christopher Tate
654aad2160 am 9c5cc571: Merge "Support for "not the home app you\'re looking for" metadata" into klp-dev
* commit '9c5cc571e5abf97a816fea2b04cd1e711e83564c':
  Support for "not the home app you're looking for" metadata
2013-09-19 12:48:19 -07: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
Amith Yamasani
80af4f7b09 am 7301bd96: Merge "Use a separate thread for services that do NTP lookup" into klp-dev
* commit '7301bd96c43f1a3604e88612c1a4214d57f88000':
  Use a separate thread for services that do NTP lookup
2013-09-19 12:21:12 -07: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
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
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
Craig Mautner
0bb53db2fa am acc7f154: am 81d1689c: Merge "Remove debug logging for b/106899184." into klp-dev
* commit 'acc7f154a780489a1b3dcc9e1677c0389c088b5d':
  Remove debug logging for b/106899184.
2013-09-19 07:56:58 -07:00
Craig Mautner
acc7f154a7 am 81d1689c: Merge "Remove debug logging for b/106899184." into klp-dev
* commit '81d1689ceb3252d2cfa3397cd6a5b3337a3a6a75':
  Remove debug logging for b/106899184.
2013-09-19 07:53:03 -07:00
Craig Mautner
81d1689ceb Merge "Remove debug logging for b/106899184." into klp-dev 2013-09-19 14:50:41 +00:00
Jim Miller
8b7ea57f8e am cd87d0ab: am f4292478: Merge "Fix keyguard/Keystore storage issue" into klp-dev
* commit 'cd87d0ab9623d5028d767e8167923c57aa2bac0d':
  Fix keyguard/Keystore storage issue
2013-09-18 17:06:21 -07:00
Craig Mautner
ec9cf65b55 Remove debug logging for b/106899184.
Change-Id: I1e5f959a6d674b4bf9609553f28e66ffee367f5c
2013-09-18 17:04:45 -07:00
Jim Miller
cd87d0ab96 am f4292478: Merge "Fix keyguard/Keystore storage issue" into klp-dev
* commit 'f429247867ac524cf63bc01499ac47a90ebcaca9':
  Fix keyguard/Keystore storage issue
2013-09-18 17:02:48 -07:00
Jim Miller
f429247867 Merge "Fix keyguard/Keystore storage issue" into klp-dev 2013-09-19 00:00:22 +00:00
Jason Monk
41d6e07bf2 am 275d1adf: am ff65c6da: Merge "Fix PacManager to not unbind when no connection" into klp-dev
* commit '275d1adf0a8d7817f9a28c92822f5adb405528ff':
  Fix PacManager to not unbind when no connection
2013-09-18 16:55:28 -07:00
Jason Monk
275d1adf0a am ff65c6da: Merge "Fix PacManager to not unbind when no connection" into klp-dev
* commit 'ff65c6daab5268c28b3663cd02c1b3dfa6f1c90a':
  Fix PacManager to not unbind when no connection
2013-09-18 16:53:06 -07:00
Jason Monk
ff65c6daab Merge "Fix PacManager to not unbind when no connection" into klp-dev 2013-09-18 23:51:07 +00:00
Craig Mautner
d4338177c0 am 2325fd5d: am 4ef2693a: Revert back to a single home app in mHomeProcess
* commit '2325fd5d1192553c7056eeec2e1e458886dd173f':
  Revert back to a single home app in mHomeProcess
2013-09-18 16:05:29 -07:00
Craig Mautner
2325fd5d11 am 4ef2693a: Revert back to a single home app in mHomeProcess
* commit '4ef2693a243b308fad775a8a1691963c51ac925e':
  Revert back to a single home app in mHomeProcess
2013-09-18 16:02:59 -07:00
Craig Mautner
4ef2693a24 Revert back to a single home app in mHomeProcess
The idea of multiple processes serving as home was unfeasible.

- Revert "Allow for more than one home app." commit
e428a7f662.
- Assign ActivityManagerService.mHomeProcess to the process of the
root activity of the home task.

Addresses bug 10342471.

Change-Id: Ifb494626107d24de1306e320a18206d5b176a7c0
2013-09-18 15:48:28 -07:00
Kenny Root
b5a14f0fc9 resolved conflicts for merge of 1995a7de to master
Change-Id: I9915ae06d460696b24cbee935738267911baa580
2013-09-18 14:23:58 -07:00
Dianne Hackborn
1995a7de5b am b9466db4: Merge "Finish issue #10779747: Calendar Storage crash observed..." into klp-dev
* commit 'b9466db4a56564101a26865962dda87aaeab56ff':
  Finish issue #10779747: Calendar Storage crash observed...
2013-09-18 13:37:02 -07:00
Dianne Hackborn
b9466db4a5 Merge "Finish issue #10779747: Calendar Storage crash observed..." into klp-dev 2013-09-18 20:34:11 +00:00
Craig Mautner
7c4e91b133 am 566f7fed: am 138685d9: Merge "Move flag for home launching from activity to task." into klp-dev
* commit '566f7fede191ab2667237e147bee6b74c05ded32':
  Move flag for home launching from activity to task.
2013-09-18 12:53:10 -07:00
Craig Mautner
566f7fede1 am 138685d9: Merge "Move flag for home launching from activity to task." into klp-dev
* commit '138685d9db005cbd62ede45eb066a2e672db9588':
  Move flag for home launching from activity to task.
2013-09-18 12:50:31 -07:00
Dianne Hackborn
6285a32f74 Finish issue #10779747: Calendar Storage crash observed...
...while setting up a new user from settings.

We can now delay broadcasts when there are enough background services
currently starting (still set to 1 for svelte devices, 3 for normal
devices).

Add new intent flag to not allow receivers to abort broadcasts, which
I use to fix an issue with the initial BOOT_COMPLETED broadcast not
actually requesting pss data at the right time -- it can now be sent
as an ordered broadcast without the ability for the receivers to cancel
it.

Change-Id: I51155bbbabe23e187003f3e2abd7b754e55d3c95
2013-09-18 12:09:47 -07:00
Craig Mautner
ae7ecab400 Move flag for home launching from activity to task.
The variable ActivityRecord.mLaunchHomeTaskNext was used to indicate
that the home task should be launched when the activity completed.
This only mattered when it was at the end of a task. As the activity
launched other activities within the same task it needed to be
migrated from activity to activity and task to task. This became
too complicated and was at the wrong level to begin with.

By moving the flag to TaskRecord.mOnTopOfHome the logic is simpler
and the results more predictable.

Fixes bug 10602256.

Change-Id: If0b752522b77be9918f1dba221d0ff670fc01af8
2013-09-18 11:48:14 -07:00
Jason Monk
bc018d89c2 Fix PacManager to not unbind when no connection
PacManager previously would unbind service even when there was no
connection.  This means that multiple set proxies of no PAC after a PAC was
present would cause the framework to crash.

Bug: 10801296
Change-Id: I4387b50b6510cea3ee73425c8a0a837f816b0ce1
2013-09-18 09:28:29 -04:00
Dianne Hackborn
397196870e am 12b22479: am 222920c4: Merge "Maybe fix issue #10797796: IllegalStateException in ProcessState..." into klp-dev
* commit '12b224799626a506ff3cb3c01cdfdc5b66bce5e3':
  Maybe fix issue #10797796: IllegalStateException in ProcessState...
2013-09-17 17:39:32 -07:00
Dianne Hackborn
12b2247996 am 222920c4: Merge "Maybe fix issue #10797796: IllegalStateException in ProcessState..." into klp-dev
* commit '222920c46044d4782df3cd5b3c6c7e6578659903':
  Maybe fix issue #10797796: IllegalStateException in ProcessState...
2013-09-17 17:36:15 -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
Craig Mautner
5b35bab44a am 2af9dd71: am 019f8cb8: Merge "Add bounds checks before accessing ArrayList." into klp-dev
* commit '2af9dd716ec117af602b86c0d26cc40eb733338e':
  Add bounds checks before accessing ArrayList.
2013-09-17 16:18:15 -07:00