This allows to use persist.waydroid.suspend as a way to automatically
stop the session after an inactivity timeout, as opposed to merely
freezing the container. Freeze still remains the default action.
To use it this way, add to waydroid.cfg:
suspend_action = stop
"images_path",
"vendor_type",
"system_datetime",
"images_path",
"vendor_type",
"system_datetime",
+ "vendor_datetime",
+ "suspend_action"]
session_config_keys = ["user_name",
"user_id",
session_config_keys = ["user_name",
"user_id",
"preinstalled_images_paths": [
"/etc/waydroid-extra/images",
"/usr/share/waydroid-extra/images",
"preinstalled_images_paths": [
"/etc/waydroid-extra/images",
"/usr/share/waydroid-extra/images",
+ ],
+ "suspend_action": "freeze"
}
defaults["images_path"] = defaults["work"] + "/images"
defaults["rootfs"] = defaults["work"] + "/rootfs"
}
defaults["images_path"] = defaults["work"] + "/images"
defaults["rootfs"] = defaults["work"] + "/rootfs"
import logging
import threading
import tools.actions.container_manager
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
from tools import helpers
from tools.interfaces import IHardware
logging.debug("Function enableBluetooth not implemented")
def suspend():
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)
def reboot():
helpers.lxc.stop(args)