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
diff --git a/cmds/idmap2/Android.bp b/cmds/idmap2/Android.bp
index 7d675ce..d7922bc 100644
--- a/cmds/idmap2/Android.bp
+++ b/cmds/idmap2/Android.bp
@@ -181,6 +181,7 @@
"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 0000000..203e7be
--- /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 4371c77..740cdae 100644
--- a/core/java/android/content/res/AssetManager.java
+++ b/core/java/android/content/res/AssetManager.java
@@ -58,7 +58,7 @@
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 731e6bc..6d59827 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 @@
* 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;