Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
# See top README for MSRV policy
rust-version: [1.73.0, stable]
rust-version: [1.85.0, stable]
steps:
- uses: actions/checkout@v4

Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ resolver = "2"
members = ["android-activity"]

exclude = ["examples"]

[patch.crates-io]
jni = { git = "https://github.com/jni-rs/jni-rs.git", branch = "release-0.22" }
2 changes: 1 addition & 1 deletion android-activity/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
> - `Source::is_xxx_class()` functions are replaced by querying `Source::class()` and comparing against variants from the returned `SourceClass` `bitflags` enum.
> - `SourceFlags::TRACKBALL` (from `Source::is_trackball_class()`) is named `SourceClass::NAVIGATION` in the `ndk`.

- rust-version bumped to 1.73.0 ([#193](https://github.com/rust-mobile/android-activity/pull/193))
- rust-version bumped to 1.85.0 ([#193](https://github.com/rust-mobile/android-activity/pull/193), TODO: link)
- The `ndk` and `ndk-sys` crates are now re-exported under `android_activity::ndk` and `android_activity::ndk_sys` ([#194](https://github.com/rust-mobile/android-activity/pull/194))
- GameActivity updated to 4.0.0 (requires the corresponding 4.0.0 `.aar` release from Google) ([#191](https://github.com/rust-mobile/android-activity/pull/191))

Expand Down
9 changes: 3 additions & 6 deletions android-activity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ include = [
"/src",
]

# Even though we could technically still build with 1.69, 1.73 has a fix for the
# definition of the `stat` struct on Android, and so it seems worthwhile drawing
# a line under that to ensure android-activity applications have that fix.
rust-version = "1.73.0"
rust-version = "1.85.0"

[features]
# Note: we don't enable any backend by default since features
Expand All @@ -36,9 +33,9 @@ api-level-33 = ["api-level-30", "ndk/api-level-33"]

[dependencies]
log = "0.4"
jni-sys = "0.3"
cesu8 = "1"
jni = "0.21"
jni = "0.22"
jni-sys = "0.4.1"
ndk-sys = "0.6.0"
ndk = { version = "0.9.0", default-features = false }
ndk-context = "0.1.1"
Expand Down
2 changes: 1 addition & 1 deletion android-activity/generate-bindings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ while read ARCH && read TARGET ; do

# --module-raw-line 'use '
bindgen game-activity-ffi.h -o src/game_activity/ffi_$ARCH.rs \
--rust-target '1.73.0' \
--rust-target '1.85.0' \
--blocklist-item 'JNI\w+' \
--blocklist-item 'C?_?JNIEnv' \
--blocklist-item '_?JavaVM' \
Expand Down
5 changes: 5 additions & 0 deletions android-activity/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ pub(crate) enum InternalAppError {
JniError(jni::errors::JniError),
#[error("A Java Exception was thrown via a JNI method call")]
JniException(String),
// For internal errors that don't lead to a Java exception but are
// still JNI related.
#[error("A bad argument was passed to a JNI method: {0}")]
JniBadArgument(String),
#[error("A Java VM error")]
JvmError(jni::errors::Error),
#[error("Input unavailable")]
Expand All @@ -51,6 +55,7 @@ impl From<InternalAppError> for AppError {
match value {
InternalAppError::JniError(err) => AppError::JavaError(err.to_string()),
InternalAppError::JniException(msg) => AppError::JavaError(msg),
InternalAppError::JniBadArgument(msg) => AppError::JavaError(msg),
InternalAppError::JvmError(err) => AppError::JavaError(err.to_string()),
InternalAppError::InputUnavailable => AppError::InputUnavailable,
}
Expand Down
2 changes: 1 addition & 1 deletion android-activity/src/game_activity/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#![allow(deref_nullptr)]
#![allow(dead_code)]

use jni_sys::*;
use jni::sys::*;
use libc::{pthread_cond_t, pthread_mutex_t, pthread_t};
use ndk_sys::{AAssetManager, AConfiguration, ALooper, ALooper_callbackFunc, ANativeWindow, ARect};

Expand Down
Loading