Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a55c3213 authored by Mike Lockwood's avatar Mike Lockwood
Browse files

location: Move geocoding support from ILocationProvider to a new interface.

parent 967f7c16
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -109,6 +109,7 @@ LOCAL_SRC_FILES += \
	core/java/com/android/internal/view/IInputMethodManager.aidl \
	core/java/com/android/internal/view/IInputMethodManager.aidl \
	core/java/com/android/internal/view/IInputMethodSession.aidl \
	core/java/com/android/internal/view/IInputMethodSession.aidl \
	im/java/android/im/IImPlugin.aidl \
	im/java/android/im/IImPlugin.aidl \
	location/java/android/location/IGeocodeProvider.aidl \
	location/java/android/location/IGpsStatusListener.aidl \
	location/java/android/location/IGpsStatusListener.aidl \
	location/java/android/location/ILocationCollector.aidl \
	location/java/android/location/ILocationCollector.aidl \
	location/java/android/location/ILocationListener.aidl \
	location/java/android/location/ILocationListener.aidl \
+35 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2009 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.location;

import android.location.Address;

/**
 * An interface for location providers implementing the Geocoder services.
 *
 * {@hide}
 */
interface IGeocodeProvider {

    String getFromLocation(double latitude, double longitude, int maxResults,
        String language, String country, String variant, String appName, out List<Address> addrs);

    String 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);
}
+3 −1
Original line number Original line Diff line number Diff line
@@ -18,6 +18,7 @@ package android.location;


import android.app.PendingIntent;
import android.app.PendingIntent;
import android.location.Address;
import android.location.Address;
import android.location.IGeocodeProvider;
import android.location.IGpsStatusListener;
import android.location.IGpsStatusListener;
import android.location.ILocationCollector;
import android.location.ILocationCollector;
import android.location.ILocationListener;
import android.location.ILocationListener;
@@ -77,7 +78,8 @@ interface ILocationManager
    void setTestProviderStatus(String provider, int status, in Bundle extras, long updateTime);
    void setTestProviderStatus(String provider, int status, in Bundle extras, long updateTime);
    void clearTestProviderStatus(String provider);
    void clearTestProviderStatus(String provider);


    /* for installing Network Location Provider */
    /* for installing external Location Providers */
    void setNetworkLocationProvider(ILocationProvider provider);
    void setNetworkLocationProvider(ILocationProvider provider);
    void setLocationCollector(ILocationCollector collector);
    void setLocationCollector(ILocationCollector collector);
    void setGeocodeProvider(IGeocodeProvider provider);
}
}
+0 −7
Original line number Original line Diff line number Diff line
@@ -16,7 +16,6 @@


package android.location;
package android.location;


import android.location.Address;
import android.os.Bundle;
import android.os.Bundle;


/**
/**
@@ -52,10 +51,4 @@ interface ILocationProvider {
    void updateCellLockStatus(boolean acquired);
    void updateCellLockStatus(boolean acquired);
    void addListener(in String[] applications);
    void addListener(in String[] applications);
    void removeListener(in String[] applications);
    void removeListener(in String[] applications);
    String getFromLocation(double latitude, double longitude, int maxResults,
        String language, String country, String variant, String appName, out List<Address> addrs);
    String 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);
}
}
+0 −25
Original line number Original line Diff line number Diff line
@@ -245,29 +245,4 @@ public class LocationProviderProxy extends LocationProviderImpl {
            Log.e(TAG, "removeListener failed", e);
            Log.e(TAG, "removeListener failed", e);
        }
        }
    }
    }

    public String getFromLocation(double latitude, double longitude, int maxResults,
        String language, String country, String variant, String appName, List<Address> addrs) {
        try {
            return mProvider.getFromLocation(latitude, longitude, maxResults, language, country, 
                    variant, appName,  addrs);
        } catch (RemoteException e) {
            Log.e(TAG, "getFromLocation failed", e);
            return null;
        }
    }

    public String getFromLocationName(String locationName,
        double lowerLeftLatitude, double lowerLeftLongitude,
        double upperRightLatitude, double upperRightLongitude, int maxResults,
        String language, String country, String variant, String appName, List<Address> addrs) {
        try {
            return mProvider.getFromLocationName(locationName, lowerLeftLatitude, 
                    lowerLeftLongitude, upperRightLatitude, upperRightLongitude,
                    maxResults, language, country, variant, appName, addrs);
        } catch (RemoteException e) {
            Log.e(TAG, "getFromLocationName failed", e);
            return null;
        }
    }
}
}
Loading