Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
1135250
build: Upgrade jni from 0.19 to 0.20
qdot Apr 26, 2026
8b69a33
build: Upgrade jni from 0.20 to 0.21
qdot Apr 26, 2026
511b414
fix: Update droidplug and test crate for jni 0.21 lifetime requirements
qdot Apr 27, 2026
a3e3ac3
build: Bump jni from 0.21 to 0.22
qdot Apr 27, 2026
9763098
refactor: Rename JNIEnv to Env and GlobalRef to Global<T> across droi…
qdot Apr 27, 2026
d73d17f
refactor: Wrap JNI strings with jni_str! and signatures with jni_sig!
qdot Apr 27, 2026
9ed09ce
refactor: Migrate to callback-based attach_current_thread
qdot Apr 27, 2026
f1487ca
refactor: Migrate extern C functions to EnvUnowned + with_env pattern
qdot Apr 27, 2026
b6e0139
fix: Update exception handling and NativeMethod for jni 0.22
qdot Apr 27, 2026
21f96d5
fix: Modernize deprecated jni 0.22 APIs and fix Android-only build er…
qdot Apr 27, 2026
866db2b
fix: Migrate Android test crate to jni 0.22 EnvUnowned + with_env pat…
qdot Apr 27, 2026
3480907
refactor: Replace JNI boilerplate with bind_java_type! macros and Jav…
qdot Apr 27, 2026
1067a0f
refactor: Replace adapter extern C callbacks with native_method! macro
qdot Apr 27, 2026
2b94663
refactor: Eliminate classcache module, use bind_java_type! class caching
qdot Apr 27, 2026
c3ac72b
fix: Fix Android cross-compilation issues with bind_java_type! macros
qdot Apr 27, 2026
d81b3b4
fix: Fix JNI signature mismatches caused by bind_java_type! JObject m…
qdot Apr 27, 2026
432801e
fix: Propagate JNI callback failures instead of silently discarding them
qdot May 23, 2026
4952dc2
chore: run rustfmt
qdot May 25, 2026
a84c448
fix: resolve clippy warnings breaking CI
qdot May 25, 2026
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
131 changes: 93 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ dbus = "0.9.10"
bluez-async = "0.8.2"

[target.'cfg(target_os = "android")'.dependencies]
jni = "0.19.0"
jni = "0.22"
once_cell = "1.21.3"

[target.'cfg(not(target_os = "android"))'.dependencies]
jni = { version = "0.19.0", optional = true }
jni = { version = "0.22", optional = true }
once_cell = { version = "1.21.3", optional = true }

[target.'cfg(target_vendor = "apple")'.dependencies]
Expand Down
13 changes: 5 additions & 8 deletions src/bluez/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,11 @@ async fn central_events(
},
BluetoothEvent::Adapter {
id,
event: adapter_event,
} if id == adapter_id => match adapter_event {
AdapterEvent::Powered { powered } => {
let state = get_central_state(powered);
Some(vec![CentralEvent::StateUpdate(state)])
}
_ => None,
},
event: AdapterEvent::Powered { powered },
} if id == adapter_id => {
let state = get_central_state(powered);
Some(vec![CentralEvent::StateUpdate(state)])
}
_ => None,
}
}
10 changes: 4 additions & 6 deletions src/bluez/peripheral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl api::Peripheral for Peripheral {
fn mtu(&self) -> u16 {
let services = self.services.lock().unwrap();
for (_, service) in services.iter() {
for (_, characteristic) in service.characteristics.iter() {
if let Some((_, characteristic)) = service.characteristics.iter().next() {
return characteristic.info.mtu.unwrap();
}
}
Expand Down Expand Up @@ -202,9 +202,7 @@ impl api::Peripheral for Peripheral {
// This "should" be unique, but of course it's not enforced
HashMap::<Uuid, CharacteristicInfo>::new(),
|mut map, characteristic| {
if !map.contains_key(&characteristic.uuid) {
map.insert(characteristic.uuid, characteristic);
}
map.entry(characteristic.uuid).or_insert(characteristic);
map
},
)
Expand Down Expand Up @@ -391,8 +389,8 @@ fn make_characteristic(
uuid: info.uuid,
properties: info.flags.into(),
descriptors: descriptors
.iter()
.map(|(_, descriptor)| make_descriptor(descriptor, info.uuid, service_uuid))
.values()
.map(|descriptor| make_descriptor(descriptor, info.uuid, service_uuid))
.collect(),
service_uuid,
}
Expand Down
Loading
Loading