Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
石璀亮
/
agenew_a16_sos
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6f2c82a4
authored
Jul 29, 2019
by
cuiliang.shi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4.1获取实时定位
短信内容:【微尚信息】颐关爱下发指令:#1#
1 parent
c8b0a846
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
app/src/main/java/com/toscl/location/hengfeng/LocationService.java
app/src/main/java/com/toscl/location/hengfeng/LocationService.java
View file @
6f2c82a
...
@@ -74,7 +74,21 @@ public class LocationService extends Service {
...
@@ -74,7 +74,21 @@ public class LocationService extends Service {
public
int
onStartCommand
(
Intent
intent
,
int
flags
,
int
startId
)
{
public
int
onStartCommand
(
Intent
intent
,
int
flags
,
int
startId
)
{
Log
.
d
(
TAG
,
"onStartCommand"
);
Log
.
d
(
TAG
,
"onStartCommand"
);
isStartFromSms
(
intent
);
String
begin
=
intent
.
getStringExtra
(
"begin"
);
String
req
=
intent
.
getStringExtra
(
"request"
);
if
(
begin
!=
null
){
String
end
=
intent
.
getStringExtra
(
"end"
);
String
frequency
=
intent
.
getStringExtra
(
"frequency"
);
PreferencesUtil
.
getInstance
(
getApplicationContext
())
.
putInt
(
PreferencesUtil
.
HENG_FENG_BEGIN
,
Integer
.
parseInt
(
begin
));
PreferencesUtil
.
getInstance
(
getApplicationContext
())
.
putInt
(
PreferencesUtil
.
HENG_FENG_END
,
Integer
.
parseInt
(
end
));
PreferencesUtil
.
getInstance
(
getApplicationContext
())
.
putInt
(
PreferencesUtil
.
HENG_FENG_FREQUENCY
,
Integer
.
parseInt
(
frequency
));
}
handleForegroundService
();
handleForegroundService
();
...
@@ -84,7 +98,13 @@ public class LocationService extends Service {
...
@@ -84,7 +98,13 @@ public class LocationService extends Service {
if
(
PhoneUtils
.
getSubId
(
this
,
PreferencesUtil
.
HENG_FENG_DEFAULT_SLOT
)
==
SubscriptionManager
.
INVALID_SUBSCRIPTION_ID
){
if
(
PhoneUtils
.
getSubId
(
this
,
PreferencesUtil
.
HENG_FENG_DEFAULT_SLOT
)
==
SubscriptionManager
.
INVALID_SUBSCRIPTION_ID
){
Toast
.
makeText
(
this
,
getResources
().
getString
(
R
.
string
.
location_service_failed_tips
),
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
this
,
getResources
().
getString
(
R
.
string
.
location_service_failed_tips
),
Toast
.
LENGTH_SHORT
).
show
();
}
else
{
}
else
{
if
(
PreferencesUtil
.
getInstance
(
getApplicationContext
())
if
(
req
!=
null
){
PreferencesUtil
.
getInstance
(
getApplicationContext
())
.
putBoolean
(
PreferencesUtil
.
HENG_FENG_IS_OEPN
,
true
);
cancelPreviousAlarmService
();
readyToReqLocation
();
}
else
if
(
PreferencesUtil
.
getInstance
(
getApplicationContext
())
.
getBoolean
(
PreferencesUtil
.
HENG_FENG_IS_OEPN
,
false
))
{
.
getBoolean
(
PreferencesUtil
.
HENG_FENG_IS_OEPN
,
false
))
{
if
(
PhoneUtils
.
hengdaServiceAvailable
(
getApplicationContext
()))
{
if
(
PhoneUtils
.
hengdaServiceAvailable
(
getApplicationContext
()))
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment