IFusedGeofenceHardware.aidl revision 1af4b0280af406cfc7eb46810f6b76e57b983e11
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
17package android.location;
18
19import android.location.Geofence;
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 */
31interface 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 geofenceIdsArray    The list of geofence Ids to add.
43     * @param geofencesArray      the list of geofences to add.
44     */
45    // TODO: [GeofenceIntegration] GeofenceHardwareRequest is not a parcelable class exposed in aidl
46    void addGeofences(in int[] geofenceIdsArray, in Geofence[] geofencesArray);
47
48    /**
49     * Removes a give list of geofences from the system.
50     *
51     * @param geofences     The list of geofences to remove.
52     */
53    void removeGeofences(in int[] geofenceIds);
54
55    /**
56     * Pauses monitoring a particular geofence.
57     *
58     * @param geofenceId    The geofence to pause monitoring.
59     */
60    void pauseMonitoringGeofence(in int geofenceId);
61
62    /**
63     * Resumes monitoring a particular geofence.
64     *
65     * @param geofenceid            The geofence to resume monitoring.
66     * @param transitionsToMonitor  The transitions to monitor upon resume.
67     *
68     * Remarks: keep naming of geofence request options consistent with the naming used in
69     *          GeofenceHardwareRequest
70     */
71    void resumeMonitoringGeofence(in int geofenceId, in int monitorTransitions);
72
73    /**
74     * Modifies the request options if a geofence that is already known by the
75     * system.
76     *
77     * @param geofenceId                    The geofence to modify.
78     * @param lastTransition                The last known transition state of
79     *                                      the geofence.
80     * @param monitorTransitions            The set of transitions to monitor.
81     * @param notificationResponsiveness    The notification responsivness needed.
82     * @param unknownTimer                  The time span associated with the
83     *
84     * Remarks: keep the options as separate fields to be able to leverage the class
85     * GeofenceHardwareRequest without any changes
86     */
87    void modifyGeofenceOptions(
88            in int geofenceId,
89            in int lastTransition,
90            in int monitorTransitions,
91            in int notificationResponsiveness,
92            in int unknownTimer);
93}
94