11af4b0280af406cfc7eb46810f6b76e57b983e11destradaa/*
21af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Copyright (C) 2013 The Android Open Source Project
31af4b0280af406cfc7eb46810f6b76e57b983e11destradaa *
41af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Licensed under the Apache License, Version 2.0 (the "License");
51af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * you may not use this file except in compliance with the License.
61af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * You may obtain a copy of the License at
71af4b0280af406cfc7eb46810f6b76e57b983e11destradaa *
81af4b0280af406cfc7eb46810f6b76e57b983e11destradaa *      http://www.apache.org/licenses/LICENSE-2.0
91af4b0280af406cfc7eb46810f6b76e57b983e11destradaa *
101af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Unless required by applicable law or agreed to in writing, software
111af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * distributed under the License is distributed on an "AS IS" BASIS,
121af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
131af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * See the License for the specific language governing permissions and
141af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * limitations under the License.
151af4b0280af406cfc7eb46810f6b76e57b983e11destradaa */
161af4b0280af406cfc7eb46810f6b76e57b983e11destradaa
171af4b0280af406cfc7eb46810f6b76e57b983e11destradaapackage com.android.location.provider;
181af4b0280af406cfc7eb46810f6b76e57b983e11destradaa
191af4b0280af406cfc7eb46810f6b76e57b983e11destradaaimport android.location.Location;
201af4b0280af406cfc7eb46810f6b76e57b983e11destradaa
211af4b0280af406cfc7eb46810f6b76e57b983e11destradaa/**
221af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Base class for sinks to interact with FusedLocationHardware.
23ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie *
24ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie * <p>Default implementations allow new methods to be added without crashing
25ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie * clients compiled against an old library version.
261af4b0280af406cfc7eb46810f6b76e57b983e11destradaa */
27ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christiepublic class FusedLocationHardwareSink {
28ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie    /**
29ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie     * Called when one or more locations are available from the FLP
30ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie     * HAL.
31ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie     */
32ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie    public void onLocationAvailable(Location[] locations) {
33ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie        // default do nothing
34ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie    }
35ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie
36ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie    /**
37ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie     * Called when diagnostic data is available from the FLP HAL.
38ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie     */
39ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie    public void onDiagnosticDataAvailable(String data) {
40ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie        // default do nothing
41ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie    }
42ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie
43ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie    /**
44ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie     * Called when capabilities are available from the FLP HAL.
45ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie     * Should be called once right after initialization.
46ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie     *
47ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie     * @param capabilities A bitmask of capabilities defined in
48ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie     *                     fused_location.h.
491af4b0280af406cfc7eb46810f6b76e57b983e11destradaa     */
50ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie    public void onCapabilities(int capabilities) {
51ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie        // default do nothing
52ffca45a2cdd778e6edd5c3959bf53c6192b7e035David Christie    }
5315003f19e5e5a443222569401f167a3ac0e1de3aDavid Christie
5415003f19e5e5a443222569401f167a3ac0e1de3aDavid Christie    /**
5515003f19e5e5a443222569401f167a3ac0e1de3aDavid Christie     * Called when the status changes in the underlying FLP HAL
5615003f19e5e5a443222569401f167a3ac0e1de3aDavid Christie     * implementation (the ability to compute location).  This
57cfc9b6d6ab3c622ea4f9d06c28d6e0d2055d98e1David Christie     * callback will only be made on version 2 or later
58cfc9b6d6ab3c622ea4f9d06c28d6e0d2055d98e1David Christie     * (see {@link FusedLocationHardware#getVersion()}).
5915003f19e5e5a443222569401f167a3ac0e1de3aDavid Christie     *
6015003f19e5e5a443222569401f167a3ac0e1de3aDavid Christie     * @param status One of FLP_STATUS_LOCATION_AVAILABLE or
6115003f19e5e5a443222569401f167a3ac0e1de3aDavid Christie     *               FLP_STATUS_LOCATION_UNAVAILABLE as defined in
6215003f19e5e5a443222569401f167a3ac0e1de3aDavid Christie     *               fused_location.h.
6315003f19e5e5a443222569401f167a3ac0e1de3aDavid Christie     */
6415003f19e5e5a443222569401f167a3ac0e1de3aDavid Christie    public void onStatusChanged(int status) {
6515003f19e5e5a443222569401f167a3ac0e1de3aDavid Christie        // default do nothing
6615003f19e5e5a443222569401f167a3ac0e1de3aDavid Christie    }
671af4b0280af406cfc7eb46810f6b76e57b983e11destradaa}