1 /*
2  * Copyright (C) 2013 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 com.android.camera.app;
18 
19 import android.location.Location;
20 
21 /**
22  * A generic interface for a location provider {Fused, GPS, Network}.
23  */
24 public interface LocationProvider {
25 
26     /**
27      * Report when connection fails so another location provider may be used.
28      */
29     public interface OnConnectionFailedListener {
30         /**
31          * Report connection failure.
32          */
onConnectionFailed()33         public void onConnectionFailed();
34     }
35 
36     /**
37      * Get the current location.
38      */
getCurrentLocation()39     public Location getCurrentLocation();
40 
41     /**
42      * Turn on/off recording of location.
43      *
44      * @param recordLocation Whether or not to record location.
45      */
recordLocation(boolean recordLocation)46     public void recordLocation(boolean recordLocation);
47 
48     /**
49      * Disconnect the location provider after use. The location provider can no longer acquire
50      * locations after this has been called.
51      */
disconnect()52     public void disconnect();
53 }