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