]>
glassweightruler.freedombox.rocks Git - waydroid.git/blob - tools/services/hardware_manager.py
1 # Copyright 2021 Erfan Abdi
2 # SPDX-License-Identifier: GPL-3.0-or-later
5 import tools
.actions
.container_manager
6 from tools
import helpers
7 from tools
.interfaces
import IHardware
12 def enableNFC(enable
):
13 logging
.debug("Function enableNFC not implemented")
15 def enableBluetooth(enable
):
16 logging
.debug("Function enableBluetooth not implemented")
19 tools
.actions
.container_manager
.freeze(args
)
22 helpers
.lxc
.stop(args
)
23 helpers
.lxc
.start(args
)
25 def upgrade(system_zip
, system_time
, vendor_zip
, vendor_time
):
26 helpers
.lxc
.stop(args
)
27 helpers
.images
.umount_rootfs(args
)
28 helpers
.images
.replace(args
, system_zip
, system_time
,
29 vendor_zip
, vendor_time
)
30 helpers
.images
.mount_rootfs(args
, args
.images_path
)
31 helpers
.protocol
.set_aidl_version(args
)
32 helpers
.lxc
.start(args
)
36 IHardware
.add_service(
37 args
, enableNFC
, enableBluetooth
, suspend
, reboot
, upgrade
)
41 args
.hardware_manager
= threading
.Thread(target
=service_thread
)
42 args
.hardware_manager
.start()
49 args
.hardwareLoop
.quit()
50 except AttributeError:
51 logging
.debug("Hardware service is not even started")