policy: Change AutoEnable default to true
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 13 Apr 2022 22:21:00 +0000 (15:21 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:54 +0000 (14:55 +0530)
This changes the default of AutoEnable to true so controllers are power
up by default.

Fixes: https://github.com/bluez/bluez/issues/328
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
plugins/policy.c
src/main.conf

index 46bbb85..b75a0ba 100755 (executable)
@@ -957,7 +957,11 @@ static int policy_init(void)
        }
 
        auto_enable = g_key_file_get_boolean(conf, "Policy", "AutoEnable",
-                                                                       NULL);
+                                                               &gerr);
+       if (gerr) {
+               g_clear_error(&gerr);
+               auto_enable = true;
+       }
 
        resume_delay = g_key_file_get_integer(
                        conf, "Policy", "ResumeDelay", &gerr);
index f735ff7..0d24eba 100755 (executable)
 
 # AutoEnable defines option to enable all controllers when they are found.
 # This includes adapters present on start as well as adapters that are plugged
-# in later on. Defaults to 'false'.
-#AutoEnable=false
+# in later on. Defaults to 'true'.
+#AutoEnable=true
 
 # Audio devices that were disconnected due to suspend will be reconnected on
 # resume. ResumeDelay determines the delay between when the controller