SUPL NI Implementation

Prologue

  • hardware/libhardware/include/hardware/gps.h
  • https://source.android.com/devices/halref/struct_gps_ni_notification.html
typedef struct {
1. int notification_id;
2. GpsUserResponseType default_response;
3. GpsNiNotifyFlags notify_flags;		 
    /** NI requires notification */
    #define GPS_NI_NEED_NOTIFY          0x0001	(pop up)
    /** NI requires verification */
    #define GPS_NI_NEED_VERIFY          0x0002	(confirm by user)
    /** NI requires privacy override, no notification/minimal trace */
    #define GPS_NI_PRIVACY_OVERRIDE     0x0004	(not this scope)
4. int timeout; (phase 2)
    GpsUserResponseType default_response; (delay work)

/* typedef int GpsUserResponseType;
#define GPS_NI_RESPONSE_ACCEPT         1
#define GPS_NI_RESPONSE_DENY           2
#define GPS_NI_RESPONSE_NORESP         3
*/
} GpsNiNotification;

Prologue

/** 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;
} GpsNiCallbacks;

/**
 * Extended interface for Network-initiated (NI) support.
 */
typedef struct
{
    /** set to sizeof(GpsNiInterface) */
    size_t          size;

   /** Registers the callbacks for HAL to use. */
   void (*init) (GpsNiCallbacks *callbacks);

   /** Sends a response to HAL. */
   void (*respond) (int notif_id, GpsUserResponseType user_response);
} GpsNiInterface;

Implementation Detail

  • Send Chrome Event to system app
    • type: supl-verification/supl-notification
  • Do we need a content event?
    • Add a settings key as below:
    • The value can be (1) true: id, (2) false: id*-1
    • We can use two keys to represent accept/reject
      • geolocation.debugging.gps-locations-ignored
      • geolocation.debugging.enabled

SUPL NI Implementation

By Alphan Chen

SUPL NI Implementation

  • 1,168