Revert NSClient service to previous for PR

This commit is contained in:
Jamorham 2018-02-22 13:27:43 +00:00
parent 9d985ec3b7
commit b989cf5a3c
No known key found for this signature in database
GPG key ID: 0BC5C3E0AAD64DF9

View file

@ -118,7 +118,7 @@ public class NSClientService extends Service {
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
mWakeLock.acquire(60000); mWakeLock.acquire();
} }
@Override @Override
@ -207,8 +207,6 @@ public class NSClientService extends Service {
} else if (!nsEnabled) { } else if (!nsEnabled) {
MainApp.bus().post(new EventNSClientNewLog("NSCLIENT", "disabled")); MainApp.bus().post(new EventNSClientNewLog("NSCLIENT", "disabled"));
MainApp.bus().post(new EventNSClientStatus("Disabled")); MainApp.bus().post(new EventNSClientStatus("Disabled"));
destroy();
stopSelf();
} else if (!nsURL.equals("")) { } else if (!nsURL.equals("")) {
try { try {
MainApp.bus().post(new EventNSClientStatus("Connecting ...")); MainApp.bus().post(new EventNSClientStatus("Connecting ..."));
@ -456,7 +454,7 @@ public class NSClientService extends Service {
PowerManager powerManager = (PowerManager) MainApp.instance().getApplicationContext().getSystemService(Context.POWER_SERVICE); PowerManager powerManager = (PowerManager) MainApp.instance().getApplicationContext().getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
"onDataUpdate"); "onDataUpdate");
wakeLock.acquire(30000); wakeLock.acquire();
try { try {
JSONObject data = (JSONObject) args[0]; JSONObject data = (JSONObject) args[0];