Files
games/deltas/0.1.0/2-beta.1.fix.4.md

131 lines
3.3 KiB
Markdown

<!-- file: deltas/0.1.0/2-beta.1.fix.4.md -->
<!-- version: 1 -->
# Delta 0.1.0-2-beta.1.fix.4
## Base
Base déclarée : `0.1.0-2-beta.1.fix.3`.
## Constat
`fix.3` a validé le logging Android via `tracing-android`, mais son callback Back `PRIORITY_DEFAULT` est trop intrusif pour une launcher Activity racine :
- il consomme la navigation système ;
- il désactive le chemin Back-to-home normal ;
- il ajoute un bridge JNI et une file atomique Rust inutiles pour ce cas.
Le smoke AVD a confirmé que `adb shell input keyevent 4` déclenche correctement la navigation Back système, alors que le contrôle graphique Back de l'AVD peut ne rien injecter.
## Correctif
Le logging Android de `fix.3` est conservé.
Le chemin suivant est supprimé :
```text
OnBackInvokedCallback PRIORITY_DEFAULT
-> JNI nativeRequestPlatformBack()
-> engine-v1-sdl::request_platform_back()
-> QuitSource::PlatformBack
```
Pour API 36+, Android utilise uniquement :
```text
OnBackInvokedDispatcher.PRIORITY_SYSTEM_NAVIGATION_OBSERVER
```
L'observer écrit :
```text
Android system Back observed
```
dans logcat, sans consommer l'action.
La navigation Back-to-home reste entièrement gérée par Android.
## Manifest
Les deux launcher applications déclarent explicitement :
```xml
android:enableOnBackInvokedCallback="true"
```
## JNI
Le contrat Java/JNI passe à `3`.
Il ne contient plus que le contrôle de version en plus de `SDL_main`.
## SDL
La prise en charge SDL native de :
```text
Keycode::AcBack
Scancode::AcBack
```
reste présente.
Elle continue à produire `QuitSource::PlatformBack` sur les plateformes qui exposent réellement Back comme événement SDL.
## Validation Rust/statique
```bash
cargo fmt --all
cargo fmt --all -- --check
python3 scripts/audit_rust_workspace_rules.py
python3 scripts/audit_markdown_tables.py README.md RULES.md ROADMAP.md CHANGELOG.md docs prompts crates Android deltas history
python3 scripts/audit_distribution_layout.py
cargo check --workspace
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test -p engine-v1-sdl --all-targets --all-features
cargo test -p game-logging-lib --all-targets --all-features
```
## AVD x86_64
```bash
python3 scripts/build_android_rust.py reflex --abi x86_64
python3 scripts/build_android_rust.py snake --abi x86_64
cd Android
gradle :game-reflex-poc:assembleDebug
gradle :game-snake-poc:assembleDebug
cd ..
adb -s emulator-5554 install -r Android/game-reflex-poc/build/outputs/apk/debug/game-reflex-poc-debug.apk
adb -s emulator-5554 install -r Android/game-snake-poc/build/outputs/apk/debug/game-snake-poc-debug.apk
```
Pour Reflex :
```bash
adb -s emulator-5554 logcat -c
adb -s emulator-5554 shell am start -n com.sasedev.games.reflex/.ReflexActivity
adb -s emulator-5554 shell input keyevent 4
adb -s emulator-5554 logcat | grep -iE 'games\.sasedev|CoreBackPreview|SDL|AndroidRuntime|FATAL|panic'
```
Attendu sur API 36 :
- `Android tracing initialized` ;
- `SDL3 runtime started` ;
- `Android system Back observed` ;
- retour système à l'écran précédent / accueil ;
- arrêt propre du runtime ou cycle de pause/stop conforme au comportement système ;
- aucun `FATAL`, `AndroidRuntime` ou panic.
Répéter pour Snake.
## ARM64 réel
Après validation AVD, refaire un smoke court des deux jeux sur le Galaxy S9+ pour vérifier l'absence de régression sur l'ancien chemin système Android.