@ -1,4 +1,4 @@
/* Copyright (c) 2011-201 4 , The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-201 5 , The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
@ -49,7 +49,7 @@ void LocPosMode::logv() const
}
/* GPS status names */
static loc_name_val_s_type gps_status_name [ ] =
static const loc_name_val_s_type gps_status_name [ ] =
{
NAME_VAL ( GPS_STATUS_NONE ) ,
NAME_VAL ( GPS_STATUS_SESSION_BEGIN ) ,
@ -57,7 +57,7 @@ static loc_name_val_s_type gps_status_name[] =
NAME_VAL ( GPS_STATUS_ENGINE_ON ) ,
NAME_VAL ( GPS_STATUS_ENGINE_OFF ) ,
} ;
static int gps_status_num = sizeof ( gps_status_name ) / sizeof ( loc_name_val_s_type ) ;
static const int gps_status_num = sizeof ( gps_status_name ) / sizeof ( loc_name_val_s_type ) ;
/* Find Android GPS status name */
const char * loc_get_gps_status_name ( GpsStatusValue gps_status )
@ -68,7 +68,7 @@ const char* loc_get_gps_status_name(GpsStatusValue gps_status)
static loc_name_val_s_type loc_eng_position_modes [ ] =
static const loc_name_val_s_type loc_eng_position_modes [ ] =
{
NAME_VAL ( LOC_POSITION_MODE_STANDALONE ) ,
NAME_VAL ( LOC_POSITION_MODE_MS_BASED ) ,
@ -79,7 +79,7 @@ static loc_name_val_s_type loc_eng_position_modes[] =
NAME_VAL ( LOC_POSITION_MODE_RESERVED_4 ) ,
NAME_VAL ( LOC_POSITION_MODE_RESERVED_5 )
} ;
static int loc_eng_position_mode_num = sizeof ( loc_eng_position_modes ) / sizeof ( loc_name_val_s_type ) ;
static const int loc_eng_position_mode_num = sizeof ( loc_eng_position_modes ) / sizeof ( loc_name_val_s_type ) ;
const char * loc_get_position_mode_name ( GpsPositionMode mode )
{
@ -88,12 +88,12 @@ const char* loc_get_position_mode_name(GpsPositionMode mode)
static loc_name_val_s_type loc_eng_position_recurrences [ ] =
static const loc_name_val_s_type loc_eng_position_recurrences [ ] =
{
NAME_VAL ( GPS_POSITION_RECURRENCE_PERIODIC ) ,
NAME_VAL ( GPS_POSITION_RECURRENCE_SINGLE )
} ;
static int loc_eng_position_recurrence_num = sizeof ( loc_eng_position_recurrences ) / sizeof ( loc_name_val_s_type ) ;
static const int loc_eng_position_recurrence_num = sizeof ( loc_eng_position_recurrences ) / sizeof ( loc_name_val_s_type ) ;
const char * loc_get_position_recurrence_name ( GpsPositionRecurrence recur )
{
@ -102,7 +102,7 @@ const char* loc_get_position_recurrence_name(GpsPositionRecurrence recur)
static loc_name_val_s_type loc_eng_aiding_data_bits [ ] =
static const loc_name_val_s_type loc_eng_aiding_data_bits [ ] =
{
NAME_VAL ( GPS_DELETE_EPHEMERIS ) ,
NAME_VAL ( GPS_DELETE_ALMANAC ) ,
@ -118,7 +118,7 @@ static loc_name_val_s_type loc_eng_aiding_data_bits[] =
NAME_VAL ( GPS_DELETE_CELLDB_INFO ) ,
NAME_VAL ( GPS_DELETE_ALL )
} ;
static int loc_eng_aiding_data_bit_num = sizeof ( loc_eng_aiding_data_bits ) / sizeof ( loc_name_val_s_type ) ;
static const int loc_eng_aiding_data_bit_num = sizeof ( loc_eng_aiding_data_bits ) / sizeof ( loc_name_val_s_type ) ;
const char * loc_get_aiding_data_mask_names ( GpsAidingData data )
{
@ -126,7 +126,7 @@ const char* loc_get_aiding_data_mask_names(GpsAidingData data)
}
static loc_name_val_s_type loc_eng_agps_types [ ] =
static const loc_name_val_s_type loc_eng_agps_types [ ] =
{
NAME_VAL ( AGPS_TYPE_INVALID ) ,
NAME_VAL ( AGPS_TYPE_ANY ) ,
@ -134,7 +134,7 @@ static loc_name_val_s_type loc_eng_agps_types[] =
NAME_VAL ( AGPS_TYPE_C2K ) ,
NAME_VAL ( AGPS_TYPE_WWAN_ANY )
} ;
static int loc_eng_agps_type_num = sizeof ( loc_eng_agps_types ) / sizeof ( loc_name_val_s_type ) ;
static const int loc_eng_agps_type_num = sizeof ( loc_eng_agps_types ) / sizeof ( loc_name_val_s_type ) ;
const char * loc_get_agps_type_name ( AGpsType type )
{
@ -142,14 +142,14 @@ const char* loc_get_agps_type_name(AGpsType type)
}
static loc_name_val_s_type loc_eng_ni_types [ ] =
static const loc_name_val_s_type loc_eng_ni_types [ ] =
{
NAME_VAL ( GPS_NI_TYPE_VOICE ) ,
NAME_VAL ( GPS_NI_TYPE_UMTS_SUPL ) ,
NAME_VAL ( GPS_NI_TYPE_UMTS_CTRL_PLANE ) ,
NAME_VAL ( GPS_NI_TYPE_EMERGENCY_SUPL )
} ;
static int loc_eng_ni_type_num = sizeof ( loc_eng_ni_types ) / sizeof ( loc_name_val_s_type ) ;
static const int loc_eng_ni_type_num = sizeof ( loc_eng_ni_types ) / sizeof ( loc_name_val_s_type ) ;
const char * loc_get_ni_type_name ( GpsNiType type )
{
@ -157,13 +157,13 @@ const char* loc_get_ni_type_name(GpsNiType type)
}
static loc_name_val_s_type loc_eng_ni_responses [ ] =
static const loc_name_val_s_type loc_eng_ni_responses [ ] =
{
NAME_VAL ( GPS_NI_RESPONSE_ACCEPT ) ,
NAME_VAL ( GPS_NI_RESPONSE_DENY ) ,
NAME_VAL ( GPS_NI_RESPONSE_DENY )
} ;
static int loc_eng_ni_reponse_num = sizeof ( loc_eng_ni_responses ) / sizeof ( loc_name_val_s_type ) ;
static const int loc_eng_ni_reponse_num = sizeof ( loc_eng_ni_responses ) / sizeof ( loc_name_val_s_type ) ;
const char * loc_get_ni_response_name ( GpsUserResponseType response )
{
@ -171,7 +171,7 @@ const char* loc_get_ni_response_name(GpsUserResponseType response)
}
static loc_name_val_s_type loc_eng_ni_encodings [ ] =
static const loc_name_val_s_type loc_eng_ni_encodings [ ] =
{
NAME_VAL ( GPS_ENC_NONE ) ,
NAME_VAL ( GPS_ENC_SUPL_GSM_DEFAULT ) ,
@ -179,55 +179,55 @@ static loc_name_val_s_type loc_eng_ni_encodings[] =
NAME_VAL ( GPS_ENC_SUPL_UCS2 ) ,
NAME_VAL ( GPS_ENC_UNKNOWN )
} ;
static int loc_eng_ni_encoding_num = sizeof ( loc_eng_ni_encodings ) / sizeof ( loc_name_val_s_type ) ;
static const int loc_eng_ni_encoding_num = sizeof ( loc_eng_ni_encodings ) / sizeof ( loc_name_val_s_type ) ;
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 ) ;
}
static loc_name_val_s_type loc_eng_agps_bears [ ] =
static const loc_name_val_s_type loc_eng_agps_bears [ ] =
{
NAME_VAL ( AGPS_APN_BEARER_INVALID ) ,
NAME_VAL ( AGPS_APN_BEARER_IPV4 ) ,
NAME_VAL ( AGPS_APN_BEARER_IPV6 ) ,
NAME_VAL ( AGPS_APN_BEARER_IPV4V6 )
} ;
static int loc_eng_agps_bears_num = sizeof ( loc_eng_agps_bears ) / sizeof ( loc_name_val_s_type ) ;
static const int loc_eng_agps_bears_num = sizeof ( loc_eng_agps_bears ) / sizeof ( loc_name_val_s_type ) ;
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 ) ;
}
static loc_name_val_s_type loc_eng_server_types [ ] =
static const loc_name_val_s_type loc_eng_server_types [ ] =
{
NAME_VAL ( LOC_AGPS_CDMA_PDE_SERVER ) ,
NAME_VAL ( LOC_AGPS_CUSTOM_PDE_SERVER ) ,
NAME_VAL ( LOC_AGPS_MPC_SERVER ) ,
NAME_VAL ( LOC_AGPS_SUPL_SERVER )
} ;
static int loc_eng_server_types_num = sizeof ( loc_eng_server_types ) / sizeof ( loc_name_val_s_type ) ;
static const int loc_eng_server_types_num = sizeof ( loc_eng_server_types ) / sizeof ( loc_name_val_s_type ) ;
const char * loc_get_server_type_name ( LocServerType type )
{
return loc_get_name_from_val ( loc_eng_server_types , loc_eng_server_types_num , ( long ) type ) ;
}
static loc_name_val_s_type loc_eng_position_sess_status_types [ ] =
static const loc_name_val_s_type loc_eng_position_sess_status_types [ ] =
{
NAME_VAL ( LOC_SESS_SUCCESS ) ,
NAME_VAL ( LOC_SESS_INTERMEDIATE ) ,
NAME_VAL ( LOC_SESS_FAILURE )
} ;
static int loc_eng_position_sess_status_num = sizeof ( loc_eng_position_sess_status_types ) / sizeof ( loc_name_val_s_type ) ;
static const int loc_eng_position_sess_status_num = sizeof ( loc_eng_position_sess_status_types ) / sizeof ( loc_name_val_s_type ) ;
const char * loc_get_position_sess_status_name ( enum loc_sess_status status )
{
return loc_get_name_from_val ( loc_eng_position_sess_status_types , loc_eng_position_sess_status_num , ( long ) status ) ;
}
static loc_name_val_s_type loc_eng_agps_status_names [ ] =
static const loc_name_val_s_type loc_eng_agps_status_names [ ] =
{
NAME_VAL ( GPS_REQUEST_AGPS_DATA_CONN ) ,
NAME_VAL ( GPS_RELEASE_AGPS_DATA_CONN ) ,
@ -235,7 +235,7 @@ static loc_name_val_s_type loc_eng_agps_status_names[] =
NAME_VAL ( GPS_AGPS_DATA_CONN_DONE ) ,
NAME_VAL ( GPS_AGPS_DATA_CONN_FAILED )
} ;
static int loc_eng_agps_status_num = sizeof ( loc_eng_agps_status_names ) / sizeof ( loc_name_val_s_type ) ;
static const int loc_eng_agps_status_num = sizeof ( loc_eng_agps_status_names ) / sizeof ( loc_name_val_s_type ) ;
const char * loc_get_agps_status_name ( AGpsStatusValue status )
{