summaryrefslogtreecommitdiff
path: root/location
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-12-19 22:15:02 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-12-19 22:15:02 +0000
commit8cb0e1cfb7e21c74d7511d9c99530a837142d3e4 (patch)
treeeedf391b24224c02e0bbc4c3f6678bb3c4b00280 /location
parent6ccb6305e95fae3b994e91af4f7ff1c8ac0b8f6a (diff)
parent13cde9694d660c925480b1648955ac32f036a5bf (diff)
Merge "Provide defaults and annotations for LocationListener"
Diffstat (limited to 'location')
-rw-r--r--location/java/android/location/LocationListener.java25
1 files changed, 11 insertions, 14 deletions
diff --git a/location/java/android/location/LocationListener.java b/location/java/android/location/LocationListener.java
index aa9dddc03515..8df08345c79b 100644
--- a/location/java/android/location/LocationListener.java
+++ b/location/java/android/location/LocationListener.java
@@ -16,6 +16,7 @@
package android.location;
+import android.annotation.NonNull;
import android.os.Bundle;
/**
@@ -37,36 +38,32 @@ public interface LocationListener {
/**
* Called when the location has changed.
*
- * <p> There are no restrictions on the use of the supplied Location object.
- *
- * @param location The new location, as a Location object.
+ * @param location the updated location
*/
- void onLocationChanged(Location location);
+ void onLocationChanged(@NonNull Location location);
/**
- * This callback will never be invoked and providers can be considers as always in the
- * {@link LocationProvider#AVAILABLE} state.
+ * This callback will never be invoked on Android Q and above, and providers can be considered
+ * as always in the {@link LocationProvider#AVAILABLE} state.
*
- * @deprecated This callback will never be invoked.
+ * @deprecated This callback will never be invoked on Android Q and above.
*/
@Deprecated
- void onStatusChanged(String provider, int status, Bundle extras);
+ default void onStatusChanged(String provider, int status, Bundle extras) {}
/**
* Called when the provider is enabled by the user.
*
- * @param provider the name of the location provider associated with this
- * update.
+ * @param provider the name of the location provider that has become enabled
*/
- void onProviderEnabled(String provider);
+ default void onProviderEnabled(@NonNull String provider) {}
/**
* Called when the provider is disabled by the user. If requestLocationUpdates
* is called on an already disabled provider, this method is called
* immediately.
*
- * @param provider the name of the location provider associated with this
- * update.
+ * @param provider the name of the location provider that has become disabled
*/
- void onProviderDisabled(String provider);
+ default void onProviderDisabled(@NonNull String provider) {}
}