Home
last modified time | relevance | path

Searched refs:new (Results 1 – 25 of 539) sorted by relevance

12345678910>>...22

/packages/modules/Bluetooth/system/gd/rust/linux/service/src/
Dmain.rs57 let matches = App::new("Bluetooth Adapter Daemon") in main()
108 let logging = Arc::new(Mutex::new(Box::new(BluetoothLogging::new( in main()
127 let sig_notifier = Arc::new(SigData { in main()
128 enabled: Mutex::new(false), in main()
129 enabled_notify: Condvar::new(), in main()
130 thread_attached: Mutex::new(false), in main()
131 thread_notify: Condvar::new(), in main()
134 let intf = Arc::new(Mutex::new(get_btinterface().unwrap())); in main()
136 Arc::new(Mutex::new(Box::new(BluetoothGatt::new(intf.clone(), tx.clone())))); in main()
138 Arc::new(Mutex::new(Box::new(BatteryProviderManager::new(tx.clone())))); in main()
[all …]
/packages/modules/Bluetooth/system/rust/src/gatt/server/
Dgatt_database.rs36 pub const PRIMARY_SERVICE_DECLARATION_UUID: Uuid = Uuid::new(0x2800);
38 pub const SECONDARY_SERVICE_DECLARATION_UUID: Uuid = Uuid::new(0x2801);
40 pub const CHARACTERISTIC_UUID: Uuid = Uuid::new(0x2803);
134 pub fn new() -> Self { in new() method
171 let mut attributes = BTreeMap::new(); in add_service_with_handles()
531 const SERVICE_TYPE: Uuid = Uuid::new(0x1234);
535 const CHARACTERISTIC_TYPE: Uuid = Uuid::new(0x5678);
538 const DESCRIPTOR_TYPE: Uuid = Uuid::new(0x9ABC);
544 let gatt_db = SharedBox::new(GattDatabase::new()); in test_read_empty_db()
554 let (gatt_datastore, _) = MockDatastore::new(); in test_single_service()
[all …]
/packages/modules/Virtualization/authfs/src/fsverity/
Deditor.rs80 pub fn new(file: F) -> Self { in new() method
81 Self { file, merkle_tree: Arc::new(RwLock::new(MerkleLeaves::new())) } in new()
92 merkle_tree.calculate_fsverity_digest().map_err(|e| io::Error::new(io::ErrorKind::Other, e)) in calculate_fsverity_digest()
117 return Err(io::Error::new(io::ErrorKind::InvalidData, "Inconsistent hash")); in read_backing_chunk_verified()
145 return Err(io::Error::new(io::ErrorKind::InvalidData, "Inconsistent hash")); in new_hash_for_incomplete_write()
149 let mut ctx = Sha256::new(); in new_hash_for_incomplete_write()
200 ChunkedSizeIter::new(buf.len(), offset, CHUNK_SIZE as usize) in write_at()
269 let mut ctx = Sha256::new(); in resize()
308 pub fn new() -> InMemoryEditor { in new() method
309 InMemoryEditor { data: RefCell::new(Vec::new()), fail_read: false } in new()
[all …]
/packages/modules/Bluetooth/system/gd/rust/linux/client/src/
Dmain.rs172 pub fn new( in new() method
181 let manager_dbus = BluetoothManagerDBus::new(dbus_connection.clone()); in new()
184 adapters: HashMap::new(), in new()
191 found_devices: HashMap::new(), in new()
192 bonded_devices: HashMap::new(), in new()
210 active_scanner_ids: HashSet::new(), in new()
211 adv_sets: HashMap::new(), in new()
215 gatt_client_context: GattClientContext::new(), in new()
216 gatt_server_context: GattServerContext::new(), in new()
220 battery_address_filter: HashSet::new(), in new()
[all …]
Dcallbacks.rs68 pub(crate) fn new( in new() method
108 Arc::new(Mutex::new(DisconnectWatcher::new())), in export_for_rpc()
110 cr.lock().unwrap().insert(self.get_object_id(), &[iface], Arc::new(Mutex::new(self))); in export_for_rpc()
124 pub(crate) fn new( in new() method
216 self.context.lock().unwrap().run_callback(Box::new(move |context| { in on_ssp_request()
344 Arc::new(Mutex::new(DisconnectWatcher::new())), in export_for_rpc()
346 cr.lock().unwrap().insert(self.get_object_id(), &[iface], Arc::new(Mutex::new(self))); in export_for_rpc()
359 pub(crate) fn new( in new() method
393 Arc::new(Mutex::new(DisconnectWatcher::new())), in export_for_rpc()
395 cr.lock().unwrap().insert(self.get_object_id(), &[iface], Arc::new(Mutex::new(self))); in export_for_rpc()
[all …]
/packages/modules/Bluetooth/system/gd/rust/linux/mgmt/src/
Dmain.rs22 let matches = App::new("Bluetooth Manager") in main()
43 env_logger::Builder::new().filter(None, level_filter).init(); in main()
54 let _ = log::set_boxed_logger(Box::new(BasicLogger::new(logger))) in main()
93 let cr = Arc::new(Mutex::new(Crossroads::new())); in main()
98 Box::new(|x| { in main()
110 let bluetooth_manager = Arc::new(Mutex::new(Box::new(BluetoothManager::new(proxy)))); in main()
113 let disconnect_watcher = Arc::new(Mutex::new(DisconnectWatcher::new())); in main()
123 Box::new(move |msg, conn| { in main()
146 let mixin = Box::new(iface_bluetooth_manager::BluetoothManagerMixin { in main()
153 let mut powerd_suspend_manager = PowerdSuspendManager::new(conn.clone(), cr); in main()
Dmigrate.rs189 fn new(key: &'static str, action: KeyAction) -> Self { in new() method
254 let mut bytes = Vec::new(); in hex_str_to_base64_str()
409 vec![DeviceKey::new("HidDescriptor", KeyAction::Apply(Converter::Base64ToHex))], in convert_from_bluez_device()
413 ("bcdhid", vec![DeviceKey::new("HidVersion", KeyAction::WrapOk)]), in convert_from_bluez_device()
414 ("bcountrycode", vec![DeviceKey::new("HidCountryCode", KeyAction::WrapOk)]), in convert_from_bluez_device()
423 ("Name", vec![DeviceKey::new("Name", KeyAction::WrapOk)]), in convert_from_bluez_device()
426 vec![DeviceKey::new("DevClass", KeyAction::Apply(Converter::HexToDec))], in convert_from_bluez_device()
430 vec![DeviceKey::new("Appearance", KeyAction::Apply(Converter::HexToDec))], in convert_from_bluez_device()
434 vec![DeviceKey::new("DevType", KeyAction::Apply(Converter::TypeB2F))], in convert_from_bluez_device()
438 vec![DeviceKey::new( in convert_from_bluez_device()
[all …]
Dstate_machine.rs128 fn new(state_machine: StateMachineInternal) -> StateMachineContext { in new() method
152 StateMachineContext::new(StateMachineInternal::new( in create_new_state_machine_context()
230 call(&mut *self.state.lock().unwrap().entry(hci).or_insert(AdapterState::new( in modify_state()
231 String::new(), in modify_state()
287 AsyncFd::new(pid_detector).expect("failed to add async fd for pid detector") in pid_inotify_async_fd()
292 let re = Regex::new(r"bluetooth([0-9]+).pid").unwrap(); in get_hci_index_from_pid_path()
356 let mut btsock = BtSocket::new(); in configure_hci()
404 let mut hci_afd = AsyncFd::new(btsock).expect("Failed to add async fd for BT socket."); in configure_hci()
486 config_util::get_devpath_for_hci(hci).unwrap_or(String::new()); in configure_hci()
533 pub fn new() -> Self { in new() method
[all …]
Dpowerd_suspend_manager.rs59 pub(crate) fn new( in new() method
87 let mut suspend_readiness_info = SuspendReadinessInfo::new(); in send_handle_suspend_readiness()
177 Arc::new(Mutex::new(DisconnectWatcher::new())), in export_for_rpc()
179 cr.lock().unwrap().insert(self.get_object_id(), &[iface], Arc::new(Mutex::new(self))); in export_for_rpc()
205 pub fn new(conn: Arc<SyncConnection>, dbus_crossroads: Arc<Mutex<Crossroads>>) -> Self { in new() method
208 context: Arc::new(Mutex::new(SuspendManagerContext { in new()
228 let powerd_watcher = ServiceWatcher::new(self.conn.clone(), String::from(POWERD_SERVICE)); in init()
233 Box::new(move || { in init()
239 Box::new(move || { in init()
250 ServiceWatcher::new(self.conn.clone(), String::from(ADAPTER_SERVICE)); in init()
[all …]
Dservice_watcher.rs26 fn new(service_name: String) -> Self { in new() method
48 pub fn new(conn: Arc<SyncConnection>, service_name: String) -> Self { in new() method
52 context: Arc::new(Mutex::new(ServiceWatcherContext::new(service_name))), in new()
59 dbus::nonblock::Proxy::new(DBUS_SERVICE, DBUS_PATH, DBUS_TIMEOUT, self.conn.clone()); in get_dbus_owner_of_service()
79 let service_proxy = dbus::nonblock::Proxy::new( in get_path_of_interface()
112 Box::new(move |msg, _conn| { in monitor_name_owner_changed()
158 Box::new(move || { in start_watch()
161 Box::new(move || { in start_watch()
187 Box::new(move || { in start_watch_interface()
190 Box::new(move || { in start_watch_interface()
[all …]
/packages/modules/Bluetooth/system/gd/rust/topshim/facade/src/
Dmain.rs42 let rt = Arc::new(Runtime::new().unwrap()); in main()
47 Command::new("bluetooth_topshim_facade") in clap_command()
50 Arg::new("grpc-port") in clap_command()
56 Arg::new("root-server-port") in clap_command()
62 Arg::new("signal-port") in clap_command()
67 .arg(Arg::new("rootcanal-port").long("rootcanal-port").value_parser(value_parser!(u16))) in clap_command()
68 .arg(Arg::new("btsnoop").long("btsnoop")) in clap_command()
69 .arg(Arg::new("btsnooz").long("btsnooz")) in clap_command()
70 .arg(Arg::new("btconfig").long("btconfig")) in clap_command()
72 Arg::new("start-stack-now") in clap_command()
[all …]
Dmedia_service.rs19 A2dpCallbacksDispatcher { dispatch: Box::new(move |_cb| {}) } in get_a2dp_dispatcher()
23 A2dpSinkCallbacksDispatcher { dispatch: Box::new(move |_cb| {}) } in get_a2dp_sink_dispatcher()
27 AvrcpCallbacksDispatcher { dispatch: Box::new(move |_cb| {}) } in get_avrcp_dispatcher()
43 let mut btif_a2dp = A2dp::new(&btif_intf.lock().unwrap()); in create()
44 let btif_a2dp_sink = A2dpSink::new(&btif_intf.lock().unwrap()); in create()
45 let mut btif_avrcp = Avrcp::new(&btif_intf.lock().unwrap()); in create()
51 btif_a2dp: Arc::new(Mutex::new(btif_a2dp)), in create()
52 btif_a2dp_sink: Arc::new(Mutex::new(btif_a2dp_sink)), in create()
53 btif_avrcp: Arc::new(Mutex::new(btif_avrcp)), in create()
/packages/modules/Bluetooth/system/rust/src/gatt/server/transactions/
Dfind_information_request.rs64 let mut out = PayloadAccumulator::new(mtu - 2); in handle_find_information_request_short()
89 let mut out = PayloadAccumulator::new(mtu - 2); in handle_find_information_request_long()
121 let db = TestAttDatabase::new(vec![ in test_long_uuids()
125 type_: Uuid::new(0x01020304), in test_long_uuids()
133 type_: Uuid::new(0x01020305), in test_long_uuids()
141 type_: Uuid::new(0x01020306), in test_long_uuids()
167 uuid: Uuid::new(0x01020304).into(), in test_long_uuids()
171 uuid: Uuid::new(0x01020305).into(), in test_long_uuids()
184 let db = TestAttDatabase::new(vec![ in test_short_uuids()
188 type_: Uuid::new(0x0102), in test_short_uuids()
[all …]
/packages/modules/Bluetooth/system/gd/rust/linux/stack/src/
Dcallbacks.rs22 pub fn new(tx: Sender<Message>, disconnected_message: fn(u32) -> Message) -> Self { in new() method
24 callbacks: HashMap::new(), in new()
25 object_id_to_cbid: HashMap::new(), in new()
45 let id = callback.register_disconnect(Box::new(move |cb_id| { in add_callback()
99 static CBID: AtomicU32 = AtomicU32::new(0);
106 fn new(id: String) -> TestCallback { in new() method
125 let mut callbacks = Callbacks::new(tx.clone(), Message::AdapterCallbackDisconnected); in test_add_and_remove()
130 let cbid = callbacks.add_callback(Box::new(TestCallback::new(cb_string.clone()))); in test_add_and_remove()
137 None => String::new(), in test_add_and_remove()
142 let cbid1 = callbacks.add_callback(Box::new(TestCallback::new(cb_string.clone()))); in test_add_and_remove()
[all …]
Dsocket_manager.rs46 fn new(status: BtStatus, id: u64) -> Self { in new() method
74 BluetoothServerSocket::new() in default()
79 fn new() -> Self { in new() method
142 let mut sock = BluetoothSocket::new(); in to_connecting_socket()
151 sock.remote_device = BluetoothDevice::new(conn.addr, "".into()); in to_connecting_socket()
176 self.name.as_ref().unwrap_or(&String::new()), in fmt()
201 BluetoothSocket::new() in default()
206 fn new() -> Self { in new() method
209 remote_device: BluetoothDevice::new(RawAddress::default(), String::new()), in new()
415 fn new( in new() method
[all …]
/packages/modules/Bluetooth/system/rust/src/connection/
Dacceptlist_manager.rs55 pub fn new(le_manager: impl LeAclManager + 'static) -> Self { in new() method
57 direct_list: HashSet::new(), in new()
58 background_list: HashSet::new(), in new()
59 le_manager: Box::new(le_manager), in new()
169 let mock_le_manager = MockActiveLeAclManager::new(); in test_add_to_direct_list()
170 let mut manager = LeAcceptlistManager::new(mock_le_manager.clone()); in test_add_to_direct_list()
187 let mock_le_manager = MockActiveLeAclManager::new(); in test_add_to_background_list()
188 let mut manager = LeAcceptlistManager::new(mock_le_manager.clone()); in test_add_to_background_list()
205 let mock_le_manager = MockActiveLeAclManager::new(); in test_background_connection_upgrade_to_direct()
206 let mut manager = LeAcceptlistManager::new(mock_le_manager.clone()); in test_background_connection_upgrade_to_direct()
[all …]
/packages/modules/Bluetooth/system/rust/src/
Dconnection.rs120 pub fn new(le_manager: impl InactiveLeAclManager) -> SharedBox<Self> { in new() method
122 state: RefCell::new(ConnectionManagerState { in new()
123 attempts: ConnectionAttempts::new(), in new()
124 current_connections: HashSet::new(), in new()
125 acceptlist_manager: LeAcceptlistManager::new( in new()
281 let mock_le_manager = MockLeAclManager::new(); in test_single_direct_connection()
282 let connection_manager = ConnectionManager::new(mock_le_manager.clone()); in test_single_direct_connection()
298 let mock_le_manager = MockLeAclManager::new(); in test_failed_direct_connection()
299 let connection_manager = ConnectionManager::new(mock_le_manager.clone()); in test_failed_direct_connection()
314 let mock_le_manager = MockLeAclManager::new(); in test_single_background_connection()
[all …]
/packages/modules/Virtualization/microdroid_manager/src/
Dmain.rs145 OpenOptions::new().read(false).write(true).open(FAILURE_SERIAL_DEVICE)?.write_all(chunk)?; in write_death_reason_to_serial()
153 let path = Path::new(INSTANCE_ID_PATH);
169 Path::new(DEFER_ROLLBACK_PROTECTION).exists() in should_defer_rollback_protection()
250 let mut instance = InstanceDisk::new().context("Failed to load instance.img")?; in verify_payload_with_instance_img()
307 let dice = if Path::new(DICE_CHAIN_FILE).exists() { in try_run_payload()
308 DiceDriver::from_file(Path::new(DICE_CHAIN_FILE)) in try_run_payload()
311 DiceDriver::new(Path::new("/dev/open-dice0"), is_strict_boot()) in try_run_payload()
332 VmSecret::new(dice_artifacts, service).context("Failed to create VM secrets")?; in try_run_payload()
346 let encryptedstore_child = if Path::new(ENCRYPTEDSTORE_BACKING_DEVICE).exists() { in try_run_payload()
359 Path::new(verify::DM_MOUNTED_APK_PATH), in try_run_payload()
[all …]
/packages/modules/Uwb/indev_uwb_adaptation/jni/src/
Dapi.rs99 let uci_logger_factory = match PcapngUciLoggerFactoryBuilder::new() in Java_com_android_server_uwb_indev_UwbServiceCore_nativeUwbServiceNew()
111 if let Some(uwb_service) = UwbServiceBuilder::new() in Java_com_android_server_uwb_indev_UwbServiceCore_nativeUwbServiceNew()
113 .callback_builder(UwbServiceCallbackBuilderImpl::new(vm, callback_obj, class_loader_obj)) in Java_com_android_server_uwb_indev_UwbServiceCore_nativeUwbServiceNew()
114 .uci_hal(UciHalAndroid::new("default")) in Java_com_android_server_uwb_indev_UwbServiceCore_nativeUwbServiceNew()
118 let service_wrapper = UwbServiceWrapper::new(uwb_service, runtime); in Java_com_android_server_uwb_indev_UwbServiceCore_nativeUwbServiceNew()
119 return Box::into_raw(Box::new(service_wrapper)) as jlong; in Java_com_android_server_uwb_indev_UwbServiceCore_nativeUwbServiceNew()
133 let ctx = JniContext::new(env, obj); in Java_com_android_server_uwb_indev_UwbServiceCore_nativeUwbServiceDestroy()
155 boolean_result_helper(enable(JniContext::new(env, obj)), "enable") in Java_com_android_server_uwb_indev_UwbServiceCore_nativeEnable()
165 boolean_result_helper(disable(JniContext::new(env, obj)), "disable") in Java_com_android_server_uwb_indev_UwbServiceCore_nativeDisable()
179 init_session(JniContext::new(env, obj), session_id, session_type, app_config_params), in Java_com_android_server_uwb_indev_UwbServiceCore_nativeInitSession()
[all …]
/packages/modules/Bluetooth/system/gd/packet/parser/
Dlanguage_y.yy164 $$ = new EnumDef(std::move(*$2), $4);
176 $$ = new std::map<uint64_t, std::string>();
193 $$ = new std::pair($3, std::move(*$1));
208 decls->AddTypeDef(*$2, new ChecksumDef(*$2, *$5, $4));
216 decls->AddTypeDef(*$2, new CustomFieldDef(*$2, *$5, $4));
222 decls->AddTypeDef(*$2, new CustomFieldDef(*$2, *$3));
248 $$ = new std::set<std::string*>();
273 … auto struct_definition = new StructDef(std::move(struct_name), std::move(field_definition_list));
298 …auto struct_definition = new StructDef(std::move(struct_name), std::move(field_definition_list), (…
323 …auto struct_definition = new StructDef(std::move(struct_name), std::move(field_definition_list), (…
[all …]
/packages/modules/Bluetooth/system/gd/rust/linux/service/
Dbuild.rs16 Config::new().probe("flatbuffers").unwrap(); in main()
17 Config::new().probe("protobuf").unwrap(); in main()
25 Config::new().probe("libchrome").unwrap(); in main()
26 Config::new().probe("libmodp_b64").unwrap(); in main()
27 Config::new().probe("tinyxml2").unwrap(); in main()
28 Config::new().probe("lc3").unwrap(); in main()
29 Config::new().probe("fmt").unwrap(); in main()
33 Config::new().probe("libstructuredmetrics").unwrap(); in main()
/packages/modules/Bluetooth/system/rust/src/connection/mocks/
Dmock_le_manager.rs26 pub fn new() -> Self { in new() method
27 Self { active: Rc::new(RefCell::new(None)), callbacks: Rc::new(RefCell::new(None)) } in new()
74 let out = MockActiveLeAclManager::new(); in register_callbacks()
76 *self.callbacks.borrow_mut() = Some(Box::new(callbacks)); in register_callbacks()
94 pub fn new() -> Rc<Self> { in new() method
95 Rc::new(MockActiveLeAclManager { in new()
96 state: RefCell::new(MockLeManagerInternalState { in new()
97 direct_connect_list: HashSet::new(), in new()
98 background_connect_list: HashSet::new(), in new()
99 currently_connected: HashSet::new(), in new()
/packages/modules/Bluetooth/system/gd/rust/linux/dbus_projection/src/
Dlib.rs78 pub fn new() -> DisconnectWatcher { in new() method
79 DisconnectWatcher { next_id: 0, callbacks: Arc::new(Mutex::new(HashMap::new())) } in new()
93 self.callbacks.lock().unwrap().insert(address.clone(), HashMap::new()); in add()
110 Box::new(move |msg, _conn| { in setup_watch()
113 let (addr, old, new) = msg.get3::<String, String, String>(); in setup_watch()
115 if addr.is_none() || old.is_none() || new.is_none() { in setup_watch()
119 if old.unwrap().eq("") || !new.unwrap().eq("") { in setup_watch()
126 let addr = BusName::new(addr.unwrap()).unwrap().into_static(); in setup_watch()
173 pub fn new( in new() method
184 dbus::nonblock::Proxy::new( in create_proxy()
[all …]
/packages/modules/Bluetooth/system/rust/src/core/
Duuid.rs20 pub const fn new(val: u32) -> Self { in new() method
42 2 => Self::new(u16::from_le_bytes([bytes[0], bytes[1]]) as u32), in try_from()
43 4 => Self::new(u32::from_le_bytes([bytes[0], bytes[1], bytes[2], bytes[3]])), in try_from()
54 Self::new(uuid.get_data() as u32) in from()
104 let uuid = Uuid::new(0x0102); in test_uuid16_builder_successful()
111 let uuid = Uuid::new(0x01020304); in test_uuid16_builder_fail_nonzero_trailing_bytes()
118 let mut uuid = Uuid::new(0x0102); in test_uuid16_builder_fail_invalid_prefix()
127 let uuid = Uuid::new(0x01020304); in test_uuid128_builder()
135 let uuid = Uuid::new(0x01020304); in test_uuid_builder()
143 let expected = Uuid::new(0x0102); in test_uuid_from_16_fixed_view()
[all …]
/packages/modules/Bluetooth/tools/rootcanal/rust/src/
Dffi.rs95 Rc::into_raw(Rc::new(LinkManager::new(ops))) in link_manager_create()
111 let lm = ManuallyDrop::new(unsafe { Rc::from_raw(lm) });
129 let lm = ManuallyDrop::new(unsafe { Rc::from_raw(lm) });
141 let lm = ManuallyDrop::new(unsafe { Rc::from_raw(lm) }); in link_manager_tick()
161 let lm = ManuallyDrop::new(unsafe { Rc::from_raw(lm) }); in link_manager_ingest_hci()
190 let lm = ManuallyDrop::new(unsafe { Rc::from_raw(lm) });
218 Rc::into_raw(Rc::new(LinkLayer::new(ops))) in link_layer_create()
239 let mut ll = ManuallyDrop::new(unsafe { Rc::from_raw(ll) });
256 let mut ll = ManuallyDrop::new(unsafe { Rc::from_raw(ll) }); in link_layer_remove_link()
269 let mut ll = ManuallyDrop::new(unsafe { Rc::from_raw(ll) }); in link_layer_tick()
[all …]

12345678910>>...22