1/*
2 * Copyright (C) 2008 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
17package android.hardware;
18
19/**
20 * Used for receiving notifications from the SensorManager when
21 * sensor values have changed.
22 */
23public interface SensorEventListener {
24
25    /**
26     * Called when sensor values have changed.
27     * <p>See {@link android.hardware.SensorManager SensorManager}
28     * for details on possible sensor types.
29     * <p>See also {@link android.hardware.SensorEvent SensorEvent}.
30     *
31     * <p><b>NOTE:</b> The application doesn't own the
32     * {@link android.hardware.SensorEvent event}
33     * object passed as a parameter and therefore cannot hold on to it.
34     * The object may be part of an internal pool and may be reused by
35     * the framework.
36     *
37     * @param event the {@link android.hardware.SensorEvent SensorEvent}.
38     */
39    public void onSensorChanged(SensorEvent event);
40
41    /**
42     * Called when the accuracy of the registered sensor has changed.
43     *
44     * <p>See the SENSOR_STATUS_* constants in
45     * {@link android.hardware.SensorManager SensorManager} for details.
46     *
47     * @param accuracy The new accuracy of this sensor, one of
48     *         {@code SensorManager.SENSOR_STATUS_*}
49     */
50    public void onAccuracyChanged(Sensor sensor, int accuracy);
51}
52