mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-17 11:11:10 +02:00
Android: hardware step-counter bridge for step-sync mods
love.system.syncHealthSteps() now exists on Android, matching the iOS Health bridge merged in #452 and using the same JNI route as the SAF picker (wrap_System.cpp -> System.cpp -> common/android.cpp -> GameActivity over JNI): - GameActivity.syncHealthSteps: one-shot read of the hardware TYPE_STEP_COUNTER sensor (cumulative since boot, counted by the OS whether or not any app runs). The reading is anchored in SharedPreferences so a walk is never credited twice; a reading below the anchor means the phone rebooted, which re-anchors without crediting. Deltas (50k clamp) merge into steps_pending.json in the save identity dir - the same contract as the iOS GRHealthBridge, so the Pokewalker mod works unchanged on both platforms. - ACTIVITY_RECOGNITION declared in the app manifest (Android 10+ runtime prompt on first sync; granted -> the sensor read runs immediately via onRequestPermissionsResult). The build script's permission trim leaves it alone. - Nothing in the base game calls the new seam; without a consumer mod the only cost is one dormant manifest permission. - build_android.sh: shadow-build from a space-free temp dir when the checkout path contains spaces - ndk-build is GNU make underneath and cannot cope with paths like "xCode Projects". - mobile/ANDROID.md: step-bridge dev notes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,11 @@
|
||||
the link screen shows as "(Operation not permitted)" (issue #287).
|
||||
scripts/build_android.sh must not strip this again. -->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<!-- Step bridge: love.system.syncHealthSteps reads the hardware step
|
||||
counter, which Android 10+ gates behind this runtime permission.
|
||||
Requested only on the first sync call (the Pokéwalker mod's SYNC
|
||||
STEPS option); scripts/build_android.sh must not strip it. -->
|
||||
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
|
||||
<!-- OpenGL ES 2.0 -->
|
||||
<uses-feature android:glEsVersion="0x00020000" />
|
||||
<!-- Touchscreen support -->
|
||||
|
||||
Reference in New Issue
Block a user