⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gps.cpp

📁 Android平台上Midware层源代码合集
💻 CPP
字号:
#include <hardware/gps.h>#include <cutils/properties.h>#define LOG_TAG "libhardware"#include <utils/Log.h>static const GpsInterface*  sGpsInterface = NULL;static voidgps_find_hardware( void ){#ifdef HAVE_QEMU_GPS_HARDWARE    char  propBuf[PROPERTY_VALUE_MAX];    property_get("ro.kernel.qemu", propBuf, "");    if (propBuf[0] == '1') {        sGpsInterface = gps_get_qemu_interface();        if (sGpsInterface) {            LOGD("using QEMU GPS Hardware emulation\n");            return;        }    }#endif#ifdef HAVE_GPS_HARDWARE    sGpsInterface = gps_get_hardware_interface();#endif    if (!sGpsInterface)        LOGD("no GPS hardware on this device\n");}const GpsInterface*gps_get_interface(){    if (sGpsInterface == NULL)         gps_find_hardware();    return sGpsInterface;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -