OSDN Git Service

OMS: integrate OverlayManagerService into framework
authorMårten Kongstad <marten.kongstad@sonymobile.com>
Thu, 2 Jun 2016 07:35:31 +0000 (09:35 +0200)
committerAdam Lesinski <adamlesinski@google.com>
Tue, 21 Feb 2017 22:29:43 +0000 (14:29 -0800)
commit21a3d1ad686dee97b9cf0ed80389ee2ab0d48013
tree79a415bcc73f60cda6dbac4ca414b22741c47266
parentf9bd2944694539f1dce74d420156cc50bbb4af14
OMS: integrate OverlayManagerService into framework

Hand over ownership of overlays to OverlayManagerService.

Changes to a package's overlays are propagated using the activity life
cycle. Affected activities will be recreated as needed. This provides a
well-defined point to modify an application's assets while the
application is paused.

Consolidate how overlays targeting the system and overlays targeting
regular applications are handled. Previously, system overlays were
handled as a special case. Now, everything is handled identically. As a
side effect, the call to idmap --scan during Zygote boot has become
obsolete and is removed.

Information on what overlays to use is recorded in
ApplicationInfo.resourceDirs. The PackageManagerService is responsible
for the creation of ApplicationInfo objects. The OverlayManagerService
is responsible for informing the PackageManagerService in advance about
what resourceDirs to use.

When launching an application, the ApplicationInfo is already populated
with up-to-date information about overlays.

When enabling or disabling an overlay for a running application, the
OverlayManagerService first notifies the PackageManagerService about the
updated resourceDirs. It then tells the ActivityManagerService to push
the new ApplicationInfo object to the application's ActivityThread.
Finally the application requests its ResourcesManager to create new
ResourcesImpl objects based on the updated paths.

Co-authored-by: Martin Wallgren <martin.wallgren@sonymobile.com>
Signed-off-by: Zoran Jovanovic <zoran.jovanovic@sonymobile.com>
Bug: 31052947
Test: run tests from 'OMS: tests for OverlayManagerService'
Change-Id: Idc96dae6fc075d5373aa055bbf50e919136d7353
15 files changed:
cmds/idmap/Android.mk
cmds/idmap/idmap.cpp
cmds/idmap/idmap.h
cmds/idmap/scan.cpp [deleted file]
core/java/android/content/pm/PackageParser.java
core/java/android/content/pm/PackageUserState.java
core/jni/android_util_AssetManager.cpp
libs/androidfw/AssetManager.cpp
libs/androidfw/include/androidfw/AssetManager.h
packages/Shell/AndroidManifest.xml
services/core/java/com/android/server/SystemServiceManager.java
services/core/java/com/android/server/om/OverlayManagerService.java
services/core/java/com/android/server/pm/PackageManagerService.java
services/java/com/android/server/SystemServer.java
services/tests/servicestests/src/com/android/server/pm/PackageParserTest.java