Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf3fff07 authored by Nathan Harold's avatar Nathan Harold
Browse files

Deprecate CellLocation#requestLocationUpdate

Remove this method, which is undesirable, has unfortunate
side effects, and which is a worse way of getting the current
location than other methods such as TelephonyManager#getAllCellInfo()
(since KK) and TelephonyManager#requestCellInfoUpdate() (since QT/11).

Bug: 152648516
Test: make update-api && make (docstring-only change)
Change-Id: I3c7d345abcdd8c35cf539d33166ddf76ba987b1c
parent 0459eb7c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 {
+1 −1
Original line number Diff line number Diff line
@@ -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 {
+7 −0
Original line number Diff line number Diff line
@@ -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();