Remove all GPS code.
Currently gpswrapper causes a crash when booting, so for now remove it. But since we're removing that, remove the rest of it while we're at it. If people want to use the GPS, they can revert this commit.replicant-6.0
parent
24de677463
commit
735df82261
|
@ -50,11 +50,6 @@ PRODUCT_PROPERTY_OVERRIDES += \
|
|||
|
||||
$(call inherit-product-if-exists, hardware/broadcom/wlan/bcmdhd/firmware/bcm4330/device-bcm.mk)
|
||||
|
||||
# Gps
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(COMMON_PATH)/configs/gps.conf:system/etc/gps.conf \
|
||||
$(COMMON_PATH)/configs/sirfgps.conf:system/etc/sirfgps.conf
|
||||
|
||||
# Packages
|
||||
PRODUCT_PACKAGES := \
|
||||
com.android.future.usb.accessory \
|
||||
|
@ -155,7 +150,6 @@ PRODUCT_COPY_FILES += \
|
|||
frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:system/etc/permissions/android.hardware.camera.flash-autofocus.xml \
|
||||
frameworks/native/data/etc/android.hardware.camera.front.xml:system/etc/permissions/android.hardware.camera.front.xml \
|
||||
frameworks/native/data/etc/android.hardware.camera.xml:system/etc/permissions/android.hardware.camera.xml \
|
||||
frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \
|
||||
frameworks/native/data/etc/android.hardware.location.xml:system/etc/permissions/android.hardware.location.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml \
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
NTP_SERVER=north-america.pool.ntp.org
|
||||
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
|
||||
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
|
||||
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
|
||||
SUPL_HOST=supl.google.com
|
||||
SUPL_PORT=7276
|
|
@ -1,38 +0,0 @@
|
|||
#CSR SiRF plc
|
||||
#PROJECT_NAME : white Space is not allowed
|
||||
#UART_DRIVER : Uart Driver Path
|
||||
#RESET_GPIO : Reset GPIO Driver Path
|
||||
#ONOFF_GPIO : OnOff GPIO Driver Path
|
||||
#EXTERNAL_LNA : 1 - use External LNA, 0 - use Internal LNA only
|
||||
#REF_CLOCK_26MHZ: 1 - use 26MHz TCXO, 0 - use 16.369MHz TCXO
|
||||
#UART_BAUD_RATE : 0 - 115200bps 1 - 230400, 2 - 460800, 3 - 57600
|
||||
#FREQUENCY_AIDING : 0 - Disable, 1 - Enable
|
||||
#SENSOR_AIDING : 0 - Disable, 1 - Enable
|
||||
#SET_ID_IMSI : 1 - Use IMSI for SET ID, 0 - Use MSISDN for SET ID, especially for Japan Network Operators
|
||||
#DEBUGGING_FILES : 0 - no log file, 1 - log files enabled
|
||||
#SSL_ENABLED : 0 - SSL Disabled, 1 - SSL Enabled
|
||||
#CERTI_VERSION : 0 - TLSv1 , 1 - SSLv3 , 2 - SSLv23
|
||||
#CP_RESPONSETIME : 0 - no priority, 1 - resposne priority time, 2 - resposne priority position ,3 - resposne priority use entire response time
|
||||
#REAIDING=20
|
||||
#CONTROL_PLANE : 1 - CP Enabled, 0 - CP Disabled, for MP3 player or PND
|
||||
#ATT_NETWORK_OPERATOR : 1 - for AT&T, 0 - for other network operator
|
||||
PROJECT=SAMSUNG_S5PC210
|
||||
UART_DRIVER=/dev/ttySAC1
|
||||
RESET_GPIO=/sys/devices/virtual/sec/gps/GPS_nRST/value
|
||||
ONOFF_GPIO=/sys/devices/virtual/sec/gps/GPS_PWR_EN/value
|
||||
EXTERNAL_LNA=0
|
||||
REF_CLOCK_26MHZ=1
|
||||
UART_BAUD_RATE=2
|
||||
FREQUENCY_AIDING=1
|
||||
SENSOR_AIDING=1
|
||||
SET_ID_IMSI=1
|
||||
DEBUGGING_FILES=0
|
||||
SSL_ENABLED=0
|
||||
CERTI_VERSION=0
|
||||
CP_RESPONSETIME=2
|
||||
CONTROL_PLANE=1
|
||||
ATT_NETWORK_OPERATOR=0
|
||||
ICS_NETWORK_OPERATOR=1
|
||||
SGEE=0
|
||||
EMC_ENABLE=1
|
||||
LOG_PATH=/data
|
|
@ -1,21 +0,0 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
LOCAL_MODULE := gps.$(TARGET_BOARD_PLATFORM)
|
||||
|
||||
LOCAL_SHARED_LIBRARIES:= \
|
||||
liblog \
|
||||
libdl
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
gps.c
|
||||
|
||||
LOCAL_CFLAGS += \
|
||||
-fno-short-enums
|
||||
|
||||
LOCAL_PRELINK_MODULE := false
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
203
gpswrapper/gps.c
203
gpswrapper/gps.c
|
@ -1,203 +0,0 @@
|
|||
/******************************************************************************
|
||||
* GPS HAL wrapper
|
||||
* wrapps around Samsung GPS Libary and replaces a faulty pointer to
|
||||
* a faulty function from Samsung that will cause the system_server
|
||||
* to crash.
|
||||
*
|
||||
* Copyright 2010 - Kolja Dummann
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include <hardware/hardware.h>
|
||||
#include <hardware/gps.h>
|
||||
#include <errno.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
//#define ALOG_NDEBUG 0
|
||||
|
||||
#include <stdlib.h>
|
||||
#define ALOG_TAG "gps-wrapper"
|
||||
#include <utils/Log.h>
|
||||
|
||||
#define ORIGINAL_HAL_PATH "/system/lib/hw/vendor-gps.exynos4.so"
|
||||
|
||||
static const AGpsRilInterface* oldAGPSRIL = NULL;
|
||||
static AGpsRilInterface newAGPSRIL;
|
||||
|
||||
static const GpsInterface* originalGpsInterface = NULL;
|
||||
static GpsInterface newGpsInterface;
|
||||
|
||||
/**
|
||||
* Load the file defined by the variant and if successful
|
||||
* return the dlopen handle and the hmi.
|
||||
* @return 0 = success, !0 = failure.
|
||||
*/
|
||||
static int load(const char *id,
|
||||
const char *path,
|
||||
const struct hw_module_t **pHmi)
|
||||
{
|
||||
int status;
|
||||
void *handle;
|
||||
struct hw_module_t *hmi;
|
||||
|
||||
/*
|
||||
* load the symbols resolving undefined symbols before
|
||||
* dlopen returns. Since RTLD_GLOBAL is not or'd in with
|
||||
* RTLD_NOW the external symbols will not be global
|
||||
*/
|
||||
handle = dlopen(path, RTLD_NOW);
|
||||
if (handle == NULL) {
|
||||
char const *err_str = dlerror();
|
||||
ALOGE("load: module=%s\n%s", path, err_str?err_str:"unknown");
|
||||
status = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Get the address of the struct hal_module_info. */
|
||||
const char *sym = HAL_MODULE_INFO_SYM_AS_STR;
|
||||
hmi = (struct hw_module_t *)dlsym(handle, sym);
|
||||
if (hmi == NULL) {
|
||||
ALOGE("load: couldn't find symbol %s", sym);
|
||||
status = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Check that the id matches */
|
||||
if (strcmp(id, hmi->id) != 0) {
|
||||
ALOGE("load: id=%s != hmi->id=%s", id, hmi->id);
|
||||
status = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
hmi->dso = handle;
|
||||
|
||||
/* success */
|
||||
status = 0;
|
||||
|
||||
done:
|
||||
if (status != 0) {
|
||||
hmi = NULL;
|
||||
if (handle != NULL) {
|
||||
dlclose(handle);
|
||||
handle = NULL;
|
||||
}
|
||||
} else {
|
||||
ALOGV("loaded HAL id=%s path=%s hmi=%p handle=%p",
|
||||
id, path, *pHmi, handle);
|
||||
}
|
||||
|
||||
*pHmi = hmi;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static void update_network_state_wrapper(int connected, int type, int roaming, const char* extra_info)
|
||||
{
|
||||
ALOGI("%s was called and saved your from a faulty implementation ;-)", __func__);
|
||||
}
|
||||
|
||||
static const void* wrapper_get_extension(const char* name)
|
||||
{
|
||||
ALOGV("%s was called", __func__);
|
||||
|
||||
if (!strcmp(name, AGPS_RIL_INTERFACE) && (oldAGPSRIL = originalGpsInterface->get_extension(name)))
|
||||
{
|
||||
ALOGV("%s AGPS_RIL_INTERFACE extension requested", __func__);
|
||||
/* use a wrapper to avoid calling samsungs faulty implemetation */
|
||||
newAGPSRIL.size = sizeof(AGpsRilInterface);
|
||||
newAGPSRIL.init = oldAGPSRIL->init;
|
||||
newAGPSRIL.set_ref_location = oldAGPSRIL->set_ref_location;
|
||||
newAGPSRIL.set_set_id = oldAGPSRIL->set_set_id;
|
||||
newAGPSRIL.ni_message = oldAGPSRIL->ni_message;
|
||||
ALOGV("%s setting update_network_state_wrapper", __func__);
|
||||
newAGPSRIL.update_network_state = update_network_state_wrapper;
|
||||
return &newAGPSRIL;
|
||||
}
|
||||
return originalGpsInterface->get_extension(name);
|
||||
}
|
||||
|
||||
/* HAL Methods */
|
||||
const GpsInterface* gps_get_gps_interface(struct gps_device_t* dev)
|
||||
{
|
||||
hw_module_t* module;
|
||||
int err;
|
||||
|
||||
ALOGV("%s was called", __func__);
|
||||
|
||||
err = load(GPS_HARDWARE_MODULE_ID, ORIGINAL_HAL_PATH, (hw_module_t const**)&module);
|
||||
|
||||
if (err == 0) {
|
||||
ALOGV("%s vendor lib loaded", __func__);
|
||||
hw_device_t* device;
|
||||
struct gps_device_t *gps_device;
|
||||
err = module->methods->open(module, GPS_HARDWARE_MODULE_ID, &device);
|
||||
if (err == 0) {
|
||||
ALOGV("%s got gps device", __func__);
|
||||
gps_device = (struct gps_device_t *)device;
|
||||
originalGpsInterface = gps_device->get_gps_interface(gps_device);
|
||||
ALOGV("%s device set", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
if(originalGpsInterface)
|
||||
{
|
||||
ALOGV("%s exposing callbacks", __func__);
|
||||
newGpsInterface.size = sizeof(GpsInterface);
|
||||
newGpsInterface.init = originalGpsInterface->init;
|
||||
newGpsInterface.start = originalGpsInterface->start;
|
||||
newGpsInterface.stop = originalGpsInterface->stop;
|
||||
newGpsInterface.cleanup = originalGpsInterface->cleanup;
|
||||
newGpsInterface.inject_time = originalGpsInterface->inject_time;
|
||||
newGpsInterface.inject_location = originalGpsInterface->inject_location;
|
||||
newGpsInterface.delete_aiding_data = originalGpsInterface->delete_aiding_data;
|
||||
newGpsInterface.set_position_mode = originalGpsInterface->set_position_mode;
|
||||
ALOGV("%s setting extension wrapper", __func__);
|
||||
newGpsInterface.get_extension = wrapper_get_extension;
|
||||
|
||||
}
|
||||
ALOGV("%s done", __func__);
|
||||
return &newGpsInterface;
|
||||
}
|
||||
|
||||
static int open_gps(const struct hw_module_t* module, char const* name,
|
||||
struct hw_device_t** device)
|
||||
{
|
||||
struct gps_device_t *dev = malloc(sizeof(struct gps_device_t));
|
||||
memset(dev, 0, sizeof(*dev));
|
||||
|
||||
ALOGV("%s was called", __func__);
|
||||
|
||||
dev->common.tag = HARDWARE_DEVICE_TAG;
|
||||
dev->common.version = 0;
|
||||
dev->common.module = (struct hw_module_t*)module;
|
||||
dev->get_gps_interface = gps_get_gps_interface;
|
||||
|
||||
*device = (struct hw_device_t*)dev;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct hw_module_methods_t gps_module_methods = {
|
||||
.open = open_gps
|
||||
};
|
||||
|
||||
const struct hw_module_t HAL_MODULE_INFO_SYM = {
|
||||
.tag = HARDWARE_MODULE_TAG,
|
||||
.version_major = 1,
|
||||
.version_minor = 0,
|
||||
.id = GPS_HARDWARE_MODULE_ID,
|
||||
.name = "GPS HAL Wrapper Module",
|
||||
.author = "Kolja Dummann",
|
||||
.methods = &gps_module_methods,
|
||||
};
|
File diff suppressed because it is too large
Load Diff
|
@ -12,7 +12,6 @@
|
|||
<item name="dsp.video">265</item>
|
||||
<item name="radio.active">242</item>
|
||||
<item name="radio.scanning">82</item>
|
||||
<item name="gps.on">1</item>
|
||||
<array name="radio.on">
|
||||
<value>2.7</value>
|
||||
<value>3</value>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import init.smdk4210.usb.rc
|
||||
import init.gps.rc
|
||||
|
||||
on init
|
||||
mkdir /efs 0771 radio system
|
||||
|
@ -49,15 +48,6 @@ on post-fs-data
|
|||
# MDNS
|
||||
socket mdns stream 0660 root system
|
||||
|
||||
# GPS
|
||||
chown root system /dev/ttySAC1
|
||||
chmod 0660 /dev/ttySAC1
|
||||
chown root system /sys/class/sec/gps/GPS_PWR_EN/value
|
||||
chmod 0664 /sys/class/sec/gps/GPS_PWR_EN/value
|
||||
chown root system /sys/class/sec/gps/GPS_nRST/value
|
||||
chmod 0664 /sys/class/sec/gps/GPS_nRST/value
|
||||
mkdir /data/gps 771 system system
|
||||
chown system system /data/gps
|
||||
|
||||
# give system access to wpa_supplicant.conf for backup and restore
|
||||
mkdir /data/misc/wifi 0770 wifi wifi
|
||||
|
|
|
@ -31,9 +31,6 @@
|
|||
/efs/bluetooth/bt_addr u:object_r:bluetooth_data_file:s0
|
||||
/sys/devices/platform/bcm4330_bluetooth/rfkill/rfkill0/state u:object_r:sysfs_bluetooth_writable:s0
|
||||
|
||||
# GPS
|
||||
/dev/ttySAC1 u:object_r:gps_device:s0
|
||||
|
||||
# Sensors
|
||||
/dev/akm8975 u:object_r:sensors_device:s0
|
||||
|
||||
|
|
Loading…
Reference in New Issue