Home | History | Annotate | Download | only in 1.0
      1 /*
      2  * Copyright (C) 2016 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package android.hardware.gnss@1.0;
     18 
     19 /**
     20  * Interface for passing GNSS configuration info from platform to HAL.
     21  */
     22 interface IGnssConfiguration {
     23     /**
     24      * Enum which holds the bit masks for SUPL_MODE configuration parameter.
     25      */
     26     enum SuplMode : uint8_t {
     27         /** Mobile Station Based */
     28         MSB = 0x01,
     29 
     30         /** Mobile Station Assisted */
     31         MSA = 0x02
     32     };
     33 
     34     /**
     35      * Enum which holds the bit masks for GPS_LOCK configuration parameter.
     36      */
     37     enum GpsLock : uint8_t {
     38         /** Lock Mobile Originated GPS functionalitues. */
     39         MO    =  0x01,
     40 
     41         /** Lock Network initiated GPS functionalities. */
     42         NI    =  0x02
     43     };
     44 
     45     /**
     46      * Enum that hold the bit masks for various LTE Positioning Profile settings (LPP_PROFILE
     47      * configuration parameter). If none of the bits in the enum are set, the default setting is
     48      * Radio Resource Location Protocol(RRLP).
     49      */
     50     enum LppProfile : uint8_t {
     51         /** Enable LTE Positioning Protocol user plane */
     52         USER_PLANE          = 0x01,
     53 
     54         /** Enable LTE Positioning Protocol Control plane */
     55         CONTROL_PLANE       = 0x02
     56     };
     57 
     58     /**
     59      * Enum which holds the bit masks for A_GLONASS_POS_PROTOCOL_SELECT
     60      * configuration parameter.
     61      */
     62     enum GlonassPosProtocol : uint8_t {
     63         /** Radio Resource Control(RRC) control-plane. */
     64         RRC_CPLANE                  = 0x01,
     65 
     66         /** Radio Resource Location user-plane. */
     67         RRLP_CPLANE                 = 0x02,
     68 
     69         /** LTE Positioning Protocol User plane */
     70         LPP_UPLANE                  = 0x04
     71     };
     72 
     73     /**
     74      * IMPORTANT: GNSS HAL must expect the below methods to be called multiple
     75      * times. They can be called even when GnssLocationProvider is already
     76      * constructed and enabled. GNSS HAL must maintain the existing requests
     77      * for various callbacks regardless the change in configuration data.
     78      */
     79 
     80      /**
     81       * This method enables or disables NI emergency SUPL restrictions.
     82       *
     83       * @param enabled True if the device must only accept NI Emergency SUPL requests when the
     84       *                     device is truly in emergency mode (e.g. the user has dialed 911, 112,
     85       *                     etc...)
     86       *                False if the device must accept NI Emergency SUPL any time they are
     87       *                      received
     88       *
     89       * @return success True if operation was successful.
     90       */
     91      setSuplEs(bool enabled) generates (bool success);
     92 
     93      /**
     94       * This method sets the SUPL version requested by Carrier. The GNSS HAL
     95       * must use this version of the SUPL protocol if supported.
     96       *
     97       * @param version SUPL version requested by carrier. This is a bit mask
     98       * with bits 0:7 representing a service indicator field, bits 8:15
     99       * representing the minor version and bits 16:23 representing the
    100       * major version.
    101       *
    102       * @return success True if operation was successful.
    103       */
    104      setSuplVersion(uint32_t version) generates (bool success);
    105 
    106      /**
    107       * This method sets the SUPL mode.
    108       *
    109       * @param mode Bit mask that specifies the SUPL mode which is set with the SuplMode enum.
    110       *
    111       * @return success True if operation was successful.
    112       */
    113      setSuplMode(bitfield<SuplMode> mode) generates (bool success);
    114 
    115      /**
    116       * This setting configures how GPS functionalities should be locked when
    117       * user turns off GPS On setting.
    118       *
    119       * @param lock Bitmask that specifies the GPS functionalities to be be
    120       * locked as per the GpsLock enum.
    121       *
    122       * @return success True if operation was successful.
    123       */
    124      setGpsLock(bitfield<GpsLock> lock) generates (bool success);
    125 
    126      /**
    127       * This method sets the LTE Positioning Profile configuration.
    128       *
    129       * @param lppProfile Bitmask that specifies the LTE Positioning Profile
    130       * configuration to be set as per the LppProfile enum.
    131       *
    132       * @return success True if operation was successful.
    133       */
    134      setLppProfile(bitfield<LppProfile> lppProfile) generates (bool success);
    135 
    136      /**
    137       * This method selects positioning protocol on A-Glonass system.
    138       *
    139       * @param protocol Bitmask that specifies the positioning protocol to be
    140       * set as per GlonassPosProtocol enum.
    141       *
    142       * @return success True if operation was successful.
    143       */
    144      setGlonassPositioningProtocol(bitfield<GlonassPosProtocol> protocol) generates (bool success);
    145 
    146      /**
    147       * This method configures which PDN to use.
    148       *
    149       * @param enable Use emergency PDN if true and regular PDN if false.
    150       * @return success True if operation was successful.
    151       */
    152      setEmergencySuplPdn(bool enable) generates (bool success);
    153 };
    154