]>
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
11 def enableNFC(enable
):
12 logging
.debug("Function enableNFC not implemented")
14 def enableBluetooth(enable
):
15 logging
.debug("Function enableBluetooth not implemented")
18 tools
.actions
.container_manager
.freeze(args
)
21 helpers
.lxc
.stop(args
)
22 helpers
.lxc
.start(args
)
24 def upgrade(system_zip
, system_time
, vendor_zip
, vendor_time
):
25 helpers
.lxc
.stop(args
)
26 helpers
.images
.umount_rootfs(args
)
27 helpers
.images
.replace(args
, system_zip
, system_time
,
28 vendor_zip
, vendor_time
)
29 helpers
.images
.mount_rootfs(args
, args
.images_path
)
30 helpers
.lxc
.start(args
)
33 IHardware
.add_service(
34 args
, enableNFC
, enableBluetooth
, suspend
, reboot
, upgrade
)
36 args
.hardware_manager
= threading
.Thread(target
=service_thread
)
37 args
.hardware_manager
.start()
42 args
.hardwareLoop
.quit()
43 except AttributeError:
44 logging
.debug("Hardware service is not even started")