@@ -367,12 +367,18 @@ impl Process {
367367 }
368368
369369 fn set_as_manager ( & self , info : Option < FlatBinderObject > , thread : & Thread ) -> Result {
370- let ( ptr, cookie) = if let Some ( obj) = info {
371- ( unsafe { obj. __bindgen_anon_1 . binder } , obj. cookie )
370+ let ( ptr, cookie, flags) = if let Some ( obj) = info {
371+ (
372+ // SAFETY: The object type for this ioctl is implicitly `BINDER_TYPE_BINDER`, so it
373+ // is safe to access the `binder` field.
374+ unsafe { obj. __bindgen_anon_1 . binder } ,
375+ obj. cookie ,
376+ obj. flags ,
377+ )
372378 } else {
373- ( 0 , 0 )
379+ ( 0 , 0 , 0 )
374380 } ;
375- let node_ref = self . get_node ( ptr as _ , cookie as _ , true , Some ( thread) ) ?;
381+ let node_ref = self . get_node ( ptr as _ , cookie as _ , flags as _ , true , Some ( thread) ) ?;
376382 let node = node_ref. node . clone ( ) ;
377383 self . ctx . set_manager_node ( node_ref) ?;
378384 self . inner . lock ( ) . is_manager = true ;
@@ -387,6 +393,7 @@ impl Process {
387393 & self ,
388394 ptr : usize ,
389395 cookie : usize ,
396+ flags : u32 ,
390397 strong : bool ,
391398 thread : Option < & Thread > ,
392399 ) -> Result < NodeRef > {
@@ -399,7 +406,7 @@ impl Process {
399406 }
400407
401408 // Allocate the node before reacquiring the lock.
402- let node = Arc :: try_new ( Node :: new ( ptr, cookie, Ref :: new_from ( self ) ) ) ?;
409+ let node = Arc :: try_new ( Node :: new ( ptr, cookie, flags , Ref :: new_from ( self ) ) ) ?;
403410
404411 let mut inner = self . inner . lock ( ) ;
405412 if let Some ( node) = inner. get_existing_node_ref ( ptr, cookie, strong, thread) ? {
0 commit comments