if the DBUS stuff fails, try running lindi's device script to turn on/off gps
[gregoa/zavai.git] / src / gps.vala
index 546fdcf9d67a439c436bb0c5f3ae98df5ba7228b..9804b2198a0301bc11c1c1e7d38a0027e95e47e9 100644 (file)
@@ -76,6 +76,11 @@ public class GPS: zavai.Service
                        base.start();
                } catch (GLib.Error e) {
                        zavai.log.error(e.message);
+                       try {
+                               zavai.app.run_script("device start gps");
+                       } catch (Error e) {
+                               zavai.log.error("Running device start gps: " + e.message);
+                       }
                }
                base.start();
        }
@@ -90,6 +95,11 @@ public class GPS: zavai.Service
                        base.stop();
                } catch (GLib.Error e) {
                        zavai.log.error(e.message);
+                       try {
+                               zavai.app.run_script("device stop gps");
+                       } catch (Error e) {
+                               zavai.log.error("Running device stop gps: " + e.message);
+                       }
                }
                base.stop();
        }