From f8f058687e8cc194908744c95c40e14ebe990032 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Tue, 20 Sep 2022 17:29:41 +0200 Subject: [PATCH] Start service on Android --- sbapp/main.py | 4 +++- sbapp/patches/PythonService.java | 7 ------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/sbapp/main.py b/sbapp/main.py index c50f779..1347103 100644 --- a/sbapp/main.py +++ b/sbapp/main.py @@ -96,7 +96,9 @@ class SidebandApp(MDApp): self.guide_action() self.app_state = SidebandApp.ACTIVE - self.start_android_service() + + if RNS.vendor.platformutils.get_platform() == "android": + self.start_android_service() def start_android_service(self): service = autoclass('io.unsigned.sideband.ServiceSidebandservice') diff --git a/sbapp/patches/PythonService.java b/sbapp/patches/PythonService.java index 0d761f7..3544073 100644 --- a/sbapp/patches/PythonService.java +++ b/sbapp/patches/PythonService.java @@ -150,13 +150,6 @@ public class PythonService extends Service implements Runnable { // builder.setSmallIcon(context.getApplicationInfo().icon); builder.setSmallIcon(service_icon); notification = builder.build(); - - // Log.v("python service", "Testing WM locks..."); - // WifiManager wm = (WifiManager) getSystemService(Context.WIFI_SERVICE); - // MulticastLock ml = wm.createMulticastLock("sometag"); - // Log.v("python service", "WM locks done"); - - } startForeground(getServiceId(), notification); }