Skip to content

Commit

Permalink
Unify README and lib's description
Browse files Browse the repository at this point in the history
  • Loading branch information
Kijewski authored and nical committed Aug 30, 2022
1 parent 675eef7 commit b83987f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# android_system_properties

A minimal rust wrapper over android system properties

A thin rust wrapper for Android system properties.

This crate is similar to the `android-properties` crate with the exception that
the necessary Android libc symbols are loaded dynamically instead of linked
Expand Down
33 changes: 32 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,37 @@
//! statically. In practice this means that the same binary will work with old and
//! new versions of Android, even though the API for reading system properties changed
//! around Android L.
//!
//! ## Example
//!
//! ```rust
//! use android_system_properties::AndroidSystemProperties;
//!
//! let properties = AndroidSystemProperties::new();
//!
//! if let Some(value) = properties.get("persist.sys.timezone") {
//! println!("{}", value);
//! }
//! ```
//!
//! ## Listing and setting properties
//!
//! For the sake of simplicity this crate currently only contains what's needed by wgpu.
//! The implementations for listing and setting properties can be added back if anyone needs
//! them (let me know by filing an issue).
//!
//! ## License
//!
//! Licensed under either of
//!
//! * Apache License, Version 2.0 ([LICENSE-APACHE] or <http://www.apache.org/licenses/LICENSE-2.0>)
//! * MIT license ([LICENSE-MIT] or <http://opensource.org/licenses/MIT>)
//!
//! at your option.
//!
//! [LICENSE-APACHE]: https://github.com/nical/android_system_properties/blob/804681c5c1c93d4fab29c1a2f47b7d808dc70fd3/LICENSE-APACHE
//! [LICENSE-MIT]: https://github.com/nical/android_system_properties/blob/804681c5c1c93d4fab29c1a2f47b7d808dc70fd3/LICENSE-MIT
use std::{
ffi::{CStr, CString},
os::raw::{c_char, c_int, c_void},
Expand Down Expand Up @@ -151,7 +182,7 @@ impl Drop for AndroidSystemProperties {
if !self.libc_so.is_null() {
unsafe {
libc::dlclose(self.libc_so);
}
}
}
}
}

0 comments on commit b83987f

Please sign in to comment.