diff --git a/api/current.txt b/api/current.txt index 54e4234ad8737..8dc7ef45b277e 100644 --- a/api/current.txt +++ b/api/current.txt @@ -47004,7 +47004,7 @@ package android.telephony { public abstract class CellLocation { ctor public CellLocation(); method public static android.telephony.CellLocation getEmpty(); - method public static void requestLocationUpdate(); + method @Deprecated public static void requestLocationUpdate(); } public abstract class CellSignalStrength { diff --git a/non-updatable-api/current.txt b/non-updatable-api/current.txt index 8e01620d8bb24..52676c70c55d4 100644 --- a/non-updatable-api/current.txt +++ b/non-updatable-api/current.txt @@ -45172,7 +45172,7 @@ package android.telephony { public abstract class CellLocation { ctor public CellLocation(); method public static android.telephony.CellLocation getEmpty(); - method public static void requestLocationUpdate(); + method @Deprecated public static void requestLocationUpdate(); } public abstract class CellSignalStrength { diff --git a/telephony/java/android/telephony/CellLocation.java b/telephony/java/android/telephony/CellLocation.java index 4e4abd0f63b03..aa1230165e13b 100644 --- a/telephony/java/android/telephony/CellLocation.java +++ b/telephony/java/android/telephony/CellLocation.java @@ -46,7 +46,14 @@ public abstract class CellLocation { * * Callers wishing to request a single location update should use * {@link TelephonyManager#requestCellInfoUpdate}. + * + * @deprecated this method has undesirable side-effects, and it calls into the OS without + * access to a {@link android.content.Context Context}, meaning that certain safety checks and + * attribution are error-prone. Given that this method has numerous downsides, and given that + * there are long-available superior alternatives, callers are strongly discouraged from using + * this method. */ + @Deprecated public static void requestLocationUpdate() { // Since this object doesn't have a context, this is the best we can do. final Context appContext = ActivityThread.currentApplication();