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
57574cc3
Commit
57574cc3
authored
Mar 27, 2015
by
Chris Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug, accidentally disabled setting locationCallback in configure
parent
8a13993f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
BackgroundGeolocationPlugin.java
src/android/BackgroundGeolocationPlugin.java
+8
-7
No files found.
src/android/BackgroundGeolocationPlugin.java
View file @
57574cc3
...
...
@@ -56,7 +56,7 @@ public class BackgroundGeolocationPlugin extends CordovaPlugin implements Locati
private
Integer
activityRecognitionInterval
=
60000
;
// Geolocation callback
private
CallbackContext
c
allback
;
private
CallbackContext
locationC
allback
;
// Called when DetectedActivity is STILL
private
CallbackContext
stationaryCallback
;
...
...
@@ -119,6 +119,7 @@ public class BackgroundGeolocationPlugin extends CordovaPlugin implements Locati
}
else
if
(
ACTION_CONFIGURE
.
equalsIgnoreCase
(
action
))
{
result
=
applyConfig
(
data
);
if
(
result
)
{
this
.
locationCallback
=
callbackContext
;
if
(
isDebugging
)
{
toneGenerator
=
new
ToneGenerator
(
AudioManager
.
STREAM_NOTIFICATION
,
100
);
}
...
...
@@ -253,6 +254,9 @@ public class BackgroundGeolocationPlugin extends CordovaPlugin implements Locati
}
public
void
onEventMainThread
(
DetectedActivity
probableActivity
)
{
String
probableActivityName
=
getActivityName
(
probableActivity
.
getType
());
Log
.
w
(
TAG
,
"- DetectedActivity: "
+
probableActivityName
+
", confidence: "
+
probableActivity
.
getConfidence
());
currentActivity
=
probableActivity
;
boolean
wasMoving
=
isMoving
;
...
...
@@ -270,9 +274,9 @@ public class BackgroundGeolocationPlugin extends CordovaPlugin implements Locati
nowMoving
=
false
;
break
;
case
DetectedActivity
.
UNKNOWN
:
break
;
case
DetectedActivity
.
TILTING
:
break
;
// We don't let these ActivityType affect movement/stationary state.
return
;
}
boolean
startedMoving
=
!
wasMoving
&&
nowMoving
;
...
...
@@ -282,9 +286,6 @@ public class BackgroundGeolocationPlugin extends CordovaPlugin implements Locati
if
(
startedMoving
||
justStopped
||
initialState
)
{
setPace
(
nowMoving
);
}
String
probableActivityName
=
getActivityName
(
probableActivity
.
getType
());
Log
.
w
(
TAG
,
"- DetectedActivity: "
+
probableActivityName
+
", confidence: "
+
probableActivity
.
getConfidence
());
}
public
void
onEventMainThread
(
Location
location
)
{
...
...
@@ -293,7 +294,7 @@ public class BackgroundGeolocationPlugin extends CordovaPlugin implements Locati
PluginResult
result
=
new
PluginResult
(
PluginResult
.
Status
.
OK
,
locationToJson
(
location
));
result
.
setKeepCallback
(
true
);
runInBackground
(
c
allback
,
result
);
runInBackground
(
locationC
allback
,
result
);
}
/**
...
...
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