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