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