1da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh/* 2da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * Copyright (C) 2013 The Android Open Source Project 3da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * 4da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * Licensed under the Apache License, Version 2.0 (the "License"); 5da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * you may not use this file except in compliance with the License. 6da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * You may obtain a copy of the License at 7da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * 8da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * http://www.apache.org/licenses/LICENSE-2.0 9da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * 10da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * Unless required by applicable law or agreed to in writing, software 11da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * distributed under the License is distributed on an "AS IS" BASIS, 12da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * See the License for the specific language governing permissions and 14da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * limitations under the License. 15da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh */ 16da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh 17da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganeshpackage android.hardware.location; 18da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh 19c4e1e59561884afc2c71b4b52697f62bd6b38f99destradaaimport android.annotation.SystemApi; 20da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganeshimport android.location.Location; 21da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh 22da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh/** 23f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * The callback class associated with the status change of hardware monitors 24da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * in {@link GeofenceHardware} 25c4e1e59561884afc2c71b4b52697f62bd6b38f99destradaa * 26c4e1e59561884afc2c71b4b52697f62bd6b38f99destradaa * @hide 27da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh */ 28c4e1e59561884afc2c71b4b52697f62bd6b38f99destradaa@SystemApi 29da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganeshpublic abstract class GeofenceHardwareMonitorCallback { 30da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh /** 31da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * The callback called when the state of a monitoring system changes. 32da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * {@link GeofenceHardware#MONITORING_TYPE_GPS_HARDWARE} is an example of a 33f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * monitoring system. 34f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * 35f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * @deprecated use {@link #onMonitoringSystemChange(GeofenceHardwareMonitorEvent)} instead. 36f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * NOTE: this API is will remain to be called on Android API 21 and above for backwards 37f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * compatibility. But clients must stop implementing it when updating their code. 38da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * 39da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * @param monitoringType The type of the monitoring system. 40f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * @param available Indicates whether the system is currently available or not. 41da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh * @param location The last known location according to the monitoring system. 42da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh */ 43f9a274c9b8578dda6afeda422bff18b1577028b9destradaa @Deprecated 44da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh public void onMonitoringSystemChange(int monitoringType, boolean available, Location location) { 45da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh } 46f9a274c9b8578dda6afeda422bff18b1577028b9destradaa 47f9a274c9b8578dda6afeda422bff18b1577028b9destradaa /** 48f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * The callback called when the sate of a monitoring system changes. 49f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * {@link GeofenceHardware#MONITORING_TYPE_GPS_HARDWARE} is an example of a monitoring system. 50f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * {@link GeofenceHardware#MONITOR_CURRENTLY_AVAILABLE} is an example of a monitoring status. 51f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * {@link GeofenceHardware#SOURCE_TECHNOLOGY_GNSS} is an example of a source. 52f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * 53f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * This callback must be used instead of 54f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * {@link #onMonitoringSystemChange(int, boolean, android.location.Location)}. 55f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * 56f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * NOTE: this API is only called on Android API 21 and above. 57f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * 58f9a274c9b8578dda6afeda422bff18b1577028b9destradaa * @param event An object representing the monitoring system change event. 59f9a274c9b8578dda6afeda422bff18b1577028b9destradaa */ 60f9a274c9b8578dda6afeda422bff18b1577028b9destradaa public void onMonitoringSystemChange(GeofenceHardwareMonitorEvent event) {} 61da6508954a492f3dd4397e70e4fa08ee54bd2741Jaikumar Ganesh} 62