Home | History | Annotate | Download | only in gps
      1 #include <hardware_legacy/gps.h>
      2 #include <cutils/properties.h>
      3 
      4 #define LOG_TAG "libhardware_legacy"
      5 #include <utils/Log.h>
      6 #include "qemu.h"
      7 
      8 static const GpsInterface*  sGpsInterface = NULL;
      9 
     10 static void
     11 gps_find_hardware( void )
     12 {
     13 #ifdef HAVE_QEMU_GPS_HARDWARE
     14     if (qemu_check()) {
     15         sGpsInterface = gps_get_qemu_interface();
     16         if (sGpsInterface) {
     17             LOGD("using QEMU GPS Hardware emulation\n");
     18             return;
     19         }
     20     }
     21 #endif
     22 
     23 #ifdef HAVE_GPS_HARDWARE
     24     sGpsInterface = gps_get_hardware_interface();
     25 #endif
     26     if (!sGpsInterface)
     27         LOGD("no GPS hardware on this device\n");
     28 }
     29 
     30 const GpsInterface*
     31 gps_get_interface()
     32 {
     33     if (sGpsInterface == NULL)
     34          gps_find_hardware();
     35 
     36     return sGpsInterface;
     37 }
     38