ITADN

Update GameActivity from v2.0.2 to v4.0.0

#188Closedjb55 创建于 2025-03-12
J
jb55commented
As per some discussions here: - https://github.com/rust-mobile/android-activity/pull/185#issuecomment-2718178588 It seems like there are upstream GameTextInput fixes since v2.0.2, so we should try to update our local version. The plan is to re-apply our local patches on top of v4.0.0. It's a bit of a pain to keep these in sync, there have been discussions around creating a RustActivity so we don't have to keep resyncing with GameActivity, but I'll leave that for another issue. ``` git clone https://android.googlesource.com/platform/frameworks/opt/gamesdk v2.0.2: 8a7bb9cb2792cf3f57ea6d54a7f2283ed05c4c2d v4.0.0: 7f54c13ee549e4511dcdc15a8ca73864e87be605 ``` ## Patches to apply Last import on repo: ``` commit c471fdf903262c1cafa560065ce4af2531cf1aae (last-import) Author: Alexis <120563837+alexisart@users.noreply.github.com> Date: Sun Jun 25 22:28:45 2023 -0400 Import unmodified GameActivity 2.0.2 Source See: https://developer.android.com/jetpack/androidx/releases/games#games-activity_version_20_2 ``` ``` git log --oneline last-import.. -- android-activity/game-activity-csrc ``` ``` d6345abb2a08 GameActivity PATCH: rename C symbols that need export 202ab4c1e988 GameActivity PATCH: Rename android_main _rust_glue_entry 3e3fb84c0350 GameActivity PATCH: remove unused variable d2d18154d9cf GameActivity PATCH: Support InputAvailable events 2a2f27637f79 GameActivity PATCH: fix deadlocks in java callbacks after app destroyed 41f30c39ad09 Expose TextEvent and input method state 6b3307410e95 GameActivity PATCH: Don't read unicode via getUnicodeChar ``` ### Patch plan The plan is to save these as patches and then apply them on top: ``` git format-patch -o patches last-import.. -- android-activity/game-activity-csrc git am patches/*.patch ``` One challenge is that there have been some formatting commits upstream: ``` Reformat GameTextInput sources ``` So I may need to format our patches first? bleh. ## Changes in `v2.0.2..v4.0.0` ``` git log --format=%s --no-merges v2.0.2..v4.0.0 -- game-text-input/ game-activity/ | sort -u ``` ``` Add a native callback on SW keyboard visibility change add a note about supported input types for GameTextInput Add a support of multi-line and single-line modes in GameTextInput add backing types for all enumerations in GameActivity/GameTextInput Add bitfield definitions for GameActivity_setImeEditorInfo add comments on reserved range for android_app_write_cmd() add concise comments on GameActivity locales support add cpp files into prefabs for GameActivity/GameTextInput add dependencies to prefab metadata Added GameActivity_restartInput method. add error handling in GameTextInput Add navigation using left and right arrow keys to gametextinput. Add onEditorAction callback add physical volume buttons to the ignore list for GameTextInput add proper SDK version reporting to GameActivity bump GameActivity and GameTextInput to 4.0.0alpha01 bump versions of GameActivity and GameTextInput to 3.0 Clear focus when soft keyboard is hidden (either by user or by the client). convert all sources to Google's code style Correctly destroy GameActivityMotionEvent fix AGDK tests fix a race condition in GameTextInput fix code-style in GameActivity fix deletion with text selection fix Doxygen comments in GameActivityEvents_internal.h fixed multiline mode fixed state updates propagation Fix external directory code. Bug: 323404241 Test: Run agdktunnel fix for hardware and software keyboards being out of sync Fix GameActivity getLocale* functions. Fix GameActivityMotionEvent_getHistoricalAxisValue index calculation fix GameTextInput editing functions Fix GameTextInput_hideIme comment fix hiddenKeyboard variable updates Fix improper button forwarding in GameTextInput Fix incorrect JNI params in GA/GTI fix 'keyboard' variable updates fix null pointer crash in GameActivity fix selection when typing with hardware keyboard fix tests for GameTextInput fix text deletion in GameTextInput Fix various input issues GameInputText: code refactoring GameTextInput: Handle IME_ACTION_UNSPECIFIED editor action as 'Enter' GameTextInput: Prevent keyboard input after GameActivity_hideSoftInput implement tests for GameTextInput make android_app_write_cmd() publicly available make GameTextInput use default implementations from BaseInputConnection optimize touch events handling by GameActivity Pass up-to-date locale data to the native code populate list of ignored characters in InputConnection provide an ability to override the creation of the SurfaceView instance refactor GameActivity and GameTextInput interfaces Reformat GameTextInput sources Replace Log.wtf with Log.d Samsung keyboard fix send explicit signals on key and touch events to the Looper update default_motion_filter() update game-activity and game-text-input to 3.1.0alpha01 Update library versions for jetpad update targetSdkVersion to 35 in all projects Use int64_t instead of long for historicalEventTimes to avoid overrun on 32bit systems Use temporal listener variable in InputConnection to prevent race conditions ``` One update: `update default_motion_filter()` is the same fix I PR'd here: - #185
关闭于 2025-08-11 8 条评论