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