• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.server.location;
18 
19 import android.content.Context;
20 import android.hardware.location.IFusedLocationHardware;
21 import android.location.IFusedGeofenceHardware;
22 import android.util.Log;
23 
24 /**
25  * This class was an interop layer for JVM types and the JNI code that interacted
26  * with the FLP HAL implementation.
27  *
28  * Now, after Treble FLP & GNSS HAL simplification, it is a thin shell that acts like the
29  * pre-existing cases where there was no FLP Hardware support, to keep legacy users of this
30  * class operating.
31  *
32  * {@hide}
33  * {@Deprecated}
34  */
35 public class FlpHardwareProvider {
36     private static FlpHardwareProvider sSingletonInstance = null;
37 
38     private final static String TAG = "FlpHardwareProvider";
39 
40     private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
41 
getInstance(Context context)42     public static FlpHardwareProvider getInstance(Context context) {
43         if (sSingletonInstance == null) {
44             sSingletonInstance = new FlpHardwareProvider();
45             if (DEBUG) Log.d(TAG, "getInstance() created empty provider");
46         }
47         return sSingletonInstance;
48     }
49 
FlpHardwareProvider()50     private FlpHardwareProvider() {
51     }
52 
isSupported()53     public static boolean isSupported() {
54         if (DEBUG) Log.d(TAG, "isSupported() returning false");
55         return false;
56     }
57 
58     /**
59      * Interface implementations for services built on top of this functionality.
60      */
61     public static final String LOCATION = "Location";
62 
getLocationHardware()63     public IFusedLocationHardware getLocationHardware() {
64         return null;
65     }
66 
getGeofenceHardware()67     public IFusedGeofenceHardware getGeofenceHardware() {
68         return null;
69     }
70 
cleanup()71     public void cleanup() {
72         if (DEBUG) Log.d(TAG, "empty cleanup()");
73     }
74 }
75