Remove newly added remove methods in Location and deprecate the old ones, this is the request from the android API council
Test: Existing unit tests still pass.
BUG: 36552859
Change-Id: Ib4cdcef90be3d5b3be329dd780bcb40275b89ef4
diff --git a/api/current.txt b/api/current.txt
index b51ea54..16069c6 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -20800,13 +20800,10 @@
method public boolean hasSpeedAccuracy();
method public boolean hasVerticalAccuracy();
method public boolean isFromMockProvider();
- method public void removeAccuracy();
- method public void removeAltitude();
- method public void removeBearing();
- method public void removeBearingAccuracy();
- method public void removeSpeed();
- method public void removeSpeedAccuracy();
- method public void removeVerticalAccuracy();
+ method public deprecated void removeAccuracy();
+ method public deprecated void removeAltitude();
+ method public deprecated void removeBearing();
+ method public deprecated void removeSpeed();
method public void reset();
method public void set(android.location.Location);
method public void setAccuracy(float);
diff --git a/api/removed.txt b/api/removed.txt
index 0f5b81a..dd94afd 100644
--- a/api/removed.txt
+++ b/api/removed.txt
@@ -126,6 +126,16 @@
}
+package android.location {
+
+ public class Location implements android.os.Parcelable {
+ method public deprecated void removeBearingAccuracy();
+ method public deprecated void removeSpeedAccuracy();
+ method public deprecated void removeVerticalAccuracy();
+ }
+
+}
+
package android.media {
public final class AudioFormat implements android.os.Parcelable {
diff --git a/api/system-current.txt b/api/system-current.txt
index dc4c21f..4057b97 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -22534,13 +22534,10 @@
method public boolean isComplete();
method public boolean isFromMockProvider();
method public void makeComplete();
- method public void removeAccuracy();
- method public void removeAltitude();
- method public void removeBearing();
- method public void removeBearingAccuracy();
- method public void removeSpeed();
- method public void removeSpeedAccuracy();
- method public void removeVerticalAccuracy();
+ method public deprecated void removeAccuracy();
+ method public deprecated void removeAltitude();
+ method public deprecated void removeBearing();
+ method public deprecated void removeSpeed();
method public void reset();
method public void set(android.location.Location);
method public void setAccuracy(float);
diff --git a/api/system-removed.txt b/api/system-removed.txt
index 823d88f..ebdbfe5 100644
--- a/api/system-removed.txt
+++ b/api/system-removed.txt
@@ -124,6 +124,16 @@
}
+package android.location {
+
+ public class Location implements android.os.Parcelable {
+ method public deprecated void removeBearingAccuracy();
+ method public deprecated void removeSpeedAccuracy();
+ method public deprecated void removeVerticalAccuracy();
+ }
+
+}
+
package android.media {
public final class AudioFormat implements android.os.Parcelable {
diff --git a/api/test-current.txt b/api/test-current.txt
index 88adb6e..958750a 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -20906,13 +20906,10 @@
method public boolean hasSpeedAccuracy();
method public boolean hasVerticalAccuracy();
method public boolean isFromMockProvider();
- method public void removeAccuracy();
- method public void removeAltitude();
- method public void removeBearing();
- method public void removeBearingAccuracy();
- method public void removeSpeed();
- method public void removeSpeedAccuracy();
- method public void removeVerticalAccuracy();
+ method public deprecated void removeAccuracy();
+ method public deprecated void removeAltitude();
+ method public deprecated void removeBearing();
+ method public deprecated void removeSpeed();
method public void reset();
method public void set(android.location.Location);
method public void setAccuracy(float);
diff --git a/api/test-removed.txt b/api/test-removed.txt
index 0f5b81a..dd94afd 100644
--- a/api/test-removed.txt
+++ b/api/test-removed.txt
@@ -126,6 +126,16 @@
}
+package android.location {
+
+ public class Location implements android.os.Parcelable {
+ method public deprecated void removeBearingAccuracy();
+ method public deprecated void removeSpeedAccuracy();
+ method public deprecated void removeVerticalAccuracy();
+ }
+
+}
+
package android.media {
public final class AudioFormat implements android.os.Parcelable {
diff --git a/location/java/android/location/Location.java b/location/java/android/location/Location.java
index b222a6d..68f46ad 100644
--- a/location/java/android/location/Location.java
+++ b/location/java/android/location/Location.java
@@ -646,7 +646,10 @@
*
* <p>Following this call {@link #hasAltitude} will return false,
* and {@link #getAltitude} will return 0.0.
+ *
+ * @deprecated use a new Location object for location updates.
*/
+ @Deprecated
public void removeAltitude() {
mAltitude = 0.0f;
mFieldsMask &= ~HAS_ALTITUDE_MASK;
@@ -683,7 +686,10 @@
*
* <p>Following this call {@link #hasSpeed} will return false,
* and {@link #getSpeed} will return 0.0.
+ *
+ * @deprecated use a new Location object for location updates.
*/
+ @Deprecated
public void removeSpeed() {
mSpeed = 0.0f;
mFieldsMask &= ~HAS_SPEED_MASK;
@@ -733,7 +739,10 @@
*
* <p>Following this call {@link #hasBearing} will return false,
* and {@link #getBearing} will return 0.0.
+ *
+ * @deprecated use a new Location object for location updates.
*/
+ @Deprecated
public void removeBearing() {
mBearing = 0.0f;
mFieldsMask &= ~HAS_BEARING_MASK;
@@ -790,7 +799,10 @@
*
* <p>Following this call {@link #hasAccuracy} will return false, and
* {@link #getAccuracy} will return 0.0.
+ *
+ * @deprecated use a new Location object for location updates.
*/
+ @Deprecated
public void removeAccuracy() {
mHorizontalAccuracyMeters = 0.0f;
mFieldsMask &= ~HAS_HORIZONTAL_ACCURACY_MASK;
@@ -839,7 +851,11 @@
*
* <p>Following this call {@link #hasVerticalAccuracy} will return false, and
* {@link #getVerticalAccuracyMeters} will return 0.0.
+ *
+ * @deprecated use a new Location object for location updates.
+ * @removed
*/
+ @Deprecated
public void removeVerticalAccuracy() {
mVerticalAccuracyMeters = 0.0f;
mFieldsMask &= ~HAS_VERTICAL_ACCURACY_MASK;
@@ -883,7 +899,11 @@
*
* <p>Following this call {@link #hasSpeedAccuracy} will return false, and
* {@link #getSpeedAccuracyMetersPerSecond} will return 0.0.
+ *
+ * @deprecated use a new Location object for location updates.
+ * @removed
*/
+ @Deprecated
public void removeSpeedAccuracy() {
mSpeedAccuracyMetersPerSecond = 0.0f;
mFieldsMask &= ~HAS_SPEED_ACCURACY_MASK;
@@ -927,7 +947,11 @@
*
* <p>Following this call {@link #hasBearingAccuracy} will return false, and
* {@link #getBearingAccuracyDegrees} will return 0.0.
+ *
+ * @deprecated use a new Location object for location updates.
+ * @removed
*/
+ @Deprecated
public void removeBearingAccuracy() {
mBearingAccuracyDegrees = 0.0f;
mFieldsMask &= ~HAS_BEARING_ACCURACY_MASK;