1 /* 2 * Copyright (C) 2013, 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/license/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.location; 18 19 import android.hardware.location.GeofenceHardwareRequestParcelable; 20 21 /** 22 * Fused Geofence Hardware interface. 23 * 24 * <p>This interface is the basic set of supported functionality by Fused Hardware modules that offer 25 * Geofencing capabilities. 26 * 27 * All operations are asynchronous and the status codes can be obtained via a set of callbacks. 28 * 29 * @hide 30 */ 31 interface IFusedGeofenceHardware { 32 /** 33 * Flags if the interface functionality is supported by the platform. 34 * 35 * @return true if the functionality is supported, false otherwise. 36 */ 37 boolean isSupported(); 38 39 /** 40 * Adds a given list of geofences to the system. 41 * 42 * @param geofenceRequestsArray The list of geofences to add. 43 */ 44 void addGeofences(in GeofenceHardwareRequestParcelable[] geofenceRequestsArray); 45 46 /** 47 * Removes a give list of geofences from the system. 48 * 49 * @param geofences The list of geofences to remove. 50 */ 51 void removeGeofences(in int[] geofenceIds); 52 53 /** 54 * Pauses monitoring a particular geofence. 55 * 56 * @param geofenceId The geofence to pause monitoring. 57 */ 58 void pauseMonitoringGeofence(in int geofenceId); 59 60 /** 61 * Resumes monitoring a particular geofence. 62 * 63 * @param geofenceid The geofence to resume monitoring. 64 * @param transitionsToMonitor The transitions to monitor upon resume. 65 * 66 * Remarks: keep naming of geofence request options consistent with the naming used in 67 * GeofenceHardwareRequest 68 */ 69 void resumeMonitoringGeofence(in int geofenceId, in int monitorTransitions); 70 71 /** 72 * Modifies the request options if a geofence that is already known by the 73 * system. 74 * 75 * @param geofenceId The geofence to modify. 76 * @param lastTransition The last known transition state of 77 * the geofence. 78 * @param monitorTransitions The set of transitions to monitor. 79 * @param notificationResponsiveness The notification responsivness needed. 80 * @param unknownTimer The time span associated with the. 81 * @param sourcesToUse The source technologies to use. 82 * 83 * Remarks: keep the options as separate fields to be able to leverage the class 84 * GeofenceHardwareRequest without any changes 85 */ 86 void modifyGeofenceOptions( 87 in int geofenceId, 88 in int lastTransition, 89 in int monitorTransitions, 90 in int notificationResponsiveness, 91 in int unknownTimer, 92 in int sourcesToUse); 93 } 94