Add a property to reflect the app debuggability
Set a build-time config to declare app debuggability that is used as
input to DICE and by apps, such as compos, that make decisions based on
this state. This will make it easier to tweak the definition of
debuggability and keep it consistent across dependents.
Bug: 219740340
Test: atest ComposHostTestCases
Test: atest MicrodroidTests
Change-Id: I770ae615a958dd6939925c400336a2550a3d950d
diff --git a/compos/src/compilation.rs b/compos/src/compilation.rs
index 6049991..e14cd94 100644
--- a/compos/src/compilation.rs
+++ b/compos/src/compilation.rs
@@ -59,9 +59,10 @@
system_server_compiler_filter: &'a str,
) -> Result<Self> {
if compilation_mode != CompilationMode::NORMAL_COMPILE {
- let debuggable = is_property_set("ro.boot.microdroid.debuggable")
- || is_property_set("ro.boot.logd.enabled")
- || is_property_set("ro.boot.adb.enabled");
+ // Conservatively check debuggability.
+ let debuggable =
+ system_properties::read_bool("ro.boot.microdroid.app_debuggable", false)
+ .unwrap_or(false);
if !debuggable {
bail!("Requested compilation mode only available in debuggable VMs");
}
@@ -96,12 +97,6 @@
}
}
-// Return whether the named property is definitely enabled. Deliberately conservative; returns
-// false if the property does not exist or cannot be read or is malformed.
-fn is_property_set(name: &str) -> bool {
- system_properties::read_bool(name, false).unwrap_or(false)
-}
-
pub fn odrefresh<F>(
odrefresh_path: &Path,
context: OdrefreshContext,