Skip to content

Commit

Permalink
Replace android-properties with android_system_properties. (#2815)
Browse files Browse the repository at this point in the history
The former use statically linked Android libc symbols while the latter loads them dynamically. This is required to support old and new versions of Android with the same binary. It unblocks updating wgpu in Gecko.

Fixes #2805.
  • Loading branch information
nical authored Jun 27, 2022
1 parent 064f3f1 commit 892c272
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
17 changes: 10 additions & 7 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion wgpu-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ web-sys = { version = "0.3", features = ["Window", "HtmlCanvasElement", "WebGl2R
js-sys = { version = "0.3" }

[target.'cfg(target_os = "android")'.dependencies]
android-properties = "0.2"
android_system_properties = "0.1.1"

[dependencies.naga]
git = "https://github.com/gfx-rs/naga"
Expand Down
4 changes: 2 additions & 2 deletions wgpu-hal/src/vulkan/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,9 @@ impl crate::Instance<super::Api> for super::Instance {

#[cfg(target_os = "android")]
let android_sdk_version = {
let properties = android_system_properties::AndroidSystemProperties::new();
// See: https://developer.android.com/reference/android/os/Build.VERSION_CODES
let mut prop = android_properties::getprop("ro.build.version.sdk");
if let Some(val) = prop.value() {
if let Some(val) = properties.get("ro.build.version.sdk") {
match val.parse::<u32>() {
Ok(sdk_ver) => sdk_ver,
Err(err) => {
Expand Down

0 comments on commit 892c272

Please sign in to comment.