Merge "gps: moving agps/ni/xtra/time features out of afw"
This commit is contained in:
commit
e8fb026bf3
22 changed files with 148 additions and 624 deletions
|
@ -4,9 +4,7 @@ LOCAL_PATH := $(call my-dir)
|
||||||
|
|
||||||
GPS_DIR_LIST :=
|
GPS_DIR_LIST :=
|
||||||
|
|
||||||
FEATURE_IPV6 := true
|
|
||||||
FEATURE_DELEXT := true
|
FEATURE_DELEXT := true
|
||||||
FEATURE_ULP := true
|
|
||||||
|
|
||||||
# add RPC dirs if RPC is available
|
# add RPC dirs if RPC is available
|
||||||
ifneq ($(TARGET_NO_RPC),true)
|
ifneq ($(TARGET_NO_RPC),true)
|
||||||
|
|
|
@ -20,10 +20,6 @@ LOCAL_CFLAGS+=$(GPS_FEATURES)
|
||||||
# for loc_api_fixup.c
|
# for loc_api_fixup.c
|
||||||
LOCAL_CFLAGS+=-DADD_XDR_FLOAT -DADD_XDR_BOOL
|
LOCAL_CFLAGS+=-DADD_XDR_FLOAT -DADD_XDR_BOOL
|
||||||
|
|
||||||
ifeq ($(FEATURE_IPV6), true)
|
|
||||||
LOCAL_CFLAGS += -DFEATURE_IPV6
|
|
||||||
endif #FEATURE_IPV6
|
|
||||||
|
|
||||||
LOCAL_SHARED_LIBRARIES:= \
|
LOCAL_SHARED_LIBRARIES:= \
|
||||||
librpc \
|
librpc \
|
||||||
libutils \
|
libutils \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2011, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2011,2013, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -96,14 +96,8 @@ public:
|
||||||
setServer(unsigned int ip, int port, LocServerType type);
|
setServer(unsigned int ip, int port, LocServerType type);
|
||||||
virtual enum loc_api_adapter_err
|
virtual enum loc_api_adapter_err
|
||||||
setXtraData(char* data, int length);
|
setXtraData(char* data, int length);
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
virtual enum loc_api_adapter_err
|
virtual enum loc_api_adapter_err
|
||||||
atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType);
|
atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType);
|
||||||
#else
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
atlOpenStatus(int handle, int is_succ, char* apn,
|
|
||||||
AGpsType agpsType);
|
|
||||||
#endif
|
|
||||||
virtual enum loc_api_adapter_err
|
virtual enum loc_api_adapter_err
|
||||||
atlCloseStatus(int handle, int is_succ);
|
atlCloseStatus(int handle, int is_succ);
|
||||||
virtual enum loc_api_adapter_err
|
virtual enum loc_api_adapter_err
|
||||||
|
|
|
@ -958,22 +958,13 @@ LocApiRpcAdapter::setXtraData(char* data, int length)
|
||||||
return convertErr(rpc_ret_val);
|
return convertErr(rpc_ret_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
enum loc_api_adapter_err
|
enum loc_api_adapter_err
|
||||||
LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, AGpsType agpsType)
|
LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, AGpsType agpsType)
|
||||||
#else
|
|
||||||
enum loc_api_adapter_err
|
|
||||||
LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsType agpsType)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
rpc_loc_server_open_status_e_type open_status = is_succ ? RPC_LOC_SERVER_OPEN_SUCCESS : RPC_LOC_SERVER_OPEN_FAIL;
|
rpc_loc_server_open_status_e_type open_status = is_succ ? RPC_LOC_SERVER_OPEN_SUCCESS : RPC_LOC_SERVER_OPEN_FAIL;
|
||||||
rpc_loc_ioctl_data_u_type ioctl_data;
|
rpc_loc_ioctl_data_u_type ioctl_data;
|
||||||
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
if (AGPS_TYPE_INVALID == agpsType) {
|
if (AGPS_TYPE_INVALID == agpsType) {
|
||||||
#else
|
|
||||||
if (false) {
|
|
||||||
#endif
|
|
||||||
rpc_loc_server_open_status_s_type *conn_open_status_ptr =
|
rpc_loc_server_open_status_s_type *conn_open_status_ptr =
|
||||||
&ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status;
|
&ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status;
|
||||||
|
|
||||||
|
@ -1010,7 +1001,6 @@ LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsType agp
|
||||||
conn_multi_open_status_ptr->apn_name[0] = 0;
|
conn_multi_open_status_ptr->apn_name[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
switch(bearer)
|
switch(bearer)
|
||||||
{
|
{
|
||||||
case AGPS_APN_BEARER_IPV4:
|
case AGPS_APN_BEARER_IPV4:
|
||||||
|
@ -1025,9 +1015,7 @@ LocApiRpcAdapter::atlOpenStatus(int handle, int is_succ, char* apn, AGpsType agp
|
||||||
default:
|
default:
|
||||||
conn_multi_open_status_ptr->pdp_type = RPC_LOC_SERVER_PDP_PPP;
|
conn_multi_open_status_ptr->pdp_type = RPC_LOC_SERVER_PDP_PPP;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
conn_multi_open_status_ptr->pdp_type = RPC_LOC_SERVER_PDP_IP;
|
|
||||||
#endif
|
|
||||||
LOC_LOGD("ATL RPC_LOC_IOCTL_INFORM_SERVER_MULTI_OPEN_STATUS open %s, APN name = [%s], pdp_type = %d\n",
|
LOC_LOGD("ATL RPC_LOC_IOCTL_INFORM_SERVER_MULTI_OPEN_STATUS open %s, APN name = [%s], pdp_type = %d\n",
|
||||||
log_succ_fail_string(is_succ),
|
log_succ_fail_string(is_succ),
|
||||||
apn,
|
apn,
|
||||||
|
@ -1081,22 +1069,16 @@ void LocApiRpcAdapter::ATLEvent(const rpc_loc_server_request_s_type *server_requ
|
||||||
agps_type = AGPS_TYPE_SUPL;
|
agps_type = AGPS_TYPE_SUPL;
|
||||||
LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_MULTI_OPEN\n type - AGPS_TYPE_SUPL\n handle - %d", connHandle);
|
LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_MULTI_OPEN\n type - AGPS_TYPE_SUPL\n handle - %d", connHandle);
|
||||||
} else {
|
} else {
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
agps_type = AGPS_TYPE_WWAN_ANY;
|
agps_type = AGPS_TYPE_WWAN_ANY;
|
||||||
LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_MULTI_OPEN\n type - AGPS_TYPE_WWAN_ANY\n handle - %d", connHandle);
|
LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_MULTI_OPEN\n type - AGPS_TYPE_WWAN_ANY\n handle - %d", connHandle);
|
||||||
#else
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
requestATL(connHandle, agps_type);
|
requestATL(connHandle, agps_type);
|
||||||
break;
|
break;
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
case RPC_LOC_SERVER_REQUEST_OPEN:
|
case RPC_LOC_SERVER_REQUEST_OPEN:
|
||||||
connHandle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.open_req.conn_handle;
|
connHandle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.open_req.conn_handle;
|
||||||
LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_OPEN\n handle - %d", connHandle);
|
LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_OPEN\n handle - %d", connHandle);
|
||||||
requestATL(connHandle, AGPS_TYPE_INVALID);
|
requestATL(connHandle, AGPS_TYPE_INVALID);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case RPC_LOC_SERVER_REQUEST_CLOSE:
|
case RPC_LOC_SERVER_REQUEST_CLOSE:
|
||||||
connHandle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.close_req.conn_handle;
|
connHandle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.close_req.conn_handle;
|
||||||
LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_CLOSE\n handle - %d", connHandle);
|
LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_CLOSE\n handle - %d", connHandle);
|
||||||
|
|
|
@ -1421,7 +1421,7 @@ SIDE EFFECTS
|
||||||
===========================================================================*/
|
===========================================================================*/
|
||||||
static void loc_eng_process_deferred_action (void* arg)
|
static void loc_eng_process_deferred_action (void* arg)
|
||||||
{
|
{
|
||||||
AGpsStatus status;
|
AGpsExtStatus status;
|
||||||
status.size = sizeof(status);
|
status.size = sizeof(status);
|
||||||
status.type = AGPS_TYPE_SUPL;
|
status.type = AGPS_TYPE_SUPL;
|
||||||
|
|
||||||
|
|
|
@ -25,10 +25,6 @@ LOCAL_CFLAGS += \
|
||||||
-fno-short-enums \
|
-fno-short-enums \
|
||||||
-D_ANDROID_
|
-D_ANDROID_
|
||||||
|
|
||||||
ifeq ($(FEATURE_IPV6), true)
|
|
||||||
LOCAL_CFLAGS += -DFEATURE_IPV6
|
|
||||||
endif #FEATURE_IPV6
|
|
||||||
|
|
||||||
ifeq ($(FEATURE_DELEXT), true)
|
ifeq ($(FEATURE_DELEXT), true)
|
||||||
LOCAL_CFLAGS += -DFEATURE_DELEXT
|
LOCAL_CFLAGS += -DFEATURE_DELEXT
|
||||||
endif #FEATURE_DELEXT
|
endif #FEATURE_DELEXT
|
||||||
|
@ -40,6 +36,7 @@ LOCAL_COPY_HEADERS_TO:= libloc_eng/
|
||||||
LOCAL_COPY_HEADERS:= \
|
LOCAL_COPY_HEADERS:= \
|
||||||
LocApiAdapter.h \
|
LocApiAdapter.h \
|
||||||
loc.h \
|
loc.h \
|
||||||
|
gps_extended.h \
|
||||||
loc_eng.h \
|
loc_eng.h \
|
||||||
loc_eng_xtra.h \
|
loc_eng_xtra.h \
|
||||||
loc_eng_ni.h \
|
loc_eng_ni.h \
|
||||||
|
@ -85,10 +82,6 @@ LOCAL_CFLAGS += \
|
||||||
-fno-short-enums \
|
-fno-short-enums \
|
||||||
-D_ANDROID_
|
-D_ANDROID_
|
||||||
|
|
||||||
ifeq ($(FEATURE_IPV6), true)
|
|
||||||
LOCAL_CFLAGS += -DFEATURE_IPV6
|
|
||||||
endif #FEATURE_IPV6
|
|
||||||
|
|
||||||
LOCAL_C_INCLUDES:= \
|
LOCAL_C_INCLUDES:= \
|
||||||
$(TARGET_OUT_HEADERS)/gps.utils \
|
$(TARGET_OUT_HEADERS)/gps.utils \
|
||||||
hardware/qcom/gps/loc_api/ulp/inc
|
hardware/qcom/gps/loc_api/ulp/inc
|
||||||
|
@ -121,10 +114,6 @@ LOCAL_CFLAGS += \
|
||||||
-fno-short-enums \
|
-fno-short-enums \
|
||||||
-D_ANDROID_ \
|
-D_ANDROID_ \
|
||||||
|
|
||||||
ifeq ($(FEATURE_IPV6), true)
|
|
||||||
LOCAL_CFLAGS += -DFEATURE_IPV6
|
|
||||||
endif #FEATURE_IPV6
|
|
||||||
|
|
||||||
## Includes
|
## Includes
|
||||||
LOCAL_C_INCLUDES:= \
|
LOCAL_C_INCLUDES:= \
|
||||||
$(TARGET_OUT_HEADERS)/gps.utils \
|
$(TARGET_OUT_HEADERS)/gps.utils \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -132,7 +132,7 @@ public:
|
||||||
void* svExt);
|
void* svExt);
|
||||||
void reportStatus(GpsStatusValue status);
|
void reportStatus(GpsStatusValue status);
|
||||||
void reportNmea(const char* nmea, int length);
|
void reportNmea(const char* nmea, int length);
|
||||||
void reportAgpsStatus(AGpsStatus &agpsStatus);
|
void reportAgpsStatus(AGpsExtStatus &agpsStatus);
|
||||||
void requestXtraData();
|
void requestXtraData();
|
||||||
void requestTime();
|
void requestTime();
|
||||||
void requestLocation();
|
void requestLocation();
|
||||||
|
@ -171,15 +171,9 @@ public:
|
||||||
inline virtual enum loc_api_adapter_err
|
inline virtual enum loc_api_adapter_err
|
||||||
setXtraData(char* data, int length)
|
setXtraData(char* data, int length)
|
||||||
{LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;}
|
{LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;}
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
inline virtual enum loc_api_adapter_err
|
inline virtual enum loc_api_adapter_err
|
||||||
atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType)
|
atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType)
|
||||||
{LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;}
|
{LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;}
|
||||||
#else
|
|
||||||
inline virtual enum loc_api_adapter_err
|
|
||||||
atlOpenStatus(int handle, int is_succ, char* apn, AGpsType agpsType)
|
|
||||||
{LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;}
|
|
||||||
#endif
|
|
||||||
inline virtual enum loc_api_adapter_err
|
inline virtual enum loc_api_adapter_err
|
||||||
atlCloseStatus(int handle, int is_succ)
|
atlCloseStatus(int handle, int is_succ)
|
||||||
{LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;}
|
{LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;}
|
||||||
|
|
94
loc_api/libloc_api_50001/gps_extended.h
Normal file
94
loc_api/libloc_api_50001/gps_extended.h
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
|
||||||
|
*
|
||||||
|
* Not a Contribution.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2010 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef GPS_EXTENDED_H
|
||||||
|
#define GPS_EXTENDED_H
|
||||||
|
|
||||||
|
/** AGPS type */
|
||||||
|
typedef int16_t AGpsExtType;
|
||||||
|
#define AGPS_TYPE_INVALID -1
|
||||||
|
#define AGPS_TYPE_ANY 0
|
||||||
|
#define AGPS_TYPE_SUPL 1
|
||||||
|
#define AGPS_TYPE_C2K 2
|
||||||
|
#define AGPS_TYPE_WWAN_ANY 3
|
||||||
|
#define AGPS_TYPE_WIFI 4
|
||||||
|
|
||||||
|
/** SSID length */
|
||||||
|
#define SSID_BUF_SIZE (32+1)
|
||||||
|
|
||||||
|
typedef int16_t AGpsBearerType;
|
||||||
|
#define AGPS_APN_BEARER_INVALID -1
|
||||||
|
#define AGPS_APN_BEARER_IPV4 0
|
||||||
|
#define AGPS_APN_BEARER_IPV6 1
|
||||||
|
#define AGPS_APN_BEARER_IPV4V6 2
|
||||||
|
|
||||||
|
/** GPS extended callback structure. */
|
||||||
|
typedef struct {
|
||||||
|
/** set to sizeof(GpsCallbacks) */
|
||||||
|
size_t size;
|
||||||
|
gps_set_capabilities set_capabilities_cb;
|
||||||
|
gps_acquire_wakelock acquire_wakelock_cb;
|
||||||
|
gps_release_wakelock release_wakelock_cb;
|
||||||
|
gps_create_thread create_thread_cb;
|
||||||
|
gps_request_utc_time request_utc_time_cb;
|
||||||
|
} GpsExtCallbacks;
|
||||||
|
|
||||||
|
/** Callback structure for the XTRA interface. */
|
||||||
|
typedef struct {
|
||||||
|
gps_xtra_download_request download_request_cb;
|
||||||
|
gps_create_thread create_thread_cb;
|
||||||
|
} GpsXtraExtCallbacks;
|
||||||
|
|
||||||
|
/** Represents the status of AGPS. */
|
||||||
|
typedef struct {
|
||||||
|
/** set to sizeof(AGpsExtStatus) */
|
||||||
|
size_t size;
|
||||||
|
|
||||||
|
AGpsExtType type;
|
||||||
|
AGpsStatusValue status;
|
||||||
|
uint32_t ipv4_addr;
|
||||||
|
char ipv6_addr[16];
|
||||||
|
char ssid[SSID_BUF_SIZE];
|
||||||
|
char password[SSID_BUF_SIZE];
|
||||||
|
} AGpsExtStatus;
|
||||||
|
|
||||||
|
/** Callback with AGPS status information.
|
||||||
|
* Can only be called from a thread created by create_thread_cb.
|
||||||
|
*/
|
||||||
|
typedef void (* agps_status_extended)(AGpsExtStatus* status);
|
||||||
|
|
||||||
|
/** Callback structure for the AGPS interface. */
|
||||||
|
typedef struct {
|
||||||
|
agps_status_extended status_cb;
|
||||||
|
gps_create_thread create_thread_cb;
|
||||||
|
} AGpsExtCallbacks;
|
||||||
|
|
||||||
|
|
||||||
|
/** GPS NI callback structure. */
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Sends the notification request from HAL to GPSLocationProvider.
|
||||||
|
*/
|
||||||
|
gps_ni_notify_callback notify_cb;
|
||||||
|
gps_create_thread create_thread_cb;
|
||||||
|
} GpsNiExtCallbacks;
|
||||||
|
|
||||||
|
#endif /* GPS_EXTENDED_H */
|
||||||
|
|
|
@ -97,50 +97,6 @@ static const GpsInterface sLocEngInterface =
|
||||||
loc_get_extension
|
loc_get_extension
|
||||||
};
|
};
|
||||||
|
|
||||||
// Function declarations for sLocEngAGpsInterface
|
|
||||||
static void loc_agps_init(AGpsCallbacks* callbacks);
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
static int loc_agps_open(AGpsType agpsType,
|
|
||||||
const char* apn, AGpsBearerType bearerType);
|
|
||||||
static int loc_agps_closed(AGpsType agpsType);
|
|
||||||
static int loc_agps_open_failed(AGpsType agpsType);
|
|
||||||
#else
|
|
||||||
static int loc_agps_open(const char* apn);
|
|
||||||
static int loc_agps_closed();
|
|
||||||
static int loc_agps_open_failed();
|
|
||||||
#endif
|
|
||||||
static int loc_agps_set_server(AGpsType type, const char *hostname, int port);
|
|
||||||
|
|
||||||
static const AGpsInterface sLocEngAGpsInterface =
|
|
||||||
{
|
|
||||||
sizeof(AGpsInterface),
|
|
||||||
loc_agps_init,
|
|
||||||
loc_agps_open,
|
|
||||||
loc_agps_closed,
|
|
||||||
loc_agps_open_failed,
|
|
||||||
loc_agps_set_server
|
|
||||||
};
|
|
||||||
|
|
||||||
static int loc_xtra_init(GpsXtraCallbacks* callbacks);
|
|
||||||
static int loc_xtra_inject_data(char* data, int length);
|
|
||||||
|
|
||||||
static const GpsXtraInterface sLocEngXTRAInterface =
|
|
||||||
{
|
|
||||||
sizeof(GpsXtraInterface),
|
|
||||||
loc_xtra_init,
|
|
||||||
loc_xtra_inject_data
|
|
||||||
};
|
|
||||||
|
|
||||||
static void loc_ni_init(GpsNiCallbacks *callbacks);
|
|
||||||
static void loc_ni_respond(int notif_id, GpsUserResponseType user_response);
|
|
||||||
|
|
||||||
const GpsNiInterface sLocEngNiInterface =
|
|
||||||
{
|
|
||||||
sizeof(GpsNiInterface),
|
|
||||||
loc_ni_init,
|
|
||||||
loc_ni_respond,
|
|
||||||
};
|
|
||||||
|
|
||||||
static void loc_agps_ril_init( AGpsRilCallbacks* callbacks );
|
static void loc_agps_ril_init( AGpsRilCallbacks* callbacks );
|
||||||
static void loc_agps_ril_set_ref_location(const AGpsRefLocation *agps_reflocation, size_t sz_struct);
|
static void loc_agps_ril_set_ref_location(const AGpsRefLocation *agps_reflocation, size_t sz_struct);
|
||||||
static void loc_agps_ril_set_set_id(AGpsSetIDType type, const char* setid);
|
static void loc_agps_ril_set_set_id(AGpsSetIDType type, const char* setid);
|
||||||
|
@ -301,12 +257,9 @@ static int loc_init(GpsCallbacks* callbacks)
|
||||||
LOC_API_ADAPTER_EVENT_MASK_T event =
|
LOC_API_ADAPTER_EVENT_MASK_T event =
|
||||||
LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT |
|
LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT |
|
||||||
LOC_API_ADAPTER_BIT_SATELLITE_REPORT |
|
LOC_API_ADAPTER_BIT_SATELLITE_REPORT |
|
||||||
LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST |
|
|
||||||
LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST |
|
|
||||||
LOC_API_ADAPTER_BIT_IOCTL_REPORT |
|
LOC_API_ADAPTER_BIT_IOCTL_REPORT |
|
||||||
LOC_API_ADAPTER_BIT_STATUS_REPORT |
|
LOC_API_ADAPTER_BIT_STATUS_REPORT |
|
||||||
LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT |
|
LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT;
|
||||||
LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST;
|
|
||||||
LocCallbacks clientCallbacks = {loc_cb, /* location_cb */
|
LocCallbacks clientCallbacks = {loc_cb, /* location_cb */
|
||||||
callbacks->status_cb, /* status_cb */
|
callbacks->status_cb, /* status_cb */
|
||||||
sv_cb, /* sv_status_cb */
|
sv_cb, /* sv_status_cb */
|
||||||
|
@ -537,10 +490,8 @@ SIDE EFFECTS
|
||||||
===========================================================================*/
|
===========================================================================*/
|
||||||
static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty)
|
static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty)
|
||||||
{
|
{
|
||||||
ENTRY_LOG();
|
//inject time not handled by AFW
|
||||||
int ret_val = loc_eng_inject_time(loc_afw_data, time, timeReference, uncertainty);
|
return 0;
|
||||||
EXIT_LOG(%d, ret_val);
|
|
||||||
return ret_val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -704,19 +655,16 @@ const void* loc_get_extension(const char* name)
|
||||||
LOC_LOGD("%s:%d] For Interface = %s\n",__func__, __LINE__, name);
|
LOC_LOGD("%s:%d] For Interface = %s\n",__func__, __LINE__, name);
|
||||||
if (strcmp(name, GPS_XTRA_INTERFACE) == 0)
|
if (strcmp(name, GPS_XTRA_INTERFACE) == 0)
|
||||||
{
|
{
|
||||||
ret_val = &sLocEngXTRAInterface;
|
//xtra not handled by AFW
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (strcmp(name, AGPS_INTERFACE) == 0)
|
else if (strcmp(name, AGPS_INTERFACE) == 0)
|
||||||
{
|
{
|
||||||
ret_val = &sLocEngAGpsInterface;
|
//agps not handled by AFW
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (strcmp(name, GPS_NI_INTERFACE) == 0)
|
else if (strcmp(name, GPS_NI_INTERFACE) == 0)
|
||||||
{
|
{
|
||||||
ret_val = &sLocEngNiInterface;
|
//ni not handled by AFW
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (strcmp(name, AGPS_RIL_INTERFACE) == 0)
|
else if (strcmp(name, AGPS_RIL_INTERFACE) == 0)
|
||||||
{
|
{
|
||||||
char baseband[PROPERTY_VALUE_MAX];
|
char baseband[PROPERTY_VALUE_MAX];
|
||||||
|
@ -746,7 +694,6 @@ const void* loc_get_extension(const char* name)
|
||||||
{
|
{
|
||||||
ret_val = get_geofence_interface();
|
ret_val = get_geofence_interface();
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOC_LOGE ("get_extension: Invalid interface passed in\n");
|
LOC_LOGE ("get_extension: Invalid interface passed in\n");
|
||||||
|
@ -755,274 +702,6 @@ const void* loc_get_extension(const char* name)
|
||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===========================================================================
|
|
||||||
FUNCTION loc_agps_init
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
Initialize the AGps interface.
|
|
||||||
|
|
||||||
DEPENDENCIES
|
|
||||||
NONE
|
|
||||||
|
|
||||||
RETURN VALUE
|
|
||||||
0
|
|
||||||
|
|
||||||
SIDE EFFECTS
|
|
||||||
N/A
|
|
||||||
|
|
||||||
===========================================================================*/
|
|
||||||
static void loc_agps_init(AGpsCallbacks* callbacks)
|
|
||||||
{
|
|
||||||
ENTRY_LOG();
|
|
||||||
loc_eng_agps_init(loc_afw_data, callbacks);
|
|
||||||
EXIT_LOG(%s, VOID_RET);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*===========================================================================
|
|
||||||
FUNCTION loc_agps_open
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
This function is called when on-demand data connection opening is successful.
|
|
||||||
It should inform ARM 9 about the data open result.
|
|
||||||
|
|
||||||
DEPENDENCIES
|
|
||||||
NONE
|
|
||||||
|
|
||||||
RETURN VALUE
|
|
||||||
0
|
|
||||||
|
|
||||||
SIDE EFFECTS
|
|
||||||
N/A
|
|
||||||
|
|
||||||
===========================================================================*/
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
static int loc_agps_open(AGpsType agpsType,
|
|
||||||
const char* apn, AGpsBearerType bearerType)
|
|
||||||
{
|
|
||||||
ENTRY_LOG();
|
|
||||||
int ret_val = loc_eng_agps_open(loc_afw_data, agpsType, apn, bearerType);
|
|
||||||
|
|
||||||
EXIT_LOG(%d, ret_val);
|
|
||||||
return ret_val;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static int loc_agps_open(const char* apn)
|
|
||||||
{
|
|
||||||
ENTRY_LOG();
|
|
||||||
int ret_val = loc_eng_agps_open(loc_afw_data, apn);
|
|
||||||
|
|
||||||
EXIT_LOG(%d, ret_val);
|
|
||||||
return ret_val;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*===========================================================================
|
|
||||||
FUNCTION loc_agps_closed
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
This function is called when on-demand data connection closing is done.
|
|
||||||
It should inform ARM 9 about the data close result.
|
|
||||||
|
|
||||||
DEPENDENCIES
|
|
||||||
NONE
|
|
||||||
|
|
||||||
RETURN VALUE
|
|
||||||
0
|
|
||||||
|
|
||||||
SIDE EFFECTS
|
|
||||||
N/A
|
|
||||||
|
|
||||||
===========================================================================*/
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
static int loc_agps_closed(AGpsType agpsType)
|
|
||||||
{
|
|
||||||
ENTRY_LOG();
|
|
||||||
int ret_val = loc_eng_agps_closed(loc_afw_data, agpsType);
|
|
||||||
|
|
||||||
EXIT_LOG(%d, ret_val);
|
|
||||||
return ret_val;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static int loc_agps_closed()
|
|
||||||
{
|
|
||||||
ENTRY_LOG();
|
|
||||||
int ret_val = loc_eng_agps_closed(loc_afw_data);
|
|
||||||
|
|
||||||
EXIT_LOG(%d, ret_val);
|
|
||||||
return ret_val;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*===========================================================================
|
|
||||||
FUNCTION loc_agps_open_failed
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
This function is called when on-demand data connection opening has failed.
|
|
||||||
It should inform ARM 9 about the data open result.
|
|
||||||
|
|
||||||
DEPENDENCIES
|
|
||||||
NONE
|
|
||||||
|
|
||||||
RETURN VALUE
|
|
||||||
0
|
|
||||||
|
|
||||||
SIDE EFFECTS
|
|
||||||
N/A
|
|
||||||
|
|
||||||
===========================================================================*/
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
int loc_agps_open_failed(AGpsType agpsType)
|
|
||||||
{
|
|
||||||
ENTRY_LOG();
|
|
||||||
int ret_val = loc_eng_agps_open_failed(loc_afw_data, agpsType);
|
|
||||||
|
|
||||||
EXIT_LOG(%d, ret_val);
|
|
||||||
return ret_val;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
int loc_agps_open_failed()
|
|
||||||
{
|
|
||||||
ENTRY_LOG();
|
|
||||||
int ret_val = loc_eng_agps_open_failed(loc_afw_data);
|
|
||||||
|
|
||||||
EXIT_LOG(%d, ret_val);
|
|
||||||
return ret_val;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*===========================================================================
|
|
||||||
FUNCTION loc_agps_set_server
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
If loc_eng_set_server is called before loc_eng_init, it doesn't work. This
|
|
||||||
proxy buffers server settings and calls loc_eng_set_server when the client is
|
|
||||||
open.
|
|
||||||
|
|
||||||
DEPENDENCIES
|
|
||||||
NONE
|
|
||||||
|
|
||||||
RETURN VALUE
|
|
||||||
0
|
|
||||||
|
|
||||||
SIDE EFFECTS
|
|
||||||
N/A
|
|
||||||
|
|
||||||
===========================================================================*/
|
|
||||||
static int loc_agps_set_server(AGpsType type, const char* hostname, int port)
|
|
||||||
{
|
|
||||||
ENTRY_LOG();
|
|
||||||
LocServerType serverType;
|
|
||||||
switch (type) {
|
|
||||||
case AGPS_TYPE_SUPL:
|
|
||||||
serverType = LOC_AGPS_SUPL_SERVER;
|
|
||||||
break;
|
|
||||||
case AGPS_TYPE_C2K:
|
|
||||||
serverType = LOC_AGPS_CDMA_PDE_SERVER;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
int ret_val = loc_eng_set_server_proxy(loc_afw_data, serverType, hostname, port);
|
|
||||||
|
|
||||||
EXIT_LOG(%d, ret_val);
|
|
||||||
return ret_val;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*===========================================================================
|
|
||||||
FUNCTION loc_xtra_init
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
Initialize XTRA module.
|
|
||||||
|
|
||||||
DEPENDENCIES
|
|
||||||
None
|
|
||||||
|
|
||||||
RETURN VALUE
|
|
||||||
0: success
|
|
||||||
|
|
||||||
SIDE EFFECTS
|
|
||||||
N/A
|
|
||||||
|
|
||||||
===========================================================================*/
|
|
||||||
static int loc_xtra_init(GpsXtraCallbacks* callbacks)
|
|
||||||
{
|
|
||||||
ENTRY_LOG();
|
|
||||||
int ret_val = loc_eng_xtra_init(loc_afw_data, callbacks);
|
|
||||||
|
|
||||||
EXIT_LOG(%d, ret_val);
|
|
||||||
return ret_val;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*===========================================================================
|
|
||||||
FUNCTION loc_xtra_inject_data
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
Initialize XTRA module.
|
|
||||||
|
|
||||||
DEPENDENCIES
|
|
||||||
None
|
|
||||||
|
|
||||||
RETURN VALUE
|
|
||||||
0: success
|
|
||||||
|
|
||||||
SIDE EFFECTS
|
|
||||||
N/A
|
|
||||||
|
|
||||||
===========================================================================*/
|
|
||||||
static int loc_xtra_inject_data(char* data, int length)
|
|
||||||
{
|
|
||||||
ENTRY_LOG();
|
|
||||||
int ret_val = loc_eng_xtra_inject_data(loc_afw_data, data, length);
|
|
||||||
|
|
||||||
EXIT_LOG(%d, ret_val);
|
|
||||||
return ret_val;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*===========================================================================
|
|
||||||
FUNCTION loc_ni_init
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
This function initializes the NI interface
|
|
||||||
|
|
||||||
DEPENDENCIES
|
|
||||||
NONE
|
|
||||||
|
|
||||||
RETURN VALUE
|
|
||||||
None
|
|
||||||
|
|
||||||
SIDE EFFECTS
|
|
||||||
N/A
|
|
||||||
|
|
||||||
===========================================================================*/
|
|
||||||
void loc_ni_init(GpsNiCallbacks *callbacks)
|
|
||||||
{
|
|
||||||
ENTRY_LOG();
|
|
||||||
loc_eng_ni_init(loc_afw_data, callbacks);
|
|
||||||
EXIT_LOG(%s, VOID_RET);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*===========================================================================
|
|
||||||
FUNCTION loc_ni_respond
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
This function sends an NI respond to the modem processor
|
|
||||||
|
|
||||||
DEPENDENCIES
|
|
||||||
NONE
|
|
||||||
|
|
||||||
RETURN VALUE
|
|
||||||
None
|
|
||||||
|
|
||||||
SIDE EFFECTS
|
|
||||||
N/A
|
|
||||||
|
|
||||||
===========================================================================*/
|
|
||||||
void loc_ni_respond(int notif_id, GpsUserResponseType user_response)
|
|
||||||
{
|
|
||||||
ENTRY_LOG();
|
|
||||||
loc_eng_ni_respond(loc_afw_data, notif_id, user_response);
|
|
||||||
EXIT_LOG(%s, VOID_RET);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Below stub functions are members of sLocEngAGpsRilInterface
|
// Below stub functions are members of sLocEngAGpsRilInterface
|
||||||
static void loc_agps_ril_init( AGpsRilCallbacks* callbacks ) {}
|
static void loc_agps_ril_init( AGpsRilCallbacks* callbacks ) {}
|
||||||
static void loc_agps_ril_set_ref_location(const AGpsRefLocation *agps_reflocation, size_t sz_struct) {}
|
static void loc_agps_ril_set_ref_location(const AGpsRefLocation *agps_reflocation, size_t sz_struct) {}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -38,6 +38,7 @@ extern "C" {
|
||||||
#include <cutils/properties.h>
|
#include <cutils/properties.h>
|
||||||
#include <hardware/gps.h>
|
#include <hardware/gps.h>
|
||||||
#include <loc_ulp.h>
|
#include <loc_ulp.h>
|
||||||
|
#include "gps_extended.h"
|
||||||
|
|
||||||
#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */
|
#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */
|
||||||
|
|
||||||
|
|
|
@ -869,7 +869,7 @@ SIDE EFFECTS
|
||||||
N/A
|
N/A
|
||||||
|
|
||||||
===========================================================================*/
|
===========================================================================*/
|
||||||
void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsCallbacks* callbacks)
|
void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* callbacks)
|
||||||
{
|
{
|
||||||
ENTRY_LOG_CALLFLOW();
|
ENTRY_LOG_CALLFLOW();
|
||||||
INIT_CHECK(loc_eng_data.context, return);
|
INIT_CHECK(loc_eng_data.context, return);
|
||||||
|
@ -886,14 +886,12 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsCallbacks* callbac
|
||||||
loc_eng_data.agnss_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb,
|
loc_eng_data.agnss_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb,
|
||||||
AGPS_TYPE_SUPL,
|
AGPS_TYPE_SUPL,
|
||||||
false);
|
false);
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
loc_eng_data.internet_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb,
|
loc_eng_data.internet_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb,
|
||||||
AGPS_TYPE_WWAN_ANY,
|
AGPS_TYPE_WWAN_ANY,
|
||||||
false);
|
false);
|
||||||
loc_eng_data.wifi_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb,
|
loc_eng_data.wifi_nif = new AgpsStateMachine(loc_eng_data.agps_status_cb,
|
||||||
AGPS_TYPE_WIFI,
|
AGPS_TYPE_WIFI,
|
||||||
true);
|
true);
|
||||||
#endif
|
|
||||||
|
|
||||||
loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb,
|
loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb,
|
||||||
NULL, NULL, &loc_eng_data);
|
NULL, NULL, &loc_eng_data);
|
||||||
|
@ -919,8 +917,7 @@ SIDE EFFECTS
|
||||||
N/A
|
N/A
|
||||||
|
|
||||||
===========================================================================*/
|
===========================================================================*/
|
||||||
#ifdef FEATURE_IPV6
|
int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType,
|
||||||
int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType,
|
|
||||||
const char* apn, AGpsBearerType bearerType)
|
const char* apn, AGpsBearerType bearerType)
|
||||||
{
|
{
|
||||||
ENTRY_LOG_CALLFLOW();
|
ENTRY_LOG_CALLFLOW();
|
||||||
|
@ -945,33 +942,6 @@ int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType,
|
||||||
EXIT_LOG(%d, 0);
|
EXIT_LOG(%d, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data,
|
|
||||||
const char* apn)
|
|
||||||
{
|
|
||||||
ENTRY_LOG_CALLFLOW();
|
|
||||||
INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb,
|
|
||||||
return -1);
|
|
||||||
|
|
||||||
if (apn == NULL)
|
|
||||||
{
|
|
||||||
LOC_LOGE("APN Name NULL\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
LOC_LOGD("loc_eng_agps_open APN name = [%s]", apn);
|
|
||||||
|
|
||||||
int apn_len = smaller_of(strlen (apn), MAX_APN_LEN);
|
|
||||||
loc_eng_msg_atl_open_success *msg(
|
|
||||||
new loc_eng_msg_atl_open_success(&loc_eng_data, apn,
|
|
||||||
apn_len));
|
|
||||||
msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q,
|
|
||||||
msg, loc_eng_free_msg);
|
|
||||||
|
|
||||||
EXIT_LOG(%d, 0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
FUNCTION loc_eng_agps_closed
|
FUNCTION loc_eng_agps_closed
|
||||||
|
@ -990,8 +960,7 @@ SIDE EFFECTS
|
||||||
N/A
|
N/A
|
||||||
|
|
||||||
===========================================================================*/
|
===========================================================================*/
|
||||||
#ifdef FEATURE_IPV6
|
int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType)
|
||||||
int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType)
|
|
||||||
{
|
{
|
||||||
ENTRY_LOG_CALLFLOW();
|
ENTRY_LOG_CALLFLOW();
|
||||||
INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb,
|
INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb,
|
||||||
|
@ -1004,21 +973,6 @@ int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType)
|
||||||
EXIT_LOG(%d, 0);
|
EXIT_LOG(%d, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data)
|
|
||||||
{
|
|
||||||
ENTRY_LOG_CALLFLOW();
|
|
||||||
INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb,
|
|
||||||
return -1);
|
|
||||||
|
|
||||||
loc_eng_msg_atl_closed *msg(new loc_eng_msg_atl_closed(&loc_eng_data));
|
|
||||||
msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q,
|
|
||||||
msg, loc_eng_free_msg);
|
|
||||||
|
|
||||||
EXIT_LOG(%d, 0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
FUNCTION loc_eng_agps_open_failed
|
FUNCTION loc_eng_agps_open_failed
|
||||||
|
@ -1037,8 +991,7 @@ SIDE EFFECTS
|
||||||
N/A
|
N/A
|
||||||
|
|
||||||
===========================================================================*/
|
===========================================================================*/
|
||||||
#ifdef FEATURE_IPV6
|
int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType)
|
||||||
int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType)
|
|
||||||
{
|
{
|
||||||
ENTRY_LOG_CALLFLOW();
|
ENTRY_LOG_CALLFLOW();
|
||||||
INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb,
|
INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb,
|
||||||
|
@ -1051,21 +1004,6 @@ int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsTyp
|
||||||
EXIT_LOG(%d, 0);
|
EXIT_LOG(%d, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data)
|
|
||||||
{
|
|
||||||
ENTRY_LOG_CALLFLOW();
|
|
||||||
INIT_CHECK(loc_eng_data.context && loc_eng_data.agps_status_cb,
|
|
||||||
return -1);
|
|
||||||
|
|
||||||
loc_eng_msg_atl_open_failed *msg(new loc_eng_msg_atl_open_failed(&loc_eng_data));
|
|
||||||
msg_q_snd((void*)((LocEngContext*)(loc_eng_data.context))->deferred_q,
|
|
||||||
msg, loc_eng_free_msg);
|
|
||||||
|
|
||||||
EXIT_LOG(%d, 0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
|
|
||||||
|
@ -1365,9 +1303,7 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data)
|
||||||
|
|
||||||
if (loc_eng_data.agps_status_cb != NULL) {
|
if (loc_eng_data.agps_status_cb != NULL) {
|
||||||
loc_eng_data.agnss_nif->dropAllSubscribers();
|
loc_eng_data.agnss_nif->dropAllSubscribers();
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
loc_eng_data.internet_nif->dropAllSubscribers();
|
loc_eng_data.internet_nif->dropAllSubscribers();
|
||||||
#endif
|
|
||||||
|
|
||||||
loc_eng_agps_reinit(loc_eng_data);
|
loc_eng_agps_reinit(loc_eng_data);
|
||||||
}
|
}
|
||||||
|
@ -1680,10 +1616,8 @@ static void loc_eng_deferred_action_thread(void* arg)
|
||||||
loc_eng_msg_request_bit* brqMsg = (loc_eng_msg_request_bit*)msg;
|
loc_eng_msg_request_bit* brqMsg = (loc_eng_msg_request_bit*)msg;
|
||||||
if (brqMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_SUPL) {
|
if (brqMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_SUPL) {
|
||||||
stateMachine = loc_eng_data_p->agnss_nif;
|
stateMachine = loc_eng_data_p->agnss_nif;
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
} else if (brqMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_ANY) {
|
} else if (brqMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_ANY) {
|
||||||
stateMachine = loc_eng_data_p->internet_nif;
|
stateMachine = loc_eng_data_p->internet_nif;
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
LOC_LOGD("%s]%d: unknown I/F request type = 0x%x\n", __func__, __LINE__, brqMsg->ifType);
|
LOC_LOGD("%s]%d: unknown I/F request type = 0x%x\n", __func__, __LINE__, brqMsg->ifType);
|
||||||
break;
|
break;
|
||||||
|
@ -1700,10 +1634,8 @@ static void loc_eng_deferred_action_thread(void* arg)
|
||||||
loc_eng_msg_release_bit* brlMsg = (loc_eng_msg_release_bit*)msg;
|
loc_eng_msg_release_bit* brlMsg = (loc_eng_msg_release_bit*)msg;
|
||||||
if (brlMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_SUPL) {
|
if (brlMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_SUPL) {
|
||||||
stateMachine = loc_eng_data_p->agnss_nif;
|
stateMachine = loc_eng_data_p->agnss_nif;
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
} else if (brlMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_ANY) {
|
} else if (brlMsg->ifType == LOC_ENG_IF_REQUEST_TYPE_ANY) {
|
||||||
stateMachine = loc_eng_data_p->internet_nif;
|
stateMachine = loc_eng_data_p->internet_nif;
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
LOC_LOGD("%s]%d: unknown I/F request type = 0x%x\n", __func__, __LINE__, brlMsg->ifType);
|
LOC_LOGD("%s]%d: unknown I/F request type = 0x%x\n", __func__, __LINE__, brlMsg->ifType);
|
||||||
break;
|
break;
|
||||||
|
@ -1717,16 +1649,11 @@ static void loc_eng_deferred_action_thread(void* arg)
|
||||||
case LOC_ENG_MSG_REQUEST_ATL:
|
case LOC_ENG_MSG_REQUEST_ATL:
|
||||||
{
|
{
|
||||||
loc_eng_msg_request_atl* arqMsg = (loc_eng_msg_request_atl*)msg;
|
loc_eng_msg_request_atl* arqMsg = (loc_eng_msg_request_atl*)msg;
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
boolean backwardCompatibleMode = AGPS_TYPE_INVALID == arqMsg->type;
|
boolean backwardCompatibleMode = AGPS_TYPE_INVALID == arqMsg->type;
|
||||||
AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == arqMsg->type ||
|
AgpsStateMachine* stateMachine = (AGPS_TYPE_SUPL == arqMsg->type ||
|
||||||
backwardCompatibleMode) ?
|
backwardCompatibleMode) ?
|
||||||
loc_eng_data_p->agnss_nif :
|
loc_eng_data_p->agnss_nif :
|
||||||
loc_eng_data_p->internet_nif;
|
loc_eng_data_p->internet_nif;
|
||||||
#else
|
|
||||||
boolean backwardCompatibleMode = false;
|
|
||||||
AgpsStateMachine* stateMachine = loc_eng_data_p->agnss_nif;
|
|
||||||
#endif
|
|
||||||
ATLSubscriber subscriber(arqMsg->handle,
|
ATLSubscriber subscriber(arqMsg->handle,
|
||||||
stateMachine,
|
stateMachine,
|
||||||
loc_eng_data_p->client_handle,
|
loc_eng_data_p->client_handle,
|
||||||
|
@ -1745,19 +1672,16 @@ static void loc_eng_deferred_action_thread(void* arg)
|
||||||
false);
|
false);
|
||||||
// attempt to unsubscribe from agnss_nif first
|
// attempt to unsubscribe from agnss_nif first
|
||||||
if (! loc_eng_data_p->agnss_nif->unsubscribeRsrc((Subscriber*)&s1)) {
|
if (! loc_eng_data_p->agnss_nif->unsubscribeRsrc((Subscriber*)&s1)) {
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
ATLSubscriber s2(arlMsg->handle,
|
ATLSubscriber s2(arlMsg->handle,
|
||||||
loc_eng_data_p->internet_nif,
|
loc_eng_data_p->internet_nif,
|
||||||
loc_eng_data_p->client_handle,
|
loc_eng_data_p->client_handle,
|
||||||
false);
|
false);
|
||||||
// if unsuccessful, try internet_nif
|
// if unsuccessful, try internet_nif
|
||||||
loc_eng_data_p->internet_nif->unsubscribeRsrc((Subscriber*)&s2);
|
loc_eng_data_p->internet_nif->unsubscribeRsrc((Subscriber*)&s2);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
case LOC_ENG_MSG_REQUEST_WIFI:
|
case LOC_ENG_MSG_REQUEST_WIFI:
|
||||||
{
|
{
|
||||||
loc_eng_msg_request_wifi *wrqMsg = (loc_eng_msg_request_wifi *)msg;
|
loc_eng_msg_request_wifi *wrqMsg = (loc_eng_msg_request_wifi *)msg;
|
||||||
|
@ -1782,7 +1706,6 @@ static void loc_eng_deferred_action_thread(void* arg)
|
||||||
stateMachine->unsubscribeRsrc((Subscriber*)&subscriber);
|
stateMachine->unsubscribeRsrc((Subscriber*)&subscriber);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case LOC_ENG_MSG_REQUEST_XTRA_DATA:
|
case LOC_ENG_MSG_REQUEST_XTRA_DATA:
|
||||||
if (loc_eng_data_p->xtra_module_data.download_request_cb != NULL)
|
if (loc_eng_data_p->xtra_module_data.download_request_cb != NULL)
|
||||||
|
@ -1829,7 +1752,7 @@ static void loc_eng_deferred_action_thread(void* arg)
|
||||||
{
|
{
|
||||||
loc_eng_msg_atl_open_success *aosMsg = (loc_eng_msg_atl_open_success*)msg;
|
loc_eng_msg_atl_open_success *aosMsg = (loc_eng_msg_atl_open_success*)msg;
|
||||||
AgpsStateMachine* stateMachine;
|
AgpsStateMachine* stateMachine;
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
switch (aosMsg->agpsType) {
|
switch (aosMsg->agpsType) {
|
||||||
case AGPS_TYPE_WIFI: {
|
case AGPS_TYPE_WIFI: {
|
||||||
stateMachine = loc_eng_data_p->wifi_nif;
|
stateMachine = loc_eng_data_p->wifi_nif;
|
||||||
|
@ -1845,9 +1768,6 @@ static void loc_eng_deferred_action_thread(void* arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
stateMachine->setBearer(aosMsg->bearerType);
|
stateMachine->setBearer(aosMsg->bearerType);
|
||||||
#else
|
|
||||||
stateMachine = loc_eng_data_p->agnss_nif;
|
|
||||||
#endif
|
|
||||||
stateMachine->setAPN(aosMsg->apn, aosMsg->length);
|
stateMachine->setAPN(aosMsg->apn, aosMsg->length);
|
||||||
stateMachine->onRsrcEvent(RSRC_GRANTED);
|
stateMachine->onRsrcEvent(RSRC_GRANTED);
|
||||||
}
|
}
|
||||||
|
@ -1857,7 +1777,7 @@ static void loc_eng_deferred_action_thread(void* arg)
|
||||||
{
|
{
|
||||||
loc_eng_msg_atl_closed *acsMsg = (loc_eng_msg_atl_closed*)msg;
|
loc_eng_msg_atl_closed *acsMsg = (loc_eng_msg_atl_closed*)msg;
|
||||||
AgpsStateMachine* stateMachine;
|
AgpsStateMachine* stateMachine;
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
switch (acsMsg->agpsType) {
|
switch (acsMsg->agpsType) {
|
||||||
case AGPS_TYPE_WIFI: {
|
case AGPS_TYPE_WIFI: {
|
||||||
stateMachine = loc_eng_data_p->wifi_nif;
|
stateMachine = loc_eng_data_p->wifi_nif;
|
||||||
|
@ -1871,9 +1791,6 @@ static void loc_eng_deferred_action_thread(void* arg)
|
||||||
stateMachine = loc_eng_data_p->internet_nif;
|
stateMachine = loc_eng_data_p->internet_nif;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
stateMachine = loc_eng_data_p->agnss_nif;
|
|
||||||
#endif
|
|
||||||
stateMachine->onRsrcEvent(RSRC_RELEASED);
|
stateMachine->onRsrcEvent(RSRC_RELEASED);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1882,7 +1799,7 @@ static void loc_eng_deferred_action_thread(void* arg)
|
||||||
{
|
{
|
||||||
loc_eng_msg_atl_open_failed *aofMsg = (loc_eng_msg_atl_open_failed*)msg;
|
loc_eng_msg_atl_open_failed *aofMsg = (loc_eng_msg_atl_open_failed*)msg;
|
||||||
AgpsStateMachine* stateMachine;
|
AgpsStateMachine* stateMachine;
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
switch (aofMsg->agpsType) {
|
switch (aofMsg->agpsType) {
|
||||||
case AGPS_TYPE_WIFI: {
|
case AGPS_TYPE_WIFI: {
|
||||||
stateMachine = loc_eng_data_p->wifi_nif;
|
stateMachine = loc_eng_data_p->wifi_nif;
|
||||||
|
@ -1896,9 +1813,6 @@ static void loc_eng_deferred_action_thread(void* arg)
|
||||||
stateMachine = loc_eng_data_p->internet_nif;
|
stateMachine = loc_eng_data_p->internet_nif;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
stateMachine = loc_eng_data_p->agnss_nif;
|
|
||||||
#endif
|
|
||||||
stateMachine->onRsrcEvent(RSRC_DENIED);
|
stateMachine->onRsrcEvent(RSRC_DENIED);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -101,7 +101,7 @@ typedef struct
|
||||||
loc_location_cb_ext location_cb;
|
loc_location_cb_ext location_cb;
|
||||||
gps_status_callback status_cb;
|
gps_status_callback status_cb;
|
||||||
loc_sv_status_cb_ext sv_status_cb;
|
loc_sv_status_cb_ext sv_status_cb;
|
||||||
agps_status_callback agps_status_cb;
|
agps_status_extended agps_status_cb;
|
||||||
gps_nmea_callback nmea_cb;
|
gps_nmea_callback nmea_cb;
|
||||||
gps_ni_notify_callback ni_notify_cb;
|
gps_ni_notify_callback ni_notify_cb;
|
||||||
gps_acquire_wakelock acquire_wakelock_cb;
|
gps_acquire_wakelock acquire_wakelock_cb;
|
||||||
|
@ -224,17 +224,11 @@ int loc_eng_update_criteria(loc_eng_data_s_type &loc_eng_data,
|
||||||
UlpLocationCriteria criteria);
|
UlpLocationCriteria criteria);
|
||||||
|
|
||||||
void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data,
|
void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data,
|
||||||
AGpsCallbacks* callbacks);
|
AGpsExtCallbacks* callbacks);
|
||||||
#ifdef FEATURE_IPV6
|
int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType,
|
||||||
int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType,
|
|
||||||
const char* apn, AGpsBearerType bearerType);
|
const char* apn, AGpsBearerType bearerType);
|
||||||
int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType);
|
int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType);
|
||||||
int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsType agpsType);
|
int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType);
|
||||||
#else
|
|
||||||
int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, const char* apn);
|
|
||||||
int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data);
|
|
||||||
int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data,
|
int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data,
|
||||||
LocServerType type, const char *hostname, int port);
|
LocServerType type, const char *hostname, int port);
|
||||||
|
@ -251,13 +245,13 @@ bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data,
|
||||||
void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data);
|
void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data);
|
||||||
|
|
||||||
int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data,
|
int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data,
|
||||||
GpsXtraCallbacks* callbacks);
|
GpsXtraExtCallbacks* callbacks);
|
||||||
|
|
||||||
int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data,
|
int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data,
|
||||||
char* data, int length);
|
char* data, int length);
|
||||||
|
|
||||||
extern void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data,
|
extern void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data,
|
||||||
GpsNiCallbacks *callbacks);
|
GpsNiExtCallbacks *callbacks);
|
||||||
extern void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data,
|
extern void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data,
|
||||||
int notif_id, GpsUserResponseType user_response);
|
int notif_id, GpsUserResponseType user_response);
|
||||||
extern void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data,
|
extern void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -154,36 +154,22 @@ bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification)
|
||||||
break;
|
break;
|
||||||
case RSRC_DENIED:
|
case RSRC_DENIED:
|
||||||
{
|
{
|
||||||
#ifdef FEATURE_IPV6
|
AGpsExtType type = mBackwardCompatibleMode ?
|
||||||
AGpsType type = mBackwardCompatibleMode ?
|
|
||||||
AGPS_TYPE_INVALID : mStateMachine->getType();
|
AGPS_TYPE_INVALID : mStateMachine->getType();
|
||||||
((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 0,
|
((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 0,
|
||||||
(char*)mStateMachine->getAPN(),
|
(char*)mStateMachine->getAPN(),
|
||||||
mStateMachine->getBearer(),
|
mStateMachine->getBearer(),
|
||||||
type);
|
type);
|
||||||
#else
|
|
||||||
AGpsType type = mStateMachine->getType();
|
|
||||||
((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 0,
|
|
||||||
(char*)mStateMachine->getAPN(),
|
|
||||||
type);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RSRC_GRANTED:
|
case RSRC_GRANTED:
|
||||||
{
|
{
|
||||||
#ifdef FEATURE_IPV6
|
AGpsExtType type = mBackwardCompatibleMode ?
|
||||||
AGpsType type = mBackwardCompatibleMode ?
|
|
||||||
AGPS_TYPE_INVALID : mStateMachine->getType();
|
AGPS_TYPE_INVALID : mStateMachine->getType();
|
||||||
((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1,
|
((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1,
|
||||||
(char*)mStateMachine->getAPN(),
|
(char*)mStateMachine->getAPN(),
|
||||||
mStateMachine->getBearer(),
|
mStateMachine->getBearer(),
|
||||||
type);
|
type);
|
||||||
#else
|
|
||||||
AGpsType type = mStateMachine->getType();
|
|
||||||
((LocApiAdapter*)mLocAdapter)->atlOpenStatus(ID, 1,
|
|
||||||
(char*)mStateMachine->getAPN(),
|
|
||||||
type);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -194,7 +180,6 @@ bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification)
|
||||||
return notify;
|
return notify;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
bool WIFISubscriber::notifyRsrcStatus(Notification ¬ification)
|
bool WIFISubscriber::notifyRsrcStatus(Notification ¬ification)
|
||||||
{
|
{
|
||||||
bool notify = forMe(notification);
|
bool notify = forMe(notification);
|
||||||
|
@ -226,7 +211,6 @@ bool WIFISubscriber::notifyRsrcStatus(Notification ¬ification)
|
||||||
|
|
||||||
return notify;
|
return notify;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
// AgpsState: AgpsReleasedState / AgpsPendingState / AgpsAcquiredState
|
// AgpsState: AgpsReleasedState / AgpsPendingState / AgpsAcquiredState
|
||||||
|
@ -567,8 +551,8 @@ AgpsState* AgpsReleasingState::onRsrcEvent(AgpsRsrcStatus event, void* data)
|
||||||
// AgpsStateMachine
|
// AgpsStateMachine
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
AgpsStateMachine::AgpsStateMachine(void (*servicer)(AGpsStatus* status),
|
AgpsStateMachine::AgpsStateMachine(void (*servicer)(AGpsExtStatus* status),
|
||||||
AGpsType type,
|
AGpsExtType type,
|
||||||
bool enforceSingleSubscriber) :
|
bool enforceSingleSubscriber) :
|
||||||
mServicer(servicer), mType(type),
|
mServicer(servicer), mType(type),
|
||||||
mStatePtr(new AgpsReleasedState(this)),
|
mStatePtr(new AgpsReleasedState(this)),
|
||||||
|
@ -698,12 +682,11 @@ void AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const
|
||||||
(void*)¬ification, false);
|
(void*)¬ification, false);
|
||||||
|
|
||||||
if ((NULL == s) == (GPS_RELEASE_AGPS_DATA_CONN == action)) {
|
if ((NULL == s) == (GPS_RELEASE_AGPS_DATA_CONN == action)) {
|
||||||
AGpsStatus nifRequest;
|
AGpsExtStatus nifRequest;
|
||||||
nifRequest.size = sizeof(nifRequest);
|
nifRequest.size = sizeof(nifRequest);
|
||||||
nifRequest.type = mType;
|
nifRequest.type = mType;
|
||||||
nifRequest.status = action;
|
nifRequest.status = action;
|
||||||
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
if (s == NULL) {
|
if (s == NULL) {
|
||||||
nifRequest.ipv4_addr = INADDR_NONE;
|
nifRequest.ipv4_addr = INADDR_NONE;
|
||||||
nifRequest.ipv6_addr[0] = 0;
|
nifRequest.ipv6_addr[0] = 0;
|
||||||
|
@ -713,13 +696,6 @@ void AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const
|
||||||
s->setIPAddresses(nifRequest.ipv4_addr, (char*)nifRequest.ipv6_addr);
|
s->setIPAddresses(nifRequest.ipv4_addr, (char*)nifRequest.ipv6_addr);
|
||||||
s->setWifiInfo(nifRequest.ssid, nifRequest.password);
|
s->setWifiInfo(nifRequest.ssid, nifRequest.password);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if (s == NULL) {
|
|
||||||
nifRequest.ipaddr = INADDR_NONE;
|
|
||||||
} else {
|
|
||||||
nifRequest.ipaddr = s->ID;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
CALLBACK_LOG_CALLFLOW("agps_cb", %s, loc_get_agps_status_name(action));
|
CALLBACK_LOG_CALLFLOW("agps_cb", %s, loc_get_agps_status_name(action));
|
||||||
(*mServicer)(&nifRequest);
|
(*mServicer)(&nifRequest);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -137,9 +137,9 @@ class AgpsStateMachine {
|
||||||
friend class AgpsState;
|
friend class AgpsState;
|
||||||
|
|
||||||
// handle to whoever provides the service
|
// handle to whoever provides the service
|
||||||
void (* const mServicer)(AGpsStatus* status);
|
void (* const mServicer)(AGpsExtStatus* status);
|
||||||
// NIF type: AGNSS or INTERNET.
|
// NIF type: AGNSS or INTERNET.
|
||||||
const AGpsType mType;
|
const AGpsExtType mType;
|
||||||
// pointer to the current state.
|
// pointer to the current state.
|
||||||
AgpsState* mStatePtr;
|
AgpsState* mStatePtr;
|
||||||
// a linked list of subscribers.
|
// a linked list of subscribers.
|
||||||
|
@ -150,25 +150,21 @@ class AgpsStateMachine {
|
||||||
char* mAPN;
|
char* mAPN;
|
||||||
// for convenience, we don't do strlen each time.
|
// for convenience, we don't do strlen each time.
|
||||||
unsigned int mAPNLen;
|
unsigned int mAPNLen;
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
// bear
|
// bear
|
||||||
AGpsBearerType mBearer;
|
AGpsBearerType mBearer;
|
||||||
#endif
|
|
||||||
// ipv4 address for routing
|
// ipv4 address for routing
|
||||||
bool mEnforceSingleSubscriber;
|
bool mEnforceSingleSubscriber;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AgpsStateMachine(void (*servicer)(AGpsStatus* status), AGpsType type, bool enforceSingleSubscriber);
|
AgpsStateMachine(void (*servicer)(AGpsExtStatus* status), AGpsExtType type, bool enforceSingleSubscriber);
|
||||||
virtual ~AgpsStateMachine();
|
virtual ~AgpsStateMachine();
|
||||||
|
|
||||||
// self explanatory methods below
|
// self explanatory methods below
|
||||||
void setAPN(const char* apn, unsigned int len);
|
void setAPN(const char* apn, unsigned int len);
|
||||||
inline const char* getAPN() const { return (const char*)mAPN; }
|
inline const char* getAPN() const { return (const char*)mAPN; }
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; }
|
inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; }
|
||||||
inline AGpsBearerType getBearer() const { return mBearer; }
|
inline AGpsBearerType getBearer() const { return mBearer; }
|
||||||
#endif
|
inline AGpsExtType getType() const { return (AGpsExtType)mType; }
|
||||||
inline AGpsType getType() const { return (AGpsType)mType; }
|
|
||||||
|
|
||||||
// someone, a ATL client or BIT, is asking for NIF
|
// someone, a ATL client or BIT, is asking for NIF
|
||||||
void subscribeRsrc(Subscriber *subscriber);
|
void subscribeRsrc(Subscriber *subscriber);
|
||||||
|
@ -279,7 +275,6 @@ struct ATLSubscriber : public Subscriber {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
// WIFISubscriber, created with requests from MSAPM or QuIPC
|
// WIFISubscriber, created with requests from MSAPM or QuIPC
|
||||||
struct WIFISubscriber : public Subscriber {
|
struct WIFISubscriber : public Subscriber {
|
||||||
char * mSSID;
|
char * mSSID;
|
||||||
|
@ -326,6 +321,5 @@ struct WIFISubscriber : public Subscriber {
|
||||||
return new WIFISubscriber(mStateMachine, mSSID, mPassword, senderId);
|
return new WIFISubscriber(mStateMachine, mSSID, mPassword, senderId);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif //__LOC_ENG_AGPS_H__
|
#endif //__LOC_ENG_AGPS_H__
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -189,15 +189,11 @@ const char* loc_get_aiding_data_mask_names(GpsAidingData data)
|
||||||
|
|
||||||
static loc_name_val_s_type loc_eng_agps_types[] =
|
static loc_name_val_s_type loc_eng_agps_types[] =
|
||||||
{
|
{
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
NAME_VAL( AGPS_TYPE_INVALID ),
|
NAME_VAL( AGPS_TYPE_INVALID ),
|
||||||
NAME_VAL( AGPS_TYPE_ANY ),
|
NAME_VAL( AGPS_TYPE_ANY ),
|
||||||
#endif
|
|
||||||
NAME_VAL( AGPS_TYPE_SUPL ),
|
NAME_VAL( AGPS_TYPE_SUPL ),
|
||||||
NAME_VAL( AGPS_TYPE_C2K )
|
NAME_VAL( AGPS_TYPE_C2K ),
|
||||||
#ifdef FEATURE_IPV6
|
NAME_VAL( AGPS_TYPE_WWAN_ANY )
|
||||||
,NAME_VAL( AGPS_TYPE_WWAN_ANY )
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
static int loc_eng_agps_type_num = sizeof(loc_eng_agps_types) / sizeof(loc_name_val_s_type);
|
static int loc_eng_agps_type_num = sizeof(loc_eng_agps_types) / sizeof(loc_name_val_s_type);
|
||||||
|
|
||||||
|
@ -250,7 +246,6 @@ const char* loc_get_ni_encoding_name(GpsNiEncodingType encoding)
|
||||||
return loc_get_name_from_val(loc_eng_ni_encodings, loc_eng_ni_encoding_num, (long) encoding);
|
return loc_get_name_from_val(loc_eng_ni_encodings, loc_eng_ni_encoding_num, (long) encoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
static loc_name_val_s_type loc_eng_agps_bears[] =
|
static loc_name_val_s_type loc_eng_agps_bears[] =
|
||||||
{
|
{
|
||||||
NAME_VAL( AGPS_APN_BEARER_INVALID ),
|
NAME_VAL( AGPS_APN_BEARER_INVALID ),
|
||||||
|
@ -264,7 +259,6 @@ const char* loc_get_agps_bear_name(AGpsBearerType bearer)
|
||||||
{
|
{
|
||||||
return loc_get_name_from_val(loc_eng_agps_bears, loc_eng_agps_bears_num, (long) bearer);
|
return loc_get_name_from_val(loc_eng_agps_bears, loc_eng_agps_bears_num, (long) bearer);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static loc_name_val_s_type loc_eng_server_types[] =
|
static loc_name_val_s_type loc_eng_server_types[] =
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -48,9 +48,7 @@ const char* loc_get_agps_type_name(AGpsType type);
|
||||||
const char* loc_get_ni_type_name(GpsNiType type);
|
const char* loc_get_ni_type_name(GpsNiType type);
|
||||||
const char* loc_get_ni_response_name(GpsUserResponseType response);
|
const char* loc_get_ni_response_name(GpsUserResponseType response);
|
||||||
const char* loc_get_ni_encoding_name(GpsNiEncodingType encoding);
|
const char* loc_get_ni_encoding_name(GpsNiEncodingType encoding);
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
const char* loc_get_agps_bear_name(AGpsBearerType bear);
|
const char* loc_get_agps_bear_name(AGpsBearerType bear);
|
||||||
#endif
|
|
||||||
const char* loc_get_server_type_name(LocServerType type);
|
const char* loc_get_server_type_name(LocServerType type);
|
||||||
const char* loc_get_position_sess_status_name(enum loc_sess_status status);
|
const char* loc_get_position_sess_status_name(enum loc_sess_status status);
|
||||||
const char* loc_get_agps_status_name(AGpsStatusValue status);
|
const char* loc_get_agps_status_name(AGpsStatusValue status);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -39,10 +39,6 @@
|
||||||
#include <loc_eng_log.h>
|
#include <loc_eng_log.h>
|
||||||
#include "loc_eng_msg_id.h"
|
#include "loc_eng_msg_id.h"
|
||||||
|
|
||||||
#ifndef SSID_BUF_SIZE
|
|
||||||
#define SSID_BUF_SIZE (32+1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
@ -720,7 +716,6 @@ struct loc_eng_msg_inject_xtra_data : public loc_eng_msg {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
struct loc_eng_msg_atl_open_success : public loc_eng_msg {
|
struct loc_eng_msg_atl_open_success : public loc_eng_msg {
|
||||||
const AGpsStatusValue agpsType;
|
const AGpsStatusValue agpsType;
|
||||||
const int length;
|
const int length;
|
||||||
|
@ -747,30 +742,8 @@ struct loc_eng_msg_atl_open_success : public loc_eng_msg {
|
||||||
delete[] apn;
|
delete[] apn;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#else
|
|
||||||
struct loc_eng_msg_atl_open_success : public loc_eng_msg {
|
|
||||||
const int length;
|
|
||||||
char* const apn;
|
|
||||||
inline loc_eng_msg_atl_open_success(void* instance,
|
|
||||||
const char* name,
|
|
||||||
int len) :
|
|
||||||
loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_SUCCESS),
|
|
||||||
length(len),
|
|
||||||
apn(new char[len+1])
|
|
||||||
{
|
|
||||||
memcpy((void*)apn, (void*)name, len);
|
|
||||||
apn[len] = 0;
|
|
||||||
LOC_LOGV("apn: %s\n",
|
|
||||||
apn);
|
|
||||||
}
|
|
||||||
inline ~loc_eng_msg_atl_open_success()
|
|
||||||
{
|
|
||||||
delete[] apn;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
struct loc_eng_msg_atl_open_failed : public loc_eng_msg {
|
struct loc_eng_msg_atl_open_failed : public loc_eng_msg {
|
||||||
const AGpsStatusValue agpsType;
|
const AGpsStatusValue agpsType;
|
||||||
inline loc_eng_msg_atl_open_failed(void* instance,
|
inline loc_eng_msg_atl_open_failed(void* instance,
|
||||||
|
@ -782,17 +755,8 @@ struct loc_eng_msg_atl_open_failed : public loc_eng_msg {
|
||||||
loc_get_agps_type_name(agpsType));
|
loc_get_agps_type_name(agpsType));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#else
|
|
||||||
struct loc_eng_msg_atl_open_failed : public loc_eng_msg {
|
|
||||||
inline loc_eng_msg_atl_open_failed(void* instance) :
|
|
||||||
loc_eng_msg(instance, LOC_ENG_MSG_ATL_OPEN_FAILED)
|
|
||||||
{
|
|
||||||
LOC_LOGV("");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
struct loc_eng_msg_atl_closed : public loc_eng_msg {
|
struct loc_eng_msg_atl_closed : public loc_eng_msg {
|
||||||
const AGpsStatusValue agpsType;
|
const AGpsStatusValue agpsType;
|
||||||
inline loc_eng_msg_atl_closed(void* instance,
|
inline loc_eng_msg_atl_closed(void* instance,
|
||||||
|
@ -804,15 +768,6 @@ struct loc_eng_msg_atl_closed : public loc_eng_msg {
|
||||||
loc_get_agps_type_name(agpsType));
|
loc_get_agps_type_name(agpsType));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#else
|
|
||||||
struct loc_eng_msg_atl_closed : public loc_eng_msg {
|
|
||||||
inline loc_eng_msg_atl_closed(void* instance) :
|
|
||||||
loc_eng_msg(instance, LOC_ENG_MSG_ATL_CLOSED)
|
|
||||||
{
|
|
||||||
LOC_LOGV("");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct loc_eng_msg_set_data_enable : public loc_eng_msg {
|
struct loc_eng_msg_set_data_enable : public loc_eng_msg {
|
||||||
const int enable;
|
const int enable;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -245,7 +245,7 @@ SIDE EFFECTS
|
||||||
N/A
|
N/A
|
||||||
|
|
||||||
===========================================================================*/
|
===========================================================================*/
|
||||||
void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, GpsNiCallbacks *callbacks)
|
void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, GpsNiExtCallbacks *callbacks)
|
||||||
{
|
{
|
||||||
ENTRY_LOG_CALLFLOW();
|
ENTRY_LOG_CALLFLOW();
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -52,7 +52,7 @@ SIDE EFFECTS
|
||||||
|
|
||||||
===========================================================================*/
|
===========================================================================*/
|
||||||
int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data,
|
int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data,
|
||||||
GpsXtraCallbacks* callbacks)
|
GpsXtraExtCallbacks* callbacks)
|
||||||
{
|
{
|
||||||
int ret_val = -1;
|
int ret_val = -1;
|
||||||
loc_eng_xtra_data_s_type *xtra_module_data_ptr;
|
loc_eng_xtra_data_s_type *xtra_module_data_ptr;
|
||||||
|
|
|
@ -28,10 +28,6 @@ LOCAL_CFLAGS += \
|
||||||
-fno-short-enums \
|
-fno-short-enums \
|
||||||
-D_ANDROID_
|
-D_ANDROID_
|
||||||
|
|
||||||
ifeq ($(FEATURE_IPV6), true)
|
|
||||||
LOCAL_CFLAGS += -DFEATURE_IPV6
|
|
||||||
endif #FEATURE_IPV6
|
|
||||||
|
|
||||||
ifeq ($(FEATURE_DELEXT), true)
|
ifeq ($(FEATURE_DELEXT), true)
|
||||||
LOCAL_CFLAGS += -DFEATURE_DELEXT
|
LOCAL_CFLAGS += -DFEATURE_DELEXT
|
||||||
endif #FEATURE_DELEXT
|
endif #FEATURE_DELEXT
|
||||||
|
|
|
@ -1022,30 +1022,19 @@ enum loc_api_adapter_err LocApiV02Adapter :: setXtraData(
|
||||||
return LOC_API_ADAPTER_ERR_SUCCESS;
|
return LOC_API_ADAPTER_ERR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus(
|
enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus(
|
||||||
int handle, int is_succ, char* apn, AGpsBearerType bear,
|
int handle, int is_succ, char* apn, AGpsBearerType bear,
|
||||||
AGpsType agpsType)
|
AGpsType agpsType)
|
||||||
#else
|
|
||||||
enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus(
|
|
||||||
int handle, int is_succ, char* apn,
|
|
||||||
AGpsType agpsType)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
locClientStatusEnumType result = eLOC_CLIENT_SUCCESS;
|
locClientStatusEnumType result = eLOC_CLIENT_SUCCESS;
|
||||||
locClientReqUnionType req_union;
|
locClientReqUnionType req_union;
|
||||||
qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req;
|
qmiLocInformLocationServerConnStatusReqMsgT_v02 conn_status_req;
|
||||||
qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind;
|
qmiLocInformLocationServerConnStatusIndMsgT_v02 conn_status_ind;
|
||||||
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, "
|
LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, "
|
||||||
"APN = [%s], bearer = %d \n", __func__, __LINE__,
|
"APN = [%s], bearer = %d \n", __func__, __LINE__,
|
||||||
handle, is_succ, apn, bear);
|
handle, is_succ, apn, bear);
|
||||||
#else
|
|
||||||
LOC_LOGD("%s:%d]: ATL open handle = %d, is_succ = %d, "
|
|
||||||
"APN = [%s] \n", __func__, __LINE__,
|
|
||||||
handle, is_succ, apn);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
memset(&conn_status_req, 0, sizeof(conn_status_req));
|
memset(&conn_status_req, 0, sizeof(conn_status_req));
|
||||||
memset(&conn_status_ind, 0, sizeof(conn_status_ind));
|
memset(&conn_status_ind, 0, sizeof(conn_status_ind));
|
||||||
|
@ -1062,7 +1051,6 @@ enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus(
|
||||||
strlcpy(conn_status_req.apnProfile.apnName, apn,
|
strlcpy(conn_status_req.apnProfile.apnName, apn,
|
||||||
sizeof(conn_status_req.apnProfile.apnName) );
|
sizeof(conn_status_req.apnProfile.apnName) );
|
||||||
|
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
switch(bear)
|
switch(bear)
|
||||||
{
|
{
|
||||||
case AGPS_APN_BEARER_IPV4:
|
case AGPS_APN_BEARER_IPV4:
|
||||||
|
@ -1084,10 +1072,6 @@ enum loc_api_adapter_err LocApiV02Adapter :: atlOpenStatus(
|
||||||
LOC_LOGE("%s:%d]:invalid bearer type\n",__func__,__LINE__);
|
LOC_LOGE("%s:%d]:invalid bearer type\n",__func__,__LINE__);
|
||||||
return LOC_API_ADAPTER_ERR_INVALID_HANDLE;
|
return LOC_API_ADAPTER_ERR_INVALID_HANDLE;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
conn_status_req.apnProfile.pdnType =
|
|
||||||
eQMI_LOC_APN_PROFILE_PDN_TYPE_IPV4_V02;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
conn_status_req.apnProfile_valid = 1;
|
conn_status_req.apnProfile_valid = 1;
|
||||||
}
|
}
|
||||||
|
@ -1915,7 +1899,7 @@ void LocApiV02Adapter :: reportAtlRequest(
|
||||||
if(server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_OPEN_V02 )
|
if(server_request_ptr->requestType == eQMI_LOC_SERVER_REQUEST_OPEN_V02 )
|
||||||
{
|
{
|
||||||
AGpsType agpsType;
|
AGpsType agpsType;
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
switch(server_request_ptr->wwanType)
|
switch(server_request_ptr->wwanType)
|
||||||
{
|
{
|
||||||
case eQMI_LOC_WWAN_TYPE_INTERNET_V02:
|
case eQMI_LOC_WWAN_TYPE_INTERNET_V02:
|
||||||
|
@ -1930,9 +1914,7 @@ void LocApiV02Adapter :: reportAtlRequest(
|
||||||
agpsType = AGPS_TYPE_WWAN_ANY;
|
agpsType = AGPS_TYPE_WWAN_ANY;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
agpsType = AGPS_TYPE_SUPL;
|
|
||||||
#endif
|
|
||||||
LocApiAdapter::requestATL(connHandle, agpsType);
|
LocApiAdapter::requestATL(connHandle, agpsType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -138,15 +138,9 @@ public:
|
||||||
setServer(unsigned int ip, int port, LocServerType type);
|
setServer(unsigned int ip, int port, LocServerType type);
|
||||||
virtual enum loc_api_adapter_err
|
virtual enum loc_api_adapter_err
|
||||||
setXtraData(char* data, int length);
|
setXtraData(char* data, int length);
|
||||||
#ifdef FEATURE_IPV6
|
|
||||||
virtual enum loc_api_adapter_err
|
virtual enum loc_api_adapter_err
|
||||||
atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear,
|
atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear,
|
||||||
AGpsType agpsType);
|
AGpsType agpsType);
|
||||||
#else
|
|
||||||
virtual enum loc_api_adapter_err
|
|
||||||
atlOpenStatus(int handle, int is_succ, char* apn,
|
|
||||||
AGpsType agpsType);
|
|
||||||
#endif
|
|
||||||
virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ);
|
virtual enum loc_api_adapter_err atlCloseStatus(int handle, int is_succ);
|
||||||
virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version);
|
virtual enum loc_api_adapter_err setSUPLVersion(uint32_t version);
|
||||||
virtual enum loc_api_adapter_err setLPPConfig(uint32_t profile);
|
virtual enum loc_api_adapter_err setLPPConfig(uint32_t profile);
|
||||||
|
|
Loading…
Reference in a new issue