Commit 346ba6b1 by cuiliang.shi

BUG 开机首次 未插卡导致执行后面逻辑 导致setting报错

1 parent 24a0da5c
......@@ -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);
}
}
......
......@@ -552,6 +552,8 @@ public class PhoneUtils {
if (sir != null) {
subId = sir.getSubscriptionId();
}
Log.d(TAG, "getSubid slotid: " + slotId + ", subid: " + subId);
return subId;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!