ILocationManager.aidl revision a4903f254b4711c8fc0ac5f7e3d605f4dce34f35
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.GeocoderParams;
22import android.location.IGeocodeProvider;
23import android.location.IGpsStatusListener;
24import android.location.ILocationListener;
25import android.location.Location;
26import android.os.Bundle;
27
28/**
29 * System private API for talking with the location service.
30 *
31 * {@hide}
32 */
33interface ILocationManager
34{
35    List getAllProviders();
36    List getProviders(boolean enabledOnly);
37
38    void requestLocationUpdates(String provider, long minTime, float minDistance,
39        in ILocationListener listener);
40    void requestLocationUpdatesPI(String provider, long minTime, float minDistance,
41        in PendingIntent intent);
42    void removeUpdates(in ILocationListener listener);
43    void removeUpdatesPI(in PendingIntent intent);
44
45    boolean addGpsStatusListener(IGpsStatusListener listener);
46    void removeGpsStatusListener(IGpsStatusListener listener);
47
48    // for reporting callback completion
49    void locationCallbackFinished(ILocationListener listener);
50
51    boolean sendExtraCommand(String provider, String command, inout Bundle extras);
52
53    void addProximityAlert(double latitude, double longitude, float distance,
54        long expiration, in PendingIntent intent);
55    void removeProximityAlert(in PendingIntent intent);
56
57    Bundle getProviderInfo(String provider);
58    boolean isProviderEnabled(String provider);
59
60    Location getLastKnownLocation(String provider);
61
62    // Used by location providers to tell the location manager when it has a new location.
63    // Passive is true if the location is coming from the passive provider, in which case
64    // it need not be shared with other providers.
65    void reportLocation(in Location location, boolean passive);
66
67    String getFromLocation(double latitude, double longitude, int maxResults,
68        in GeocoderParams params, out List<Address> addrs);
69    String getFromLocationName(String locationName,
70        double lowerLeftLatitude, double lowerLeftLongitude,
71        double upperRightLatitude, double upperRightLongitude, int maxResults,
72        in GeocoderParams params, out List<Address> addrs);
73
74    void addTestProvider(String name, boolean requiresNetwork, boolean requiresSatellite,
75        boolean requiresCell, boolean hasMonetaryCost, boolean supportsAltitude,
76        boolean supportsSpeed, boolean supportsBearing, int powerRequirement, int accuracy);
77    void removeTestProvider(String provider);
78    void setTestProviderLocation(String provider, in Location loc);
79    void clearTestProviderLocation(String provider);
80    void setTestProviderEnabled(String provider, boolean enabled);
81    void clearTestProviderEnabled(String provider);
82    void setTestProviderStatus(String provider, int status, in Bundle extras, long updateTime);
83    void clearTestProviderStatus(String provider);
84
85    // for NI support
86    boolean sendNiResponse(int notifId, int userResponse);
87}
88