]> glassweightruler.freedombox.rocks Git - waydroid.git/blobdiff - tools/services/hardware_manager.py
All AppArmor profiles have been switched to the "enforce" mode.
[waydroid.git] / tools / services / hardware_manager.py
index 45c51109a68e8fd17ba109098e716abfee7c7b4f..76104cbfdf1f8c02773e638e38788914eaad7f1f 100644 (file)
@@ -3,6 +3,8 @@
 import logging
 import threading
 import tools.actions.container_manager
+import tools.actions.session_manager
+import tools.config
 from tools import helpers
 from tools.interfaces import IHardware
 
@@ -16,7 +18,11 @@ def start(args):
         logging.debug("Function enableBluetooth not implemented")
 
     def suspend():
-        tools.actions.container_manager.freeze(args)
+        cfg = tools.config.load(args)
+        if cfg["waydroid"]["suspend_action"] == "stop":
+            tools.actions.session_manager.stop(args)
+        else:
+            tools.actions.container_manager.freeze(args)
 
     def reboot():
         helpers.lxc.stop(args)
@@ -27,7 +33,8 @@ def start(args):
         helpers.images.umount_rootfs(args)
         helpers.images.replace(args, system_zip, system_time,
                                vendor_zip, vendor_time)
-        helpers.images.mount_rootfs(args, args.images_path)
+        args.session["background_start"] = "false"
+        helpers.images.mount_rootfs(args, args.images_path, args.session)
         helpers.protocol.set_aidl_version(args)
         helpers.lxc.start(args)