Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23625f3b authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Document functions that may panic." am: 05933f79 am: 3c064e40

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1834433

Change-Id: I99d7dea61ed09963dce09174681a4e5f223ad7a8
parents 7091cba2 3c064e40
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -441,6 +441,8 @@ unsafe impl<B: Remotable> AsNative<sys::AIBinder> for Binder<B> {
///
///
/// Registers the given binder object with the given identifier. If successful,
/// Registers the given binder object with the given identifier. If successful,
/// this service can then be retrieved using that identifier.
/// this service can then be retrieved using that identifier.
///
/// This function will panic if the identifier contains a 0 byte (NUL).
pub fn add_service(identifier: &str, mut binder: SpIBinder) -> Result<()> {
pub fn add_service(identifier: &str, mut binder: SpIBinder) -> Result<()> {
    let instance = CString::new(identifier).unwrap();
    let instance = CString::new(identifier).unwrap();
    let status = unsafe {
    let status = unsafe {
@@ -462,6 +464,8 @@ pub fn add_service(identifier: &str, mut binder: SpIBinder) -> Result<()> {
///
///
/// If any service in the process is registered as lazy, all should be, otherwise
/// If any service in the process is registered as lazy, all should be, otherwise
/// the process may be shut down while a service is in use.
/// the process may be shut down while a service is in use.
///
/// This function will panic if the identifier contains a 0 byte (NUL).
pub fn register_lazy_service(identifier: &str, mut binder: SpIBinder) -> Result<()> {
pub fn register_lazy_service(identifier: &str, mut binder: SpIBinder) -> Result<()> {
    let instance = CString::new(identifier).unwrap();
    let instance = CString::new(identifier).unwrap();
    let status = unsafe {
    let status = unsafe {