ILocationManager.aidl revision 4b3e3931270f8e406fc806bc7fa1c2788256687d
1/*
2 * Copyright (C) 2007, 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
17package android.location;
18
19import android.app.PendingIntent;
20import android.location.Address;
21import android.location.Criteria;
22import android.location.GeocoderParams;
23import android.location.Geofence;
24import android.location.IGpsMeasurementsListener;
25import android.location.IGpsNavigationMessageListener;
26import android.location.IGpsStatusListener;
27import android.location.ILocationListener;
28import android.location.Location;
29import android.location.LocationRequest;
30import android.os.Bundle;
31
32import com.android.internal.location.ProviderProperties;
33
34/**
35 * System private API for talking with the location service.
36 *
37 * @hide
38 */
39interface ILocationManager
40{
41    void requestLocationUpdates(in LocationRequest request, in ILocationListener listener,
42            in PendingIntent intent, String packageName);
43    void removeUpdates(in ILocationListener listener, in PendingIntent intent, String packageName);
44
45    void requestGeofence(in LocationRequest request, in Geofence geofence,
46            in PendingIntent intent, String packageName);
47    void removeGeofence(in Geofence fence, in PendingIntent intent, String packageName);
48
49    Location getLastLocation(in LocationRequest request, String packageName);
50
51    boolean addGpsStatusListener(IGpsStatusListener listener, String packageName);
52    void removeGpsStatusListener(IGpsStatusListener listener);
53
54    boolean geocoderIsPresent();
55    String getFromLocation(double latitude, double longitude, int maxResults,
56        in GeocoderParams params, out List<Address> addrs);
57    String getFromLocationName(String locationName,
58        double lowerLeftLatitude, double lowerLeftLongitude,
59        double upperRightLatitude, double upperRightLongitude, int maxResults,
60        in GeocoderParams params, out List<Address> addrs);
61
62    boolean sendNiResponse(int notifId, int userResponse);
63
64    boolean addGpsMeasurementsListener(in IGpsMeasurementsListener listener, in String packageName);
65    boolean removeGpsMeasurementsListener(in IGpsMeasurementsListener listener);
66
67    boolean addGpsNavigationMessageListener(
68            in IGpsNavigationMessageListener listener,
69            in String packageName);
70    boolean removeGpsNavigationMessageListener(in IGpsNavigationMessageListener listener);
71
72    // --- deprecated ---
73    List<String> getAllProviders();
74    List<String> getProviders(in Criteria criteria, boolean enabledOnly);
75    String getBestProvider(in Criteria criteria, boolean enabledOnly);
76    boolean providerMeetsCriteria(String provider, in Criteria criteria);
77    ProviderProperties getProviderProperties(String provider);
78    boolean isProviderEnabled(String provider);
79
80    void addTestProvider(String name, in ProviderProperties properties);
81    void removeTestProvider(String provider);
82    void setTestProviderLocation(String provider, in Location loc);
83    void clearTestProviderLocation(String provider);
84    void setTestProviderEnabled(String provider, boolean enabled);
85    void clearTestProviderEnabled(String provider);
86    void setTestProviderStatus(String provider, int status, in Bundle extras, long updateTime);
87    void clearTestProviderStatus(String provider);
88
89    boolean sendExtraCommand(String provider, String command, inout Bundle extras);
90
91    // --- internal ---
92
93    // Used by location providers to tell the location manager when it has a new location.
94    // Passive is true if the location is coming from the passive provider, in which case
95    // it need not be shared with other providers.
96    void reportLocation(in Location location, boolean passive);
97
98    // for reporting callback completion
99    void locationCallbackFinished(ILocationListener listener);
100
101
102}
103