Migrate to the librustutils cutils bindings.
Bug: 182498247
Test: Build
Change-Id: I0ab7fb092574c74b09c1b5b60e82ff776a214d53
diff --git a/keystore2/src/utils.rs b/keystore2/src/utils.rs
index d71a4fc..f6d92ee 100644
--- a/keystore2/src/utils.rs
+++ b/keystore2/src/utils.rs
@@ -188,16 +188,15 @@
}
/// AID offset for uid space partitioning.
-pub const AID_USER_OFFSET: u32 = cutils_bindgen::AID_USER_OFFSET;
+pub const AID_USER_OFFSET: u32 = rustutils::users::AID_USER_OFFSET;
/// AID of the keystore process itself, used for keys that
/// keystore generates for its own use.
-pub const AID_KEYSTORE: u32 = cutils_bindgen::AID_KEYSTORE;
+pub const AID_KEYSTORE: u32 = rustutils::users::AID_KEYSTORE;
/// Extracts the android user from the given uid.
pub fn uid_to_android_user(uid: u32) -> u32 {
- // Safety: No memory access
- unsafe { cutils_bindgen::multiuser_get_user_id(uid) }
+ rustutils::users::multiuser_get_user_id(uid)
}
/// This module provides helpers for simplified use of the watchdog module.