Import android-games-sdk changes for 4.0.0

This imports the SDK from commit 8fa58b0e145ec28e726fa2b1c7e7a52af925ca35, from:
https://github.com/rust-mobile/android-games-sdk/commits/android-activity-4.0.0

This includes one "notify android_main of editor actions" patch which will make
it possible to forward editor actions and support IME Commit events in Winit)

# notify android_main of editor actions

This adds a pendingEditorActions member to android_app that is set via
onEditorAction and the android_main thread is notified via notifyInput
instead of re-instating APP_CMD_EDITOR_ACTION.

The idea is that the android_main thread should check for
android_app->pendingEditorActions whenever input events are polled/iterated.

# FFI bindings update

Also updates the FFI bindings via generate-bindings.sh
This commit is contained in:
Robert Bragg
2025-03-31 20:38:10 +01:00
parent 0b0e19ed44
commit a20a7e4ee4
6 changed files with 128 additions and 90 deletions
@@ -226,6 +226,10 @@ struct android_app {
* thread, so we can't say that this is only valid within the `APP_CMD_` handler.
*/
int editorAction;
/**
* true when editorAction has been set
*/
bool pendingEditorAction;
/**
* Current state of the app's activity. May be either APP_CMD_START,
@@ -726,9 +726,15 @@ static bool onEditorAction(GameActivity* activity, int action) {
// XXX: this is a racy design that could lose InputConnection actions if the
// application doesn't manage to look at app->editorAction before another
// action is delivered.
if (android_app->pendingEditorAction) {
LOGW("Dropping editor action %d because previous action %d not yet "
"handled",
action, android_app->editorAction);
}
android_app->editorAction = action;
// TODO: buffer these actions like other input events
//notifyInput(android_app);
android_app->pendingEditorAction = true;
notifyInput(android_app);
// TODO: buffer IME text events and editor actions like other input events
//android_app_write_cmd(android_app, APP_CMD_EDITOR_ACTION);
pthread_mutex_unlock(&android_app->mutex);
@@ -6259,6 +6259,8 @@ pub struct android_app {
pub softwareKeyboardVisible: bool,
#[doc = " Last editor action. Valid within APP_CMD_SOFTWARE_KB_VIS_CHANGED handler.\n\n Note: the upstream comment above isn't accurate.\n - `APP_CMD_SOFTWARE_KB_VIS_CHANGED` is associated with `softwareKeyboardVisible`\n changes, not `editorAction`.\n - `APP_CMD_EDITOR_ACTION` is associated with this state but unlike for\n `window` state there's no synchonization that blocks the Java main\n thread, so we can't say that this is only valid within the `APP_CMD_` handler."]
pub editorAction: ::std::os::raw::c_int,
#[doc = " true when editorAction has been set"]
pub pendingEditorAction: bool,
#[doc = " Current state of the app's activity. May be either APP_CMD_START,\n APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP."]
pub activityState: ::std::os::raw::c_int,
#[doc = " This is non-zero when the application's GameActivity is being\n destroyed and waiting for the app thread to complete."]
@@ -6292,7 +6294,7 @@ fn bindgen_test_layout_android_app() {
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<android_app>(),
392usize,
400usize,
"Size of android_app"
);
assert_eq!(
@@ -6356,108 +6358,113 @@ fn bindgen_test_layout_android_app() {
"Offset of field: android_app::editorAction"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).activityState) as usize - ptr as usize },
unsafe { ::std::ptr::addr_of!((*ptr).pendingEditorAction) as usize - ptr as usize },
88usize,
"Offset of field: android_app::pendingEditorAction"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).activityState) as usize - ptr as usize },
92usize,
"Offset of field: android_app::activityState"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).destroyRequested) as usize - ptr as usize },
92usize,
96usize,
"Offset of field: android_app::destroyRequested"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).inputBuffers) as usize - ptr as usize },
96usize,
104usize,
"Offset of field: android_app::inputBuffers"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).currentInputBuffer) as usize - ptr as usize },
192usize,
200usize,
"Offset of field: android_app::currentInputBuffer"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).textInputState) as usize - ptr as usize },
196usize,
204usize,
"Offset of field: android_app::textInputState"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).mutex) as usize - ptr as usize },
200usize,
208usize,
"Offset of field: android_app::mutex"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).cond) as usize - ptr as usize },
240usize,
248usize,
"Offset of field: android_app::cond"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).msgread) as usize - ptr as usize },
288usize,
296usize,
"Offset of field: android_app::msgread"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).msgwrite) as usize - ptr as usize },
292usize,
300usize,
"Offset of field: android_app::msgwrite"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).thread) as usize - ptr as usize },
296usize,
304usize,
"Offset of field: android_app::thread"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).cmdPollSource) as usize - ptr as usize },
304usize,
312usize,
"Offset of field: android_app::cmdPollSource"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize },
328usize,
336usize,
"Offset of field: android_app::running"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).stateSaved) as usize - ptr as usize },
332usize,
340usize,
"Offset of field: android_app::stateSaved"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).destroyed) as usize - ptr as usize },
336usize,
344usize,
"Offset of field: android_app::destroyed"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).redrawNeeded) as usize - ptr as usize },
340usize,
348usize,
"Offset of field: android_app::redrawNeeded"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).pendingWindow) as usize - ptr as usize },
344usize,
352usize,
"Offset of field: android_app::pendingWindow"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).pendingContentRect) as usize - ptr as usize },
352usize,
360usize,
"Offset of field: android_app::pendingContentRect"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).keyEventFilter) as usize - ptr as usize },
368usize,
376usize,
"Offset of field: android_app::keyEventFilter"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).motionEventFilter) as usize - ptr as usize },
376usize,
384usize,
"Offset of field: android_app::motionEventFilter"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).inputAvailableWakeUp) as usize - ptr as usize },
384usize,
392usize,
"Offset of field: android_app::inputAvailableWakeUp"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).inputSwapPending) as usize - ptr as usize },
385usize,
393usize,
"Offset of field: android_app::inputSwapPending"
);
}
+29 -22
View File
@@ -6724,6 +6724,8 @@ pub struct android_app {
pub softwareKeyboardVisible: bool,
#[doc = " Last editor action. Valid within APP_CMD_SOFTWARE_KB_VIS_CHANGED handler.\n\n Note: the upstream comment above isn't accurate.\n - `APP_CMD_SOFTWARE_KB_VIS_CHANGED` is associated with `softwareKeyboardVisible`\n changes, not `editorAction`.\n - `APP_CMD_EDITOR_ACTION` is associated with this state but unlike for\n `window` state there's no synchonization that blocks the Java main\n thread, so we can't say that this is only valid within the `APP_CMD_` handler."]
pub editorAction: ::std::os::raw::c_int,
#[doc = " true when editorAction has been set"]
pub pendingEditorAction: bool,
#[doc = " Current state of the app's activity. May be either APP_CMD_START,\n APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP."]
pub activityState: ::std::os::raw::c_int,
#[doc = " This is non-zero when the application's GameActivity is being\n destroyed and waiting for the app thread to complete."]
@@ -6757,7 +6759,7 @@ fn bindgen_test_layout_android_app() {
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<android_app>(),
248usize,
256usize,
"Size of android_app"
);
assert_eq!(
@@ -6821,108 +6823,113 @@ fn bindgen_test_layout_android_app() {
"Offset of field: android_app::editorAction"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).activityState) as usize - ptr as usize },
unsafe { ::std::ptr::addr_of!((*ptr).pendingEditorAction) as usize - ptr as usize },
56usize,
"Offset of field: android_app::pendingEditorAction"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).activityState) as usize - ptr as usize },
60usize,
"Offset of field: android_app::activityState"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).destroyRequested) as usize - ptr as usize },
60usize,
64usize,
"Offset of field: android_app::destroyRequested"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).inputBuffers) as usize - ptr as usize },
64usize,
72usize,
"Offset of field: android_app::inputBuffers"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).currentInputBuffer) as usize - ptr as usize },
160usize,
168usize,
"Offset of field: android_app::currentInputBuffer"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).textInputState) as usize - ptr as usize },
164usize,
172usize,
"Offset of field: android_app::textInputState"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).mutex) as usize - ptr as usize },
168usize,
176usize,
"Offset of field: android_app::mutex"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).cond) as usize - ptr as usize },
172usize,
180usize,
"Offset of field: android_app::cond"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).msgread) as usize - ptr as usize },
176usize,
184usize,
"Offset of field: android_app::msgread"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).msgwrite) as usize - ptr as usize },
180usize,
188usize,
"Offset of field: android_app::msgwrite"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).thread) as usize - ptr as usize },
184usize,
192usize,
"Offset of field: android_app::thread"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).cmdPollSource) as usize - ptr as usize },
188usize,
196usize,
"Offset of field: android_app::cmdPollSource"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize },
200usize,
208usize,
"Offset of field: android_app::running"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).stateSaved) as usize - ptr as usize },
204usize,
212usize,
"Offset of field: android_app::stateSaved"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).destroyed) as usize - ptr as usize },
208usize,
216usize,
"Offset of field: android_app::destroyed"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).redrawNeeded) as usize - ptr as usize },
212usize,
220usize,
"Offset of field: android_app::redrawNeeded"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).pendingWindow) as usize - ptr as usize },
216usize,
224usize,
"Offset of field: android_app::pendingWindow"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).pendingContentRect) as usize - ptr as usize },
220usize,
228usize,
"Offset of field: android_app::pendingContentRect"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).keyEventFilter) as usize - ptr as usize },
236usize,
244usize,
"Offset of field: android_app::keyEventFilter"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).motionEventFilter) as usize - ptr as usize },
240usize,
248usize,
"Offset of field: android_app::motionEventFilter"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).inputAvailableWakeUp) as usize - ptr as usize },
244usize,
252usize,
"Offset of field: android_app::inputAvailableWakeUp"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).inputSwapPending) as usize - ptr as usize },
245usize,
253usize,
"Offset of field: android_app::inputSwapPending"
);
}
+29 -22
View File
@@ -7442,6 +7442,8 @@ pub struct android_app {
pub softwareKeyboardVisible: bool,
#[doc = " Last editor action. Valid within APP_CMD_SOFTWARE_KB_VIS_CHANGED handler.\n\n Note: the upstream comment above isn't accurate.\n - `APP_CMD_SOFTWARE_KB_VIS_CHANGED` is associated with `softwareKeyboardVisible`\n changes, not `editorAction`.\n - `APP_CMD_EDITOR_ACTION` is associated with this state but unlike for\n `window` state there's no synchonization that blocks the Java main\n thread, so we can't say that this is only valid within the `APP_CMD_` handler."]
pub editorAction: ::std::os::raw::c_int,
#[doc = " true when editorAction has been set"]
pub pendingEditorAction: bool,
#[doc = " Current state of the app's activity. May be either APP_CMD_START,\n APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP."]
pub activityState: ::std::os::raw::c_int,
#[doc = " This is non-zero when the application's GameActivity is being\n destroyed and waiting for the app thread to complete."]
@@ -7475,7 +7477,7 @@ fn bindgen_test_layout_android_app() {
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<android_app>(),
232usize,
236usize,
"Size of android_app"
);
assert_eq!(
@@ -7539,108 +7541,113 @@ fn bindgen_test_layout_android_app() {
"Offset of field: android_app::editorAction"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).activityState) as usize - ptr as usize },
unsafe { ::std::ptr::addr_of!((*ptr).pendingEditorAction) as usize - ptr as usize },
56usize,
"Offset of field: android_app::pendingEditorAction"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).activityState) as usize - ptr as usize },
60usize,
"Offset of field: android_app::activityState"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).destroyRequested) as usize - ptr as usize },
60usize,
64usize,
"Offset of field: android_app::destroyRequested"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).inputBuffers) as usize - ptr as usize },
64usize,
68usize,
"Offset of field: android_app::inputBuffers"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).currentInputBuffer) as usize - ptr as usize },
144usize,
148usize,
"Offset of field: android_app::currentInputBuffer"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).textInputState) as usize - ptr as usize },
148usize,
152usize,
"Offset of field: android_app::textInputState"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).mutex) as usize - ptr as usize },
152usize,
156usize,
"Offset of field: android_app::mutex"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).cond) as usize - ptr as usize },
156usize,
160usize,
"Offset of field: android_app::cond"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).msgread) as usize - ptr as usize },
160usize,
164usize,
"Offset of field: android_app::msgread"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).msgwrite) as usize - ptr as usize },
164usize,
168usize,
"Offset of field: android_app::msgwrite"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).thread) as usize - ptr as usize },
168usize,
172usize,
"Offset of field: android_app::thread"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).cmdPollSource) as usize - ptr as usize },
172usize,
176usize,
"Offset of field: android_app::cmdPollSource"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize },
184usize,
188usize,
"Offset of field: android_app::running"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).stateSaved) as usize - ptr as usize },
188usize,
192usize,
"Offset of field: android_app::stateSaved"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).destroyed) as usize - ptr as usize },
192usize,
196usize,
"Offset of field: android_app::destroyed"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).redrawNeeded) as usize - ptr as usize },
196usize,
200usize,
"Offset of field: android_app::redrawNeeded"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).pendingWindow) as usize - ptr as usize },
200usize,
204usize,
"Offset of field: android_app::pendingWindow"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).pendingContentRect) as usize - ptr as usize },
204usize,
208usize,
"Offset of field: android_app::pendingContentRect"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).keyEventFilter) as usize - ptr as usize },
220usize,
224usize,
"Offset of field: android_app::keyEventFilter"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).motionEventFilter) as usize - ptr as usize },
224usize,
228usize,
"Offset of field: android_app::motionEventFilter"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).inputAvailableWakeUp) as usize - ptr as usize },
228usize,
232usize,
"Offset of field: android_app::inputAvailableWakeUp"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).inputSwapPending) as usize - ptr as usize },
229usize,
233usize,
"Offset of field: android_app::inputSwapPending"
);
}
@@ -7466,6 +7466,8 @@ pub struct android_app {
pub softwareKeyboardVisible: bool,
#[doc = " Last editor action. Valid within APP_CMD_SOFTWARE_KB_VIS_CHANGED handler.\n\n Note: the upstream comment above isn't accurate.\n - `APP_CMD_SOFTWARE_KB_VIS_CHANGED` is associated with `softwareKeyboardVisible`\n changes, not `editorAction`.\n - `APP_CMD_EDITOR_ACTION` is associated with this state but unlike for\n `window` state there's no synchonization that blocks the Java main\n thread, so we can't say that this is only valid within the `APP_CMD_` handler."]
pub editorAction: ::std::os::raw::c_int,
#[doc = " true when editorAction has been set"]
pub pendingEditorAction: bool,
#[doc = " Current state of the app's activity. May be either APP_CMD_START,\n APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP."]
pub activityState: ::std::os::raw::c_int,
#[doc = " This is non-zero when the application's GameActivity is being\n destroyed and waiting for the app thread to complete."]
@@ -7499,7 +7501,7 @@ fn bindgen_test_layout_android_app() {
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<android_app>(),
392usize,
400usize,
"Size of android_app"
);
assert_eq!(
@@ -7563,108 +7565,113 @@ fn bindgen_test_layout_android_app() {
"Offset of field: android_app::editorAction"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).activityState) as usize - ptr as usize },
unsafe { ::std::ptr::addr_of!((*ptr).pendingEditorAction) as usize - ptr as usize },
88usize,
"Offset of field: android_app::pendingEditorAction"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).activityState) as usize - ptr as usize },
92usize,
"Offset of field: android_app::activityState"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).destroyRequested) as usize - ptr as usize },
92usize,
96usize,
"Offset of field: android_app::destroyRequested"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).inputBuffers) as usize - ptr as usize },
96usize,
104usize,
"Offset of field: android_app::inputBuffers"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).currentInputBuffer) as usize - ptr as usize },
192usize,
200usize,
"Offset of field: android_app::currentInputBuffer"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).textInputState) as usize - ptr as usize },
196usize,
204usize,
"Offset of field: android_app::textInputState"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).mutex) as usize - ptr as usize },
200usize,
208usize,
"Offset of field: android_app::mutex"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).cond) as usize - ptr as usize },
240usize,
248usize,
"Offset of field: android_app::cond"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).msgread) as usize - ptr as usize },
288usize,
296usize,
"Offset of field: android_app::msgread"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).msgwrite) as usize - ptr as usize },
292usize,
300usize,
"Offset of field: android_app::msgwrite"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).thread) as usize - ptr as usize },
296usize,
304usize,
"Offset of field: android_app::thread"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).cmdPollSource) as usize - ptr as usize },
304usize,
312usize,
"Offset of field: android_app::cmdPollSource"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize },
328usize,
336usize,
"Offset of field: android_app::running"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).stateSaved) as usize - ptr as usize },
332usize,
340usize,
"Offset of field: android_app::stateSaved"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).destroyed) as usize - ptr as usize },
336usize,
344usize,
"Offset of field: android_app::destroyed"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).redrawNeeded) as usize - ptr as usize },
340usize,
348usize,
"Offset of field: android_app::redrawNeeded"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).pendingWindow) as usize - ptr as usize },
344usize,
352usize,
"Offset of field: android_app::pendingWindow"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).pendingContentRect) as usize - ptr as usize },
352usize,
360usize,
"Offset of field: android_app::pendingContentRect"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).keyEventFilter) as usize - ptr as usize },
368usize,
376usize,
"Offset of field: android_app::keyEventFilter"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).motionEventFilter) as usize - ptr as usize },
376usize,
384usize,
"Offset of field: android_app::motionEventFilter"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).inputAvailableWakeUp) as usize - ptr as usize },
384usize,
392usize,
"Offset of field: android_app::inputAvailableWakeUp"
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).inputSwapPending) as usize - ptr as usize },
385usize,
393usize,
"Offset of field: android_app::inputSwapPending"
);
}