Revert^4 "Run module code only after KeyMints receive module info"

This reverts commit 5b395ce2cc2f02cccc46d026d451dee9066ce0f3.

Reason for revert: This change should no longer cause boot issues. Manual testing on a variety of builds and form factors was conducted in b/399702162. See the original change aosp/3433145's description for change details.

Change-Id: If1aee09e94976630da8714dfae1bd16b8056586d
diff --git a/rootdir/init.rc b/rootdir/init.rc
index f1670ae..0b45e73 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -995,8 +995,11 @@
     mkdir /data/misc/stats-service/ 0770 statsd system
     mkdir /data/misc/train-info/ 0770 statsd system
 
-    # Wait for apexd to finish activating APEXes before starting more processes.
+    # TODO(b/369375199): Remove once attest modules flagging is removed.
     wait_for_prop apexd.status activated
+    # Wait for KeyMints to receive APEX module info before starting code from updateable APEXes.
+    # This is to prevent APEX modules from interfering in module measurement.
+    wait_for_prop keystore.module_hash.sent true
     perform_apex_config
 
     exec_start system_aconfigd_mainline_init