Java 类com.google.android.gms.location.ILocationListener 实例源码

项目:android_external_GmsLib    文件:LocationClientImpl.java   
public void requestLocationUpdates(LocationRequest request, final LocationListener listener)
        throws RemoteException {
    if (nativeLocation != null) {
        nativeLocation.requestLocationUpdates(request, listener);
    } else {
        if (!listenerMap.containsKey(listener)) {
            listenerMap.put(listener, new ILocationListener.Stub() {
                @Override
                public void onLocationChanged(Location location) throws RemoteException {
                    listener.onLocationChanged(location);
                }
            });
        }
        getServiceInterface().requestLocationUpdatesWithPackage(request,
                listenerMap.get(listener), getContext().getPackageName());
    }
}
项目:android_packages_apps_GmsCore    文件:GoogleLocationManager.java   
public void removeLocationUpdates(ILocationListener listener, String packageName) {
    for (int i = 0; i < currentRequests.size(); i++) {
        if (currentRequests.get(i).respondsTo(listener)) {
            removeLocationUpdates(currentRequests.get(i));
            i--;
        }
    }
}
项目:android_packages_apps_GmsCore    文件:GoogleLocationManagerServiceImpl.java   
@Override
public void requestLocationUpdatesWithListener(LocationRequest request,
                                               final ILocationListener listener) throws RemoteException {
    Log.d(TAG, "requestLocationUpdatesWithListener: " + request);
    getLocationManager().requestLocationUpdates(request, listener, null);
}
项目:android_packages_apps_GmsCore    文件:GoogleLocationManagerServiceImpl.java   
@Override
public void removeLocationUpdatesWithListener(ILocationListener listener)
        throws RemoteException {
    Log.d(TAG, "removeLocationUpdatesWithListener: " + listener);
    getLocationManager().removeLocationUpdates(listener, null);
}
项目:android_packages_apps_GmsCore    文件:GoogleLocationManagerServiceImpl.java   
@Override
public void requestLocationUpdatesWithPackage(LocationRequest request, ILocationListener listener,
                                              String packageName) throws RemoteException {
    Log.d(TAG, "requestLocationUpdatesWithPackage: " + request);
    getLocationManager().requestLocationUpdates(request, listener, packageName);
}
项目:android_packages_apps_GmsCore    文件:GoogleLocationManagerServiceImpl.java   
@Override
public void requestLocationUpdatesInternalWithListener(LocationRequestInternal request,
                                                       ILocationListener listener) throws RemoteException {
    Log.d(TAG, "requestLocationUpdatesInternalWithListener: " + request);
    getLocationManager().requestLocationUpdates(request.request, listener, null);
}
项目:android_packages_apps_GmsCore    文件:LocationRequestHelper.java   
public LocationRequestHelper(Context context, LocationRequest locationRequest, boolean hasFinePermission,
                             boolean hasCoarsePermission, String packageName, ILocationListener listener) {
    this(context, locationRequest, hasFinePermission, hasCoarsePermission, packageName);
    this.listener = listener;
}
项目:android_packages_apps_GmsCore    文件:LocationRequestHelper.java   
public boolean respondsTo(ILocationListener listener) {
    return this.listener != null && listener != null &&
            this.listener.asBinder().equals(listener.asBinder());
}
项目:android_packages_apps_GmsCore    文件:GoogleLocationManager.java   
public void requestLocationUpdates(LocationRequest request, ILocationListener listener, String packageName) {
    requestLocationUpdates(new LocationRequestHelper(context, request, hasFineLocationPermission(),
            hasCoarseLocationPermission(), packageName, listener));
}