libprefetch: fix property names in the .rc script
Current property names in .rc do not match what libprefetch actually
expects. In addition, the name of the property to stop the record starts
with `ro.` while it is expected to be modified. This commit fixes these
problems. Since prefetch was not working due to mismatching names, this
fix should not introduce a breaking change.
Bug: 380766679
Test: Test prefetch works on a Cuttlefish
Change-Id: I588b6f555fa9797a1a089aa983bcdc47bbb5e17e
Signed-off-by: Takaya Saeki <[email protected]>
diff --git a/init/libprefetch/prefetch/prefetch.rc b/init/libprefetch/prefetch/prefetch.rc
index fb3fb3b..dee37bb4 100644
--- a/init/libprefetch/prefetch/prefetch.rc
+++ b/init/libprefetch/prefetch/prefetch.rc
@@ -8,7 +8,7 @@
disabled
oneshot
-on property:ro.prefetch_boot.record=true
+on property:prefetch_boot.record=true
start prefetch_record
service prefetch_record /system/bin/prefetch record --duration ${ro.prefetch_boot.duration_s:-0}
@@ -18,7 +18,7 @@
disabled
oneshot
-on property:ro.prefetch_boot.replay=true
+on property:prefetch_boot.replay=true
start prefetch_replay
service prefetch_replay /system/bin/prefetch replay --io-depth ${ro.prefetch_boot.io_depth:-2} --max-fds ${ro.prefetch_boot.max_fds:-128}
diff --git a/init/libprefetch/prefetch/src/arch/android.rs b/init/libprefetch/prefetch/src/arch/android.rs
index 3404e42..a11767e 100644
--- a/init/libprefetch/prefetch/src/arch/android.rs
+++ b/init/libprefetch/prefetch/src/arch/android.rs
@@ -13,7 +13,7 @@
const PREFETCH_RECORD_PROPERTY: &str = "prefetch_boot.record";
const PREFETCH_REPLAY_PROPERTY: &str = "prefetch_boot.replay";
-const PREFETCH_RECORD_PROPERTY_STOP: &str = "ro.prefetch_boot.record_stop";
+const PREFETCH_RECORD_PROPERTY_STOP: &str = "prefetch_boot.record_stop";
fn wait_for_property_true(
property_name: &str,