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 346ba6b1
authored
Jul 01, 2019
by
cuiliang.shi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG 开机首次 未插卡导致执行后面逻辑 导致setting报错
1 parent
24a0da5c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
13 deletions
app/src/main/java/com/toscl/location/hengfeng/LocationService.java
app/src/main/java/com/toscl/location/hengfeng/util/PhoneUtils.java
app/src/main/java/com/toscl/location/hengfeng/LocationService.java
View file @
346ba6b
...
...
@@ -81,25 +81,25 @@ public class LocationService extends Service {
* */
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
();
}
}
else
{
if
(
PreferencesUtil
.
getInstance
(
getApplicationContext
())
.
getBoolean
(
PreferencesUtil
.
HENG_FENG_IS_OEPN
,
false
))
{
if
(
PreferencesUtil
.
getInstance
(
getApplicationContext
())
.
getBoolean
(
PreferencesUtil
.
HENG_FENG_IS_OEPN
,
false
))
{
if
(
PhoneUtils
.
hengdaServiceAvailable
(
getApplicationContext
()))
{
if
(
PhoneUtils
.
hengdaServiceAvailable
(
getApplicationContext
()))
{
if
(
PhoneUtils
.
isCurrentTimeInThePeriod
(
getApplicationContext
()))
{
if
(
PhoneUtils
.
isCurrentTimeInThePeriod
(
getApplicationContext
())){
readyToReqLocation
();
readyToReqLocation
();
}
else
{
calculateAlarmForNextPeriodService
();
}
}
else
{
calculateAlarmForNextPeriodService
();
}
else
{
Toast
.
makeText
(
getApplicationContext
(),
getResources
().
getString
(
R
.
string
.
location_server_unavailable
),
Toast
.
LENGTH_SHORT
).
show
();
PreferencesUtil
.
getInstance
(
getApplicationContext
())
.
putBoolean
(
PreferencesUtil
.
HENG_FENG_IS_OEPN
,
false
);
}
}
else
{
Toast
.
makeText
(
getApplicationContext
(),
getResources
().
getString
(
R
.
string
.
location_server_unavailable
),
Toast
.
LENGTH_SHORT
).
show
();
PreferencesUtil
.
getInstance
(
getApplicationContext
())
.
putBoolean
(
PreferencesUtil
.
HENG_FENG_IS_OEPN
,
false
);
}
}
...
...
app/src/main/java/com/toscl/location/hengfeng/util/PhoneUtils.java
View file @
346ba6b
...
...
@@ -552,6 +552,8 @@ public class PhoneUtils {
if
(
sir
!=
null
)
{
subId
=
sir
.
getSubscriptionId
();
}
Log
.
d
(
TAG
,
"getSubid slotid: "
+
slotId
+
", subid: "
+
subId
);
return
subId
;
}
...
...
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