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

Commit fc9c7f85 authored by Soonil Nagarkar's avatar Soonil Nagarkar
Browse files

Remove all code dealing with obsolete location status

Test: manual
Change-Id: I0fde3dd9bdd418ab63c61c5afc093d8eef72e600
parent 190bede0
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -8810,13 +8810,6 @@ public final class Settings {
        public static final String LOCATION_IGNORE_SETTINGS_PACKAGE_WHITELIST =
                "location_ignore_settings_package_whitelist";
        /**
         * Whether to disable location status callbacks in preparation for deprecation.
         * @hide
         */
        public static final String LOCATION_DISABLE_STATUS_CALLBACKS =
                "location_disable_status_callbacks";
        /**
         * Maximum staleness allowed for last location when returned to clients with only foreground
         * location permissions.
+0 −4
Original line number Diff line number Diff line
@@ -107,10 +107,6 @@ interface ILocationManager
    List<LocationRequest> getTestProviderCurrentRequests(String provider, String opPackageName);
    LocationTime getGnssTimeMillis();

    // --- deprecated ---
    void setTestProviderStatus(String provider, int status, in Bundle extras, long updateTime,
            String opPackageName);

    boolean sendExtraCommand(String provider, String command, inout Bundle extras);

    // --- internal ---
+2 −27
Original line number Diff line number Diff line
@@ -1543,44 +1543,19 @@ public class LocationManager {
    /**
     * This method has no effect as provider status has been deprecated and is no longer supported.
     *
     * @param provider the provider name
     * @param status the mock status
     * @param extras a Bundle containing mock extras
     * @param updateTime the mock update time
     *
     * @throws SecurityException if {@link android.app.AppOpsManager#OPSTR_MOCK_LOCATION
     * mock location app op} is not set to {@link android.app.AppOpsManager#MODE_ALLOWED
     * allowed} for your app.
     * @throws IllegalArgumentException if no provider with the given name exists
     *
     * @deprecated This method has no effect.
     */
    @Deprecated
    public void setTestProviderStatus(
            @NonNull String provider, int status, @Nullable Bundle extras, long updateTime) {
        try {
            mService.setTestProviderStatus(provider, status, extras, updateTime,
                    mContext.getOpPackageName());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }
            @NonNull String provider, int status, @Nullable Bundle extras, long updateTime) {}

    /**
     * This method has no effect as provider status has been deprecated and is no longer supported.
     *
     * @param provider the provider name
     * @throws SecurityException if {@link android.app.AppOpsManager#OPSTR_MOCK_LOCATION
     * mock location app op} is not set to {@link android.app.AppOpsManager#MODE_ALLOWED
     * allowed} for your app.
     * @throws IllegalArgumentException if no provider with the given name exists
     *
     * @deprecated This method has no effect.
     */
    @Deprecated
    public void clearTestProviderStatus(@NonNull String provider) {
        setTestProviderStatus(provider, LocationProvider.AVAILABLE, null, 0L);
    }
    public void clearTestProviderStatus(@NonNull String provider) {}

    /**
     * Get the last list of {@link LocationRequest}s sent to the provider.
+0 −6
Original line number Diff line number Diff line
@@ -37,10 +37,4 @@ interface ILocationProvider {

    @UnsupportedAppUsage
    oneway void sendExtraCommand(String command, in Bundle extras);

    // --- deprecated and will be removed the future ---
    @UnsupportedAppUsage
    int getStatus(out Bundle extras);
    @UnsupportedAppUsage
    long getStatusUpdateTime();
}
+0 −30
Original line number Diff line number Diff line
@@ -256,17 +256,6 @@ public abstract class LocationProviderBase {
    /**
     * This method will no longer be invoked.
     *
     * Returns a information on the status of this provider.
     * <p>{@link android.location.LocationProvider#OUT_OF_SERVICE} is returned if the provider is
     * out of service, and this is not expected to change in the near
     * future; {@link android.location.LocationProvider#TEMPORARILY_UNAVAILABLE} is returned if
     * the provider is temporarily unavailable but is expected to be
     * available shortly; and {@link android.location.LocationProvider#AVAILABLE} is returned
     * if the provider is currently available.
     *
     * <p>If extras is non-null, additional status information may be
     * added to it in the form of provider-specific key/value pairs.
     *
     * @deprecated This callback will be never be invoked on Android Q and above. This method should
     * only be implemented in location providers that need to support SDKs below Android Q. This
     * method may be removed in the future.
@@ -279,15 +268,6 @@ public abstract class LocationProviderBase {
    /**
     * This method will no longer be invoked.
     *
     * Returns the time at which the status was last updated. It is the
     * responsibility of the provider to appropriately set this value using
     * {@link android.os.SystemClock#elapsedRealtime SystemClock.elapsedRealtime()}.
     * there is a status update that it wishes to broadcast to all its
     * listeners. The provider should be careful not to broadcast
     * the same status again.
     *
     * @return time of last status update in millis since last reboot
     *
     * @deprecated This callback will be never be invoked on Android Q and above. This method should
     * only be implemented in location providers that need to support SDKs below Android Q. This
     * method may be removed in the future.
@@ -331,16 +311,6 @@ public abstract class LocationProviderBase {
            onSetRequest(new ProviderRequestUnbundled(request), ws);
        }

        @Override
        public int getStatus(Bundle extras) {
            return onGetStatus(extras);
        }

        @Override
        public long getStatusUpdateTime() {
            return onGetStatusUpdateTime();
        }

        @Override
        public void sendExtraCommand(String command, Bundle extras) {
            onSendExtraCommand(command, extras);
Loading