]> glassweightruler.freedombox.rocks Git - waydroid.git/commitdiff
Make adb auto-connection opt-out
authorJami Kettunen <jami.kettunen@protonmail.com>
Thu, 28 Dec 2023 13:22:53 +0000 (15:22 +0200)
committerAlessandro Astone <ales.astone@gmail.com>
Tue, 2 Jan 2024 12:53:45 +0000 (13:53 +0100)
Just because you have ADB installed (for e.g. physical Android device
development) doesn't mean you necessarily want Waydroid to always also
get automatically connected, allow disabling this functionality.

tools/config/__init__.py
tools/services/user_manager.py

index 2d8ae13c4b0a109c0af83c70923eb801fc5487f6..002562eab4dabe815121fb9a4cc2ba01285b301b 100644 (file)
@@ -22,7 +22,8 @@ config_keys = ["arch",
                "system_datetime",
                "vendor_datetime",
                "suspend_action",
                "system_datetime",
                "vendor_datetime",
                "suspend_action",
-               "mount_overlays"]
+               "mount_overlays",
+               "auto_adb"]
 
 # Config file/commandline default values
 # $WORK gets replaced with the actual value for args.work (which may be
 
 # Config file/commandline default values
 # $WORK gets replaced with the actual value for args.work (which may be
@@ -39,6 +40,7 @@ defaults = {
     ],
     "suspend_action": "freeze",
     "mount_overlays": "True",
     ],
     "suspend_action": "freeze",
     "mount_overlays": "True",
+    "auto_adb": "True",
 }
 defaults["images_path"] = defaults["work"] + "/images"
 defaults["rootfs"] = defaults["work"] + "/rootfs"
 }
 defaults["images_path"] = defaults["work"] + "/images"
 defaults["rootfs"] = defaults["work"] + "/rootfs"
index 8e7e982ecf3b9e20e004360e2a77fd78816b550b..92ee203b688eac7f5dc20b6a1aac5fc5e01f642f 100644 (file)
@@ -64,9 +64,11 @@ NoDisplay={str(hide).lower()}
 """)
 
     def userUnlocked(uid):
 """)
 
     def userUnlocked(uid):
+        cfg = tools.config.load(args)
         logging.info("Android with user {} is ready".format(uid))
 
         logging.info("Android with user {} is ready".format(uid))
 
-        tools.helpers.net.adb_connect(args)
+        if cfg["waydroid"]["auto_adb"] == "True":
+            tools.helpers.net.adb_connect(args)
 
         platformService = IPlatform.get_service(args)
         if platformService:
 
         platformService = IPlatform.get_service(args)
         if platformService: