]> glassweightruler.freedombox.rocks Git - waydroid.git/blobdiff - tools/helpers/props.py
Fix prop set command
[waydroid.git] / tools / helpers / props.py
index de3c3a8dcef4cb96b69e82c9b3f1b16c5029fc03..0d7f4bc75f274ea2c9caf88f7115a5db16b56c5e 100644 (file)
@@ -21,34 +21,18 @@ def host_set(args, prop, value):
         tools.helpers.run.user(args, command)
 
 def get(args, prop):
-    if os.path.exists(tools.config.session_defaults["config_path"]):
-        session_cfg = tools.config.load_session()
-        if session_cfg["session"]["state"] == "RUNNING":
-            platformService = IPlatform.get_service(args)
-            if platformService:
-                return platformService.getprop(prop, "")
-            else:
-                logging.error("Failed to access IPlatform service")
-        else:
-            logging.error("WayDroid container is {}".format(
-                session_cfg["session"]["state"]))
+    platformService = IPlatform.get_service(args)
+    if platformService:
+        return platformService.getprop(prop, "")
     else:
-        logging.error("WayDroid session is stopped")
+        logging.error("Failed to access IPlatform service")
 
 def set(args, prop, value):
-    if os.path.exists(tools.config.session_defaults["config_path"]):
-        session_cfg = tools.config.load_session()
-        if session_cfg["session"]["state"] == "RUNNING":
-            platformService = IPlatform.get_service(args)
-            if platformService:
-                platformService.setprop(prop, value)
-            else:
-                logging.error("Failed to access IPlatform service")
-        else:
-            logging.error("WayDroid container is {}".format(
-                session_cfg["session"]["state"]))
+    platformService = IPlatform.get_service(args)
+    if platformService:
+        platformService.setprop(prop, value)
     else:
-        logging.error("WayDroid session is stopped")
+        logging.error("Failed to access IPlatform service")
 
 def file_get(args, file, prop):
     with open(file) as build_prop: