Refact/android input changed notify clients (#8494)

* refact: android, input control changed, notify clients

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: android init input perm

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2024-06-27 13:05:45 +08:00
committed by GitHub
parent 9c7d4ef1f7
commit b047730830
5 changed files with 31 additions and 0 deletions

View File

@@ -279,6 +279,15 @@ pub fn close(id: i32) {
};
}
#[inline]
#[cfg(target_os = "android")]
pub fn notify_input_control(v: bool) {
for (_, mut client) in CLIENTS.write().unwrap().iter_mut() {
client.keyboard = v;
allow_err!(client.tx.send(Data::InputControl(v)));
}
}
#[inline]
pub fn remove(id: i32) {
CLIENTS.write().unwrap().remove(&id);