Skip to content

Commit 36832fe

Browse files
committed
Add import-games-sdk.sh and import some APP_CMD_ changes for 4.0.0
This replaces `copy-files` + `file_list.txt` (subjective simplification) This imports the SDK from commit 1b544f896646b29e798c5be0a151a488906797f7, from: https://github.com/rust-mobile/android-games-sdk/commits/android-activity-4.0.0
1 parent 88714f0 commit 36832fe

File tree

15 files changed

+108
-80
lines changed

15 files changed

+108
-80
lines changed

android-activity/android-games-sdk/copy-files

Lines changed: 0 additions & 61 deletions
This file was deleted.

android-activity/android-games-sdk/file_list.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../include/common/

android-activity/android-games-sdk/game-activity/prefab-src/modules/game-activity/include/game-activity/native_app_glue/android_native_app_glue.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@ struct android_app {
217217

218218
/**
219219
* Last editor action. Valid within APP_CMD_SOFTWARE_KB_VIS_CHANGED handler.
220+
*
221+
* Note: the upstream comment above isn't accurate.
222+
* - `APP_CMD_SOFTWARE_KB_VIS_CHANGED` is associated with `softwareKeyboardVisible`
223+
* changes, not `editorAction`.
224+
* - `APP_CMD_EDITOR_ACTION` is associated with this state but unlike for
225+
* `window` state there's no synchonization that blocks the Java main
226+
* thread, so we can't say that this is only valid within the `APP_CMD_` handler.
220227
*/
221228
int editorAction;
222229

@@ -441,17 +448,17 @@ enum NativeAppGlueAppCmd : int8_t {
441448
/**
442449
* Command from main thread: an editor action has been triggered.
443450
*/
444-
APP_CMD_EDITOR_ACTION,
451+
//APP_CMD_EDITOR_ACTION,
445452

446453
/**
447454
* Command from main thread: a keyboard event has been received.
448455
*/
449-
APP_CMD_KEY_EVENT,
456+
//APP_CMD_KEY_EVENT,
450457

451458
/**
452459
* Command from main thread: a touch event has been received.
453460
*/
454-
APP_CMD_TOUCH_EVENT,
461+
//APP_CMD_TOUCH_EVENT,
455462

456463
};
457464

Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../../game-text-input/prefab-src/modules/game-text-input/include/game-text-input/gametextinput.h
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"export_libraries": [],
3+
"library_name": null,
4+
"android": {
5+
"export_libraries": ["-landroid", "-llog"],
6+
"library_name": null
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../../src/common/system_utils.cpp

android-activity/android-games-sdk/game-activity/prefab-src/modules/game-activity/src/game-activity/native_app_glue/android_native_app_glue.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ static bool onTouchEvent(GameActivity* activity,
579579
++inputBuffer->motionEventsCount;
580580
notifyInput(android_app);
581581

582-
android_app_write_cmd(android_app, APP_CMD_TOUCH_EVENT);
582+
//android_app_write_cmd(android_app, APP_CMD_TOUCH_EVENT);
583583
pthread_mutex_unlock(&android_app->mutex);
584584
return true;
585585
}
@@ -665,7 +665,7 @@ static bool onKey(GameActivity* activity, const GameActivityKeyEvent* event) {
665665
++inputBuffer->keyEventsCount;
666666
notifyInput(android_app);
667667

668-
android_app_write_cmd(android_app, APP_CMD_KEY_EVENT);
668+
//android_app_write_cmd(android_app, APP_CMD_KEY_EVENT);
669669
pthread_mutex_unlock(&android_app->mutex);
670670
return true;
671671
}
@@ -722,9 +722,15 @@ static bool onEditorAction(GameActivity* activity, int action) {
722722
struct android_app* android_app = ToApp(activity);
723723

724724
pthread_mutex_lock(&android_app->mutex);
725+
726+
// XXX: this is a racy design that could lose InputConnection actions if the
727+
// application doesn't manage to look at app->editorAction before another
728+
// action is delivered.
725729
android_app->editorAction = action;
730+
// TODO: buffer these actions like other input events
731+
//notifyInput(android_app);
726732

727-
android_app_write_cmd(android_app, APP_CMD_EDITOR_ACTION);
733+
//android_app_write_cmd(android_app, APP_CMD_EDITOR_ACTION);
728734
pthread_mutex_unlock(&android_app->mutex);
729735
return true;
730736
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../../game-text-input/prefab-src/modules/game-text-input/src/game-text-input/gametextinput.cpp
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../../game-text-input/prefab-src/modules/game-text-input/include/game-text-input/gametextinput.h

0 commit comments

Comments
 (0)