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