GithubHelp home page GithubHelp logo

Comments (4)

mandric avatar mandric commented on July 28, 2024

Hrm I think I have a patch... this seems to fix it for me.

--- a/src/org/addhen/smssync/services/SmsReceiverService.java
+++ b/src/org/addhen/smssync/services/SmsReceiverService.java
@@ -450,6 +450,17 @@ public class SmsReceiverService extends Service {
         return msgs;
     }

+   synchronized protected static WifiManager.WifiLock getWifiLock(Context context) {
+        // keep wifi alive
+        if (wifilock == null) {
+            WifiManager manager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
+            wifilock = manager.createWifiLock(CLASS_TAG);
+            wifilock.setReferenceCounted(true);
+        }
+
+        return wifilock;
+    }
+
     /**
      * Start the service to process the current event notifications, acquiring
      * the wake lock before returning to ensure that the service will run.
@@ -467,14 +478,9 @@ public class SmsReceiverService extends Service {
                 mStartingService.setReferenceCounted(false);
             }

-            // keep wifi alive
-            if (wifilock == null) {
-                WifiManager manager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE);
-                wifilock = manager.createWifiLock(CLASS_TAG);
-            }
-
             mStartingService.acquire();
-            wifilock.acquire();
+            if (!getWifiLock(context).isHeld()) 
+                getWifiLock(context).acquire();
             context.startService(intent);
         }
     }

from smssync.

eyedol avatar eyedol commented on July 28, 2024

@mandric Are you sending the 50+ messages at a goal? And oh 2.x.x should support Android 2.x and above. It only dropped support for 1.6. I'll try and reproduce the issue and patch the code with your fix.

from smssync.

mandric avatar mandric commented on July 28, 2024

Pretty sure I had the same issue whether I setup a syncurl or not. I'm not sure what you mean by goal.

I should start using the 2.x branch then, I had trouble compiling it with that target. e.g. android update project --target "android-10" -p . I'll try again...

from smssync.

eyedol avatar eyedol commented on July 28, 2024

@mandric I meant 50 messages at a time?

from smssync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.