From b87b507248eca7659370c99d2469aeab421ecb5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Kongstad?= Date: Fri, 21 Sep 2018 09:58:10 +0200 Subject: [PATCH] Switch to idmap2 Switch from idmap to idmap2. This CL is the safety pin for idmap2. If idmap2 causes issues during dogfooding it is easy go back to idmap by reverting this CL. Once idmap2 has proven itself during a suitable period of time, the FEATURE_FLAG_IDMAP2 flag and the obsolete idmap code will be removed. Also add an .rc file to tell init to launch idmap2d. Bug: 78815803 Test: atest OverlayDeviceTests OverlayHostTests Change-Id: I5ca1388ac2f8a9379fed0c257247d351a5c7a3c4 --- cmds/idmap2/Android.bp | 1 + cmds/idmap2/idmap2d/idmap2d.rc | 4 ++++ core/java/android/content/res/AssetManager.java | 2 +- services/core/java/com/android/server/om/IdmapManager.java | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 cmds/idmap2/idmap2d/idmap2d.rc diff --git a/cmds/idmap2/Android.bp b/cmds/idmap2/Android.bp index 7d675cebfb33a..d7922bc08cead 100644 --- a/cmds/idmap2/Android.bp +++ b/cmds/idmap2/Android.bp @@ -181,6 +181,7 @@ cc_binary { "libutils", "libziparchive", ], + init_rc: ["idmap2d/idmap2d.rc"], } filegroup { diff --git a/cmds/idmap2/idmap2d/idmap2d.rc b/cmds/idmap2/idmap2d/idmap2d.rc new file mode 100644 index 0000000000000..203e7bee4af6e --- /dev/null +++ b/cmds/idmap2/idmap2d/idmap2d.rc @@ -0,0 +1,4 @@ +service idmap2d /system/bin/idmap2d + class main + user system + group system diff --git a/core/java/android/content/res/AssetManager.java b/core/java/android/content/res/AssetManager.java index 4371c772c047c..740cdae0dd5b4 100644 --- a/core/java/android/content/res/AssetManager.java +++ b/core/java/android/content/res/AssetManager.java @@ -58,7 +58,7 @@ import java.util.HashMap; public final class AssetManager implements AutoCloseable { private static final String TAG = "AssetManager"; private static final boolean DEBUG_REFS = false; - private static final boolean FEATURE_FLAG_IDMAP2 = false; + private static final boolean FEATURE_FLAG_IDMAP2 = true; private static final String FRAMEWORK_APK_PATH = "/system/framework/framework-res.apk"; diff --git a/services/core/java/com/android/server/om/IdmapManager.java b/services/core/java/com/android/server/om/IdmapManager.java index 731e6bcfb0740..6d5982708f4cb 100644 --- a/services/core/java/com/android/server/om/IdmapManager.java +++ b/services/core/java/com/android/server/om/IdmapManager.java @@ -46,7 +46,7 @@ import java.io.File; * Note: this class is subclassed in the OMS unit tests, and hence not marked as final. */ class IdmapManager { - private static final boolean FEATURE_FLAG_IDMAP2 = false; + private static final boolean FEATURE_FLAG_IDMAP2 = true; private final Installer mInstaller; private IIdmap2 mIdmap2Service;