11321 Commits

Author SHA1 Message Date
Dianne Hackborn
c9dc93e5ca Merge "Start combining threads in system process." 2013-05-03 01:48:55 +00:00
Dianne Hackborn
8d044e8bc2 Start combining threads in system process.
This introduces four generic thread that services can
use in the system process:

- Background: part of the framework for all processes, for
work that is purely background (no timing constraint).
- UI: for time-critical display of UI.
- Foreground: normal foreground work.
- IO: performing IO operations.

I went through and moved services into these threads in the
places I felt relatively comfortable about understanding what
they are doing.  There are still a bunch more we need to look
at -- lots of networking stuff left, 3 or so different native
daemon connectors which I didn't know how much would block,
audio stuff, etc.

Also updated Watchdog to be aware of and check these new
threads, with a new API for other threads to also participate
in this checking.

Change-Id: Ie2f11061cebde5f018d7383b3a910fbbd11d5e11
2013-05-02 17:42:40 -07:00
Dianne Hackborn
0c8949db30 am 4c41f6cd: am 856a5a86: Merge "Fix issue #8768456: Settings > App Info under reports..." into jb-mr2-dev
* commit '4c41f6cd1852aaeeb067ad568c3b77a816769d64':
  Fix issue #8768456: Settings > App Info under reports...
2013-05-02 15:17:32 -07:00
Dianne Hackborn
4c41f6cd18 am 856a5a86: Merge "Fix issue #8768456: Settings > App Info under reports..." into jb-mr2-dev
* commit '856a5a860e11a85f8fbb1ad07f6ef444abeafbaf':
  Fix issue #8768456: Settings > App Info under reports...
2013-05-02 15:15:19 -07:00
Christopher Tate
b4997af5cf am 77a66f44: am b8453357: Merge "Send package-changed broadcasts to the correct users" into jb-mr2-dev
* commit '77a66f44590853cce7c58d643b6064ed5974cf03':
  Send package-changed broadcasts to the correct users
2013-05-02 15:14:06 -07:00
Christopher Tate
77a66f4459 am b8453357: Merge "Send package-changed broadcasts to the correct users" into jb-mr2-dev
* commit 'b84533575601133868bf414c526b5b30de3e62c6':
  Send package-changed broadcasts to the correct users
2013-05-02 15:11:52 -07:00
Dianne Hackborn
856a5a860e Merge "Fix issue #8768456: Settings > App Info under reports..." into jb-mr2-dev 2013-05-02 22:11:36 +00:00
Christopher Tate
1e08f5c3b3 Send package-changed broadcasts to the correct users
Also be sure to drop any pending package-changed broadcasts
that are targeted to a now-removed user.

Bug 8594153

Change-Id: Ib14874b4a67b968bbf6ca12ee095c85383aff324
2013-05-02 14:18:51 -07:00
Romain Guy
3b748a44c6 Pack preloaded framework assets in a texture atlas
When the Android runtime starts, the system preloads a series of assets
in the Zygote process. These assets are shared across all processes.
Unfortunately, each one of these assets is later uploaded in its own
OpenGL texture, once per process. This wastes memory and generates
unnecessary OpenGL state changes.

This CL introduces an asset server that provides an atlas to all processes.

Note: bitmaps used by skia shaders are *not* sampled from the atlas.
It's an uncommon use case and would require extra texture transforms
in the GL shaders.

WHAT IS THE ASSETS ATLAS

The "assets atlas" is a single, shareable graphic buffer that contains
all the system's preloaded bitmap drawables (this includes 9-patches.)
The atlas is made of two distinct objects: the graphic buffer that
contains the actual pixels and the map which indicates where each
preloaded bitmap can be found in the atlas (essentially a pair of
x and y coordinates.)

HOW IS THE ASSETS ATLAS GENERATED

Because we need to support a wide variety of devices and because it
is easy to change the list of preloaded drawables, the atlas is
generated at runtime, during the startup phase of the system process.

There are several steps that lead to the atlas generation:

1. If the device is booting for the first time, or if the device was
updated, we need to find the best atlas configuration. To do so,
the atlas service tries a number of width, height and algorithm
variations that allows us to pack as many assets as possible while
using as little memory as possible. Once a best configuration is found,
it gets written to disk in /data/system/framework_atlas

2. Given a best configuration (algorithm variant, dimensions and
number of bitmaps that can be packed in the atlas), the atlas service
packs all the preloaded bitmaps into a single graphic buffer object.

3. The packing is done using Skia in a temporary native bitmap. The
Skia bitmap is then copied into the graphic buffer using OpenGL ES
to benefit from texture swizzling.

HOW PROCESSES USE THE ATLAS

Whenever a process' hardware renderer initializes its EGL context,
it queries the atlas service for the graphic buffer and the map.

It is important to remember that both the context and the map will
be valid for the lifetime of the hardware renderer (if the system
process goes down, all apps get killed as well.)

Every time the hardware renderer needs to render a bitmap, it first
checks whether the bitmap can be found in the assets atlas. When
the bitmap is part of the atlas, texture coordinates are remapped
appropriately before rendering.

Change-Id: I8eaecf53e7f6a33d90da3d0047c5ceec89ea3af0
2013-05-02 13:32:09 -07:00
Dianne Hackborn
ecc8d6f114 Fix issue #8768456: Settings > App Info under reports...
...app storage size for apps w/ .so files

The lib directories are tagged with the apk install number,
so must be explicitly passed down to installd.

Change-Id: Ic37b03726f9a7405eb05956703f8198223b22595
2013-05-02 11:17:15 -07:00
Jeff Sharkey
037db6cfd0 Merge "External storage provider, document picker UI." 2013-05-02 00:46:46 +00:00
Jeff Sharkey
9e0036ed7d External storage provider, document picker UI.
Continuing to flesh out storage backends by adding an external
storage document backend.  Still rough, but it can traverse files
and directories.

Early pass at OPEN/CREATE_DOC picker UI, which offers to traverse
any known storage backends.  Supports opening subdirectories and
returning a picked file.

Change-Id: Idc3554036b3816a93d9b465ee8a620746859d2ae
2013-05-01 17:44:42 -07:00
Michael Wright
475fe218ea Merge "Dump system server stack trace on watchdog failure" 2013-05-02 00:18:13 +00:00
Michael Wright
56a6c66158 Dump system server stack trace on watchdog failure
Change-Id: Ia70b116b789a51c4fbdd31348f127685f20f7500
2013-05-01 17:15:56 -07:00
Christopher Tate
7abc275e80 am bd5fca23: am eed8411c: Merge "Bootstrap installed system apps only when the target user is running" into jb-mr2-dev
* commit 'bd5fca23e12f2a3491ea63e5761a5897f084d689':
  Bootstrap installed system apps only when the target user is running
2013-05-01 15:53:17 -07:00
Christopher Tate
bd5fca23e1 am eed8411c: Merge "Bootstrap installed system apps only when the target user is running" into jb-mr2-dev
* commit 'eed8411c8cc1f163ba06a928e3b4b6d3f1045282':
  Bootstrap installed system apps only when the target user is running
2013-05-01 15:50:42 -07:00
Christopher Tate
3335644f7a Bootstrap installed system apps only when the target user is running
I.e. don't bother trying to send a BOOT_COMPLETED broadcast to the
newly-installed/enabled system app when its host user isn't live.

Also use the static isSystemApp()-type helpers instead of duplicating
those tests locally.

Bug 8594153

Change-Id: I4bd0b86351d67f72c44eae8d1afce6a98f034d31
2013-05-01 14:25:26 -07:00
Craig Mautner
c63bda0bd1 Merge "Handle case where finishActivity removes activity" 2013-05-01 19:02:29 +00:00
Craig Mautner
d94b1b480e Handle case where finishActivity removes activity
Fixes bug 8773046.

Change-Id: I2e9f15c19ee9b50347472542ace5287964964203
2013-05-01 11:58:03 -07:00
Jeff Sharkey
776069facf am a49cea63: am 033168b1: Merge "Lockdown VPN handles its own connection teardown." into jb-mr2-dev
* commit 'a49cea63a080b7c5f884626ba3c0309cb6e49f99':
  Lockdown VPN handles its own connection teardown.
2013-05-01 11:33:25 -07:00
Craig Mautner
c66a83751a Merge "Do not return to Home activity if not top task." 2013-05-01 18:32:33 +00:00
Craig Mautner
a1c12b2cae Merge "Move task methods into TaskRecord." 2013-05-01 18:32:06 +00:00
Jeff Sharkey
a49cea63a0 am 033168b1: Merge "Lockdown VPN handles its own connection teardown." into jb-mr2-dev
* commit '033168b1b0e6fc24a01bef6ec65948663f0ad3b7':
  Lockdown VPN handles its own connection teardown.
2013-05-01 11:31:41 -07:00
Craig Mautner
7085759954 Merge "A better fix for bug 8740202." 2013-05-01 18:31:31 +00:00
Jeff Sharkey
033168b1b0 Merge "Lockdown VPN handles its own connection teardown." into jb-mr2-dev 2013-05-01 18:30:23 +00:00
Craig Mautner
9e14d0fd9a Do not return to Home activity if not top task.
Add a test for being the top task when closing the last activity in a
task. Without this test, if the last activity in a task was flagged to
return to the home activity on completion but that activity had
launched a new task we would not go to the new task but would instead
launch the home activity.

Fixes bug 8775949.

Change-Id: I7fd9d9ebbdbff8064d894407c35190894a141ecf
2013-05-01 11:26:09 -07:00
gcondra@google.com
da1bb7cdbf am 334c04e2: am bb1a6244: Merge "Fix an NPE and fd leak in SELinux policy updater." into jb-mr2-dev
* commit '334c04e2f0eb62c6c9db73da0ec0021abffceb92':
  Fix an NPE and fd leak in SELinux policy updater.
2013-05-01 11:15:38 -07:00
gcondra@google.com
334c04e2f0 am bb1a6244: Merge "Fix an NPE and fd leak in SELinux policy updater." into jb-mr2-dev
* commit 'bb1a6244d169bbbf06068b5dce47c51c98097c89':
  Fix an NPE and fd leak in SELinux policy updater.
2013-05-01 11:14:06 -07:00
repo sync
bb1a6244d1 Merge "Fix an NPE and fd leak in SELinux policy updater." into jb-mr2-dev 2013-05-01 18:12:04 +00:00
Jeff Sharkey
57666934b4 Lockdown VPN handles its own connection teardown.
Recent changes started watching for CONNECTIVITY_ACTION broadcasts
to handle the case where a network is disconnected without the
interface going down.

However, when lockdown VPN is enabled, the broadcast contents are
augmented, and all connections appear disconnected until the VPN
comes online.  This caused a reset feedback loop to occur.

Since LockdownVpnTracker already handles networks being disconnected
separately from interfaces going down, this change disables handling
the broadcast when lockdown is enabled.

Bug: 8755148
Change-Id: I70a348aa97a4b22eaaf23aa5ed344de3e9a9ab0b
2013-05-01 09:40:50 -07:00
Christopher Tate
9f9dc4b230 am 6e629e84: am 95a9bfe2: When installing/enabling a system app, bootstrap it
* commit '6e629e84c52c870ff6fe6d0493861997929209f4':
  When installing/enabling a system app, bootstrap it
2013-04-30 17:50:50 -07:00
Christopher Tate
6e629e84c5 am 95a9bfe2: When installing/enabling a system app, bootstrap it
* commit '95a9bfe2ba75d79fff8157ed57e75c4ffb5a08ac':
  When installing/enabling a system app, bootstrap it
2013-04-30 17:48:59 -07:00
Christopher Tate
95a9bfe2ba When installing/enabling a system app, bootstrap it
Specifically, send it a BOOT_COMPLETED broadcast just as it would have
received during device (or user) startup.

Bug 8594153

Change-Id: I847c16df56d038a25758e594f951bc15348edc19
2013-04-30 17:40:32 -07:00
repo sync
f7b8bc48af Fix an NPE and fd leak in SELinux policy updater.
Bug: 8769213
Change-Id: Iff80be6109a1586d818754c8f9f5053b816fbd57
2013-04-30 17:37:00 -07:00
Svetoslav
9af61ff66a am 5473ffba: am f6a2598f: Merge "Removing a debug check when logging fstrim events." into jb-mr2-dev
* commit '5473ffba405af12f2c5d3a7363ed959a9648eaf4':
  Removing a debug check when logging fstrim events.
2013-04-30 16:45:49 -07:00
Svetoslav
0a2ac8c622 am 86fe273f: am cff4b18e: Merge "Perform idle maintenance when the device is charging." into jb-mr2-dev
* commit '86fe273f26ff8957a096911a20f4a48df5de470a':
  Perform idle maintenance when the device is charging.
2013-04-30 16:45:47 -07:00
Svetoslav
5473ffba40 am f6a2598f: Merge "Removing a debug check when logging fstrim events." into jb-mr2-dev
* commit 'f6a2598fc4a1595e9fb77bd542047a4c8006d337':
  Removing a debug check when logging fstrim events.
2013-04-30 16:42:58 -07:00
Svetoslav
86fe273f26 am cff4b18e: Merge "Perform idle maintenance when the device is charging." into jb-mr2-dev
* commit 'cff4b18eeb35c832d0d48ca539ec722d9159ec70':
  Perform idle maintenance when the device is charging.
2013-04-30 16:42:54 -07:00
Jeff Sharkey
09aa0cf6f6 Merge "Better --unplugged support when dumping battery." 2013-04-30 22:14:12 +00:00
Jeff Sharkey
ec43a6bc17 Better --unplugged support when dumping battery.
Also fixes logBatteryStatsLocked() to output valid dump data, instead
of just a usage message.

Bug: 8708665
Change-Id: Ie0d8d90e1a470b7e1e902643333309c2cf7bdb72
2013-04-30 13:33:18 -07:00
Svetoslav
f6a2598fc4 Merge "Removing a debug check when logging fstrim events." into jb-mr2-dev 2013-04-30 18:05:48 +00:00
Svetoslav
9e814a8c02 Removing a debug check when logging fstrim events.
This change is removing the check for debuggable build to
log fstrim events. While this was done everywhere else, one
place was overlooked.

bug:8688454

Change-Id: I354e1deebfd801f971dd91b9e7972c6ebfd093f3
2013-04-30 10:43:59 -07:00
Svetoslav
cff4b18eeb Merge "Perform idle maintenance when the device is charging." into jb-mr2-dev 2013-04-30 17:41:21 +00:00
Svetoslav
f23b64df94 Perform idle maintenance when the device is charging.
Added the precondition that the device should be charging to the
existing ones of the device not being used for awhile and the
battery level being high enough. Note that even if the device is
charging, we have to check the battery level since the user can
unplug it at any time.

bug:8688454

Change-Id: I709b1620571301743dc3504a6a625e2018951bfa
2013-04-30 10:19:53 -07:00
Irfan Sheriff
3ddee7d6e9 am fd0b0072: am 9f844790: Merge "Remove scan notification dialog on wifi off" into jb-mr2-dev
* commit 'fd0b0072db6d89c85a5ea20383a1c3dc289d1d38':
  Remove scan notification dialog on wifi off
2013-04-30 08:54:22 -07:00
Kenny Root
f80d45bfc4 resolved conflicts for merge of 3424b817 to master
Change-Id: Idb5bb208aa6aca66744fe6988029d22e739cc67b
2013-04-30 08:45:12 -07:00
Craig Mautner
9db9a0bde5 Move task methods into TaskRecord.
Stop doing backflips to do task operations in ActivityStack.

Change-Id: I57b1be6affcb8b7d504ae33b3e44bde2e6253f1c
2013-04-29 17:05:56 -07:00
Craig Mautner
0e415c6662 A better fix for bug 8740202.
Continue to layout windows that are animating away. Otherwise they
don't track with their parent windows that may be moving at the
same time.

Change-Id: Ic5b762ee538219fd6193e27dde6c245cbaa098df
2013-04-29 16:18:29 -07:00
Irfan Sheriff
fd0b0072db am 9f844790: Merge "Remove scan notification dialog on wifi off" into jb-mr2-dev
* commit '9f844790f305338de4fa3adda5e125c811f280ca':
  Remove scan notification dialog on wifi off
2013-04-29 16:01:55 -07:00
Irfan Sheriff
9f844790f3 Merge "Remove scan notification dialog on wifi off" into jb-mr2-dev 2013-04-29 22:58:50 +00:00