1 /* 2 * Copyright (C) 2021 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 #ifndef CHRE_PLATFORM_LINUX_PAL_GNSS_H_ 18 #define CHRE_PLATFORM_LINUX_PAL_GNSS_H_ 19 20 /** 21 * @return whether the GNSS location session is enabled in the GNSS PAL. 22 */ 23 bool chrePalGnssIsLocationEnabled(); 24 25 /** 26 * @return whether the GNSS measurement session is enabled in the GNSS PAL. 27 */ 28 bool chrePalGnssIsMeasurementEnabled(); 29 30 /** 31 * @return whether the GNSS passive listener is enabled in the GNSS PAL. 32 */ 33 bool chrePalGnssIsPassiveLocationListenerEnabled(); 34 35 /** 36 * Delays sending the location events until 37 * chrePalGnssStartSendingLocationEvents is called. 38 * 39 * Use this if you need to control the timing between when CHRE requests GNSS 40 * locations and when the async callback and events are delivered. 41 * 42 * The default is to start sending events immediately to CHRE. 43 */ 44 void chrePalGnssDelaySendingLocationEvents(bool enable); 45 46 /** 47 * Starts sending the location events after chrePalControlLocationSession has 48 * been called with enable set to true. 49 * 50 * Note: This function must only be called after a call to 51 * chrePalGnssDelaySendingLocationEvents with enable set to true. 52 */ 53 void chrePalGnssStartSendingLocationEvents(); 54 55 #endif // CHRE_PLATFORM_LINUX_PAL_GNSS_H_ 56