diff options
author | Nathan Harold <nharold@google.com> | 2020-07-10 19:16:01 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2020-07-10 19:16:01 +0000 |
commit | 277f52a0f47c1036a013b39aa680b01316780baa (patch) | |
tree | 6e426e87c9f65810ecea770b42169d03b5433725 | |
parent | a0895c8580a76bded8b52bddeb7a6aaa3c099d08 (diff) | |
parent | bf3fff073f5df4bf0f12e16ea3e4eb84edd71fa3 (diff) |
Merge "Deprecate CellLocation#requestLocationUpdate"
-rw-r--r-- | api/current.txt | 2 | ||||
-rw-r--r-- | non-updatable-api/current.txt | 2 | ||||
-rw-r--r-- | telephony/java/android/telephony/CellLocation.java | 7 |
3 files changed, 9 insertions, 2 deletions
diff --git a/api/current.txt b/api/current.txt index fea1f2f4cac4..f1338f07f294 100644 --- a/api/current.txt +++ b/api/current.txt @@ -45143,7 +45143,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 3ad076f60c08..a28569297832 100644 --- a/non-updatable-api/current.txt +++ b/non-updatable-api/current.txt @@ -44999,7 +44999,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 b32f456581ab..61f68ce32287 100644 --- a/telephony/java/android/telephony/CellLocation.java +++ b/telephony/java/android/telephony/CellLocation.java @@ -47,7 +47,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(); |