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