Add wakeUp and unlock functions

This commit is contained in:
Sebastián Katzer
2017-02-10 13:10:46 +01:00
parent ff9f06382f
commit 0f94708c7a
6 changed files with 162 additions and 27 deletions

View File

@@ -33,6 +33,8 @@ import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import de.appplant.cordova.plugin.background.ForegroundService.ForegroundBinder;
import static android.content.Context.BIND_AUTO_CREATE;
public class BackgroundMode extends CordovaPlugin {
@@ -65,9 +67,7 @@ public class BackgroundMode extends CordovaPlugin {
private final ServiceConnection connection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
ForegroundService.ForegroundBinder binder =
(ForegroundService.ForegroundBinder) service;
ForegroundBinder binder = (ForegroundBinder) service;
BackgroundMode.this.service = binder.getService();
}
@@ -77,6 +77,11 @@ public class BackgroundMode extends CordovaPlugin {
}
};
@Override
protected void pluginInitialize() {
BackgroundExt.addWindowFlags(cordova.getActivity());
}
// codebeat:disable[ABC]
/**