Skip to content

Import android-games-sdk changes for 4.4.0#240

Merged
rib merged 1 commit intomainfrom
rib/pr/game-activity-4.4.0
Mar 21, 2026
Merged

Import android-games-sdk changes for 4.4.0#240
rib merged 1 commit intomainfrom
rib/pr/game-activity-4.4.0

Conversation

@rib
Copy link
Copy Markdown
Member

@rib rib commented Mar 20, 2026

This imports the Android Games SDK from:

This is based on the GameActivity 4.4.0 release from:

Our integration branch includes the following patches:

  • 78daa4ad Add mainLooper to android_app
  • 179eaa92 notify android_main of editor actions
  • 5102e14c Don't send (unused) APP_CMD_EDITOR_ACTION
  • 223936cf Don't send (unused) APP_CMD_KEY/TOUCH_EVENTs
  • a24b21a4 android-activity: don't read unicode via getUnicodeChar
  • 9e3926b1 android-activity: rename C symbols that need export
  • 32ac1c73 glue: support InputAvailable events
  • 69a1868c glue: fix deadlocks in java callbacks after app destroyed
  • b5a2df04 glue: remove unused variable

This re-runs generate-bindings.sh

Notes:

Reviewing the upstream changes, it doesn't look like much has changed since the 4.0.0 release (at least in the glue layer).

It was quite painful rebasing on the latest upstream release due to upstream running clang-format across their whole repo

In this case I ended up using git filter-branch to reformat our patches before rebasing:

git filter-branch -f --tree-filter '
find game-activity/prefab-src/modules/game-activity \
  \( -iname "*.c" -o -iname "*.h" -o -iname "*.cpp" \) \
    -print0 |
    xargs -0 clang-format -i --style="{BasedOnStyle: Google,
    AccessModifierOffset: -4, AlignOperands: false,
    AllowShortFunctionsOnASingleLine: Empty,
    AlwaysBreakBeforeMultilineStrings: false, ColumnLimit: 100,
    CommentPragmas: \"NOLINT:.*\", ConstructorInitializerIndentWidth: 6,
    ContinuationIndentWidth: 8, IndentWidth: 4,
    PenaltyBreakBeforeFirstCallParameter: 100000,
    SpacesBeforeTrailingComments: 1}"
    ' cdf4eee808130cc007a6203904d1d6c9acbf53a3^..HEAD

Previously, we were apparently based on Google's
android-games-sdk-game-text-input-release branch instead of their android-games-sdk-game-activity-release branch, which made it awkward to diff changes because both branches include the game-activity SDK but all of the same patches have different commit hashes between branches.

Our previous base commit for GameActivity 4.0.0 was: 7f54c13ee549e4511dcdc15a8ca73864e87be605
which corresponds to:
65ee0100ead8cf73c851f150bffad2779dfa8704
on the game-activity-release branch

Note: The upstream release notes are also confusing because where they list what commits are included in each release, then for the 4.0.0 release those commits only exist on the game-text release branch but for the 4.4.0 release the commits exist on the game-activity release branch.

These are the upstream patches to the game-activity glue since 4.0.0:

  • c28257b2 Push new version of GameActivity 4.4.0
    • no functional change
  • e32db80f Fixed formatting of gamesdk repo
    • no functional change
  • a7cdb8c6 Migrate from deprecate ALooper_pollAll to ALooper_pollOnce
    • only affects examples
  • 163d7fcb Improve android_app_set_activity_state ANR protection
    • this adds a timeout for how long android_app_set_activity_state will block waiting for the android_main thread to handle synchronous callbacks (such as onStart, onResume)
    • this is backwards compatible
  • d3fbe82a Improve version revision macro updating
    • no functional change
  • 2ae5d1f4 Release a new alpha version for AGDK components.
    • no functional change
  • 3e5fc4cd Add JNI_OnLoad function
    • an (optional) alternative means to call GameActivity_register which won't affect us since the JNI_OnLoad exported from C++ won't be exported when compiling with the Rust toolchain.
  • 044fd03c Release a new alpha version for AGDK components.
    • no functional change
  • 1198bb06 Fix GameActivity getLocale* functions.
    • this is a backwards compatible fix that doesn't interact without integration changes
  • 07eff729 Change GameActivity and GameTextInput to 4.1 alpha.
    • no functional change

Based on this audit, our integration should be backwards compatible with GameActivity 4.0.0

@rib
Copy link
Copy Markdown
Member Author

rib commented Mar 20, 2026

cc: @jb55

Note: this update is backwards compatible with GameActivity 4.0.0 but you may be interested in this

@rib
Copy link
Copy Markdown
Member Author

rib commented Mar 20, 2026

For reference, I've tested this with agdk-mainloop (an updated version that also tests the .run_on_java_main_thread integration) and agdk-egui and I've tested with the 4.0.0 and 4.4.0 androidx/jetpack releases of game-activity.

@jb55
Copy link
Copy Markdown
Contributor

jb55 commented Mar 20, 2026

cc: @jb55

Note: this update is backwards compatible with GameActivity 4.0.0 but you may be interested in this

thanks, will take a look

This imports the Android Games SDK from:

- repo: https://github.com/rust-mobile/android-games-sdk
- branch: android-activity-4.4.0
- commit: 78daa4adfc4a619daeab9f96181190b145f1e544

This is based on the GameActivity 4.4.0 release from:

- repo: https://android.googlesource.com/platform/frameworks/opt/gamesdk
- branch: android-games-sdk-game-activity-release
- commit: 541587a073871a9d2659f90335dcae345007eeed

Our integration branch includes the following patches:

- 78daa4ad Add mainLooper to android_app
- 179eaa92 notify android_main of editor actions
- 5102e14c Don't send (unused) APP_CMD_EDITOR_ACTION
- 223936cf Don't send (unused) APP_CMD_KEY/TOUCH_EVENTs
- a24b21a4 android-activity: don't read unicode via getUnicodeChar
- 9e3926b1 android-activity: rename C symbols that need export
- 32ac1c73 glue: support InputAvailable events
- 69a1868c glue: fix deadlocks in java callbacks after app destroyed
- b5a2df04 glue: remove unused variable

This re-runs `generate-bindings.sh`

Notes:

Reviewing the upstream changes, it doesn't look like much has changed
since the 4.0.0 release (at least in the glue layer).

It was quite painful rebasing on the latest upstream release due to
upstream running clang-format across their whole repo

In this case I ended up using `git filter-branch` to reformat our
patches before rebasing:

```
git filter-branch -f --tree-filter '
find game-activity/prefab-src/modules/game-activity \
  \( -iname "*.c" -o -iname "*.h" -o -iname "*.cpp" \) \
    -print0 |
    xargs -0 clang-format -i --style="{BasedOnStyle: Google,
    AccessModifierOffset: -4, AlignOperands: false,
    AllowShortFunctionsOnASingleLine: Empty,
    AlwaysBreakBeforeMultilineStrings: false, ColumnLimit: 100,
    CommentPragmas: \"NOLINT:.*\", ConstructorInitializerIndentWidth: 6,
    ContinuationIndentWidth: 8, IndentWidth: 4,
    PenaltyBreakBeforeFirstCallParameter: 100000,
    SpacesBeforeTrailingComments: 1}"
    ' cdf4eee808130cc007a6203904d1d6c9acbf53a3^..HEAD
```

Previously, we were apparently based on Google's
`android-games-sdk-game-text-input-release` branch instead of their
`android-games-sdk-game-activity-release` branch, which made it awkward
to diff changes because both branches include the game-activity SDK but
all of the same patches have different commit hashes between branches.

Our previous base commit for GameActivity 4.0.0 was:
7f54c13ee549e4511dcdc15a8ca73864e87be605
which corresponds to:
65ee0100ead8cf73c851f150bffad2779dfa8704
on the game-activity-release branch

Note: The upstream release notes are also confusing because where they
list what commits are included in each release, then for the 4.0.0
release those commits only exist on the `game-text` release branch but
for the 4.4.0 release the commits exist on the `game-activity` release
branch.

These are the upstream patches to the game-activity glue since 4.0.0:

- c28257b2 Push new version of GameActivity 4.4.0
    - no functional change
- e32db80f Fixed formatting of gamesdk repo
    - no functional change
- a7cdb8c6 Migrate from deprecate ALooper_pollAll to ALooper_pollOnce
    - only affects examples
- 163d7fcb Improve android_app_set_activity_state ANR protection
    - this adds a timeout for how long android_app_set_activity_state
      will block waiting for the android_main thread to handle
      synchronous callbacks (such as onStart, onResume)
    - this is backwards compatible
- d3fbe82a Improve version revision macro updating
    - no functional change
- 2ae5d1f4 Release a new alpha version for AGDK components.
    - no functional change
- 3e5fc4cd Add JNI_OnLoad function
    - an (optional) alternative means to call `GameActivity_register`
      which won't affect us since the `JNI_OnLoad` exported from C++ won't
      be exported when compiling with the Rust toolchain.
- 044fd03c Release a new alpha version for AGDK components.
    - no functional change
- 1198bb06 Fix GameActivity getLocale* functions.
    - this is a backwards compatible fix that doesn't interact without
      integration changes
- 07eff729 Change GameActivity and GameTextInput to 4.1 alpha.
    - no functional change

Based on this audit, our integration should be backwards compatible with
GameActivity 4.0.0
@rib rib force-pushed the rib/pr/game-activity-4.4.0 branch from 9e0e34c to fbdbc2e Compare March 20, 2026 21:24
@rib
Copy link
Copy Markdown
Member Author

rib commented Mar 21, 2026

I'm going to go ahead and merge this but please feel free to leave any retrospective feedback if you see any issues from testing or skimming the changes.

@rib rib merged commit 5c091cd into main Mar 21, 2026
7 checks passed
@rib rib deleted the rib/pr/game-activity-4.4.0 branch March 21, 2026 15:37
@rib rib mentioned this pull request Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants