1a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao/*
2a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * Copyright (C) 2010, The Android Open Source Project
3a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao *
4a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * Licensed under the Apache License, Version 2.0 (the "License");
5a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * you may not use this file except in compliance with the License.
6a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * You may obtain a copy of the License at
7a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao *
8a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao *     http://www.apache.org/licenses/LICENSE-2.0
9a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao *
10a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * Unless required by applicable law or agreed to in writing, software
11a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * distributed under the License is distributed on an "AS IS" BASIS,
12a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * See the License for the specific language governing permissions and
14a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * limitations under the License.
15a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao */
16a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao
17a58a8751b4c2ce457f0082a0baaee61312d56195Bai Taopackage android.location;
18a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao
19a58a8751b4c2ce457f0082a0baaee61312d56195Bai Taoimport android.location.Country;
20a58a8751b4c2ce457f0082a0baaee61312d56195Bai Taoimport android.location.ICountryListener;
21a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao
22a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao/**
23a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * The API for detecting the country where the user is.
24a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao *
25a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * {@hide}
26a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao */
27a58a8751b4c2ce457f0082a0baaee61312d56195Bai Taointerface ICountryDetector
28a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao{
29a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao    /**
30a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao     * Start detecting the country that the user is in.
31a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao     * @return the country if it is available immediately, otherwise null will be returned.
32a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao     */
33a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao    Country detectCountry();
34a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao
35a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao    /**
36a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao     * Add a listener to receive the notification when the country is detected or changed.
37a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao     */
38a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao    void addCountryListener(in ICountryListener listener);
39a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao
40a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao    /**
41a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao     * Remove the listener
42a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao     */
43a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao    void removeCountryListener(in ICountryListener listener);
44a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao}