Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cordova-background-geolocation
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Aksimaya
cordova-background-geolocation
Commits
286697d8
Commit
286697d8
authored
May 29, 2015
by
Chris Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bugs related to plugin life-cycle reported by LogicsSoftware. Fixes issue 62 & 61
parent
8889849b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
CDVBackgroundGeolocation.java
src/android/CDVBackgroundGeolocation.java
+13
-3
transistor-locationmanager.jar
src/android/libs/transistor-locationmanager.jar
+0
-0
No files found.
src/android/CDVBackgroundGeolocation.java
View file @
286697d8
...
...
@@ -71,7 +71,6 @@ public class CDVBackgroundGeolocation extends CordovaPlugin {
backgroundServiceIntent
=
new
Intent
(
this
.
cordova
.
getActivity
(),
BackgroundGeolocationService
.
class
);
// Register for events fired by our IntentService "LocationService"
EventBus
.
getDefault
().
register
(
this
);
}
public
boolean
execute
(
String
action
,
JSONArray
data
,
CallbackContext
callbackContext
)
throws
JSONException
{
...
...
@@ -110,8 +109,11 @@ public class CDVBackgroundGeolocation extends CordovaPlugin {
}
}
else
if
(
ACTION_SET_CONFIG
.
equalsIgnoreCase
(
action
))
{
result
=
applyConfig
(
data
);
// TODO reconfigure Service
if
(
result
)
{
Bundle
event
=
new
Bundle
();
event
.
putString
(
"name"
,
action
);
event
.
putBoolean
(
"request"
,
true
);
EventBus
.
getDefault
().
post
(
event
);
callbackContext
.
success
();
}
else
{
callbackContext
.
error
(
"- Configuration error!"
);
...
...
@@ -185,10 +187,12 @@ public class CDVBackgroundGeolocation extends CordovaPlugin {
editor
.
commit
();
if
(
isEnabled
)
{
EventBus
.
getDefault
().
register
(
this
);
if
(!
BackgroundGeolocationService
.
isInstanceCreated
())
{
activity
.
startService
(
backgroundServiceIntent
);
}
}
else
{
EventBus
.
getDefault
().
unregister
(
this
);
activity
.
stopService
(
backgroundServiceIntent
);
}
}
...
...
@@ -215,6 +219,9 @@ public class CDVBackgroundGeolocation extends CordovaPlugin {
if
(
config
.
has
(
"locationUpdateInterval"
))
{
editor
.
putInt
(
"locationUpdateInterval"
,
config
.
getInt
(
"locationUpdateInterval"
));
}
if
(
config
.
has
(
"fastestLocationUpdateInterval"
))
{
editor
.
putInt
(
"fastestLocationUpdateInterval"
,
config
.
getInt
(
"fastestLocationUpdateInterval"
));
}
if
(
config
.
has
(
"activityRecognitionInterval"
))
{
editor
.
putLong
(
"activityRecognitionInterval"
,
config
.
getLong
(
"activityRecognitionInterval"
));
}
...
...
@@ -231,7 +238,8 @@ public class CDVBackgroundGeolocation extends CordovaPlugin {
editor
.
putInt
(
"stopAfterElapsedMinutes"
,
config
.
getInt
(
"stopAfterElapsedMinutes"
));
}
if
(
config
.
has
(
"stopOnTerminate"
))
{
editor
.
putBoolean
(
"stopOnTerminate"
,
config
.
getBoolean
(
"stopOnTerminate"
));
stopOnTerminate
=
config
.
getBoolean
(
"stopOnTerminate"
);
editor
.
putBoolean
(
"stopOnTerminate"
,
stopOnTerminate
);
}
if
(
config
.
has
(
"startOnBoot"
))
{
editor
.
putBoolean
(
"startOnBoot"
,
config
.
getBoolean
(
"startOnBoot"
));
...
...
@@ -408,6 +416,8 @@ public class CDVBackgroundGeolocation extends CordovaPlugin {
Activity
activity
=
this
.
cordova
.
getActivity
();
EventBus
.
getDefault
().
unregister
(
this
);
SharedPreferences
settings
=
activity
.
getSharedPreferences
(
"TSLocationManager"
,
0
);
SharedPreferences
.
Editor
editor
=
settings
.
edit
();
editor
.
putBoolean
(
"activityIsActive"
,
false
);
...
...
src/android/libs/transistor-locationmanager.jar
View file @
286697d8
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment