Loading location/java/android/location/LocationManager.java +9 −7 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.util.ArrayMap; import android.util.Log; import com.android.internal.location.ProviderProperties; import com.android.internal.util.Preconditions; import java.util.ArrayList; import java.util.List; Loading Loading @@ -2298,18 +2299,19 @@ public class LocationManager { } /** * Sends additional commands to a location provider. * Can be used to support provider specific extensions to the Location Manager API * Sends additional commands to a location provider. Can be used to support provider specific * extensions to the Location Manager API. * * @param provider name of the location provider. * @param command name of the command to send to the provider. * @param extras optional arguments for the command (or null). * The provider may optionally fill the extras Bundle with results from the command. * * @return true if the command succeeds. * @return true always */ public boolean sendExtraCommand( @NonNull String provider, @NonNull String command, @Nullable Bundle extras) { Preconditions.checkArgument(provider != null, "invalid null provider"); Preconditions.checkArgument(command != null, "invalid null command"); try { return mService.sendExtraCommand(provider, command, extras); } catch (RemoteException e) { Loading services/core/java/com/android/server/LocationManagerService.java +3 −6 Original line number Diff line number Diff line Loading @@ -1098,12 +1098,9 @@ public class LocationManagerService extends ILocationManager.Stub { @GuardedBy("mLock") public void sendExtraCommandLocked(String command, Bundle extras) { if (mProvider != null) { long identity = Binder.clearCallingIdentity(); try { // intentionally do not clear binder identity so that providers can evaluate who // is sending the extra command mProvider.sendExtraCommand(command, extras); } finally { Binder.restoreCallingIdentity(identity); } } } Loading services/core/java/com/android/server/location/AbstractLocationProvider.java +4 −1 Original line number Diff line number Diff line Loading @@ -142,6 +142,9 @@ public abstract class AbstractLocationProvider { return 0; } /** Sends a custom command to this provider. */ /** * Sends a custom command to this provider. Called with the original binder identity of the * caller. */ public abstract void sendExtraCommand(String command, Bundle extras); } Loading
location/java/android/location/LocationManager.java +9 −7 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.util.ArrayMap; import android.util.Log; import com.android.internal.location.ProviderProperties; import com.android.internal.util.Preconditions; import java.util.ArrayList; import java.util.List; Loading Loading @@ -2298,18 +2299,19 @@ public class LocationManager { } /** * Sends additional commands to a location provider. * Can be used to support provider specific extensions to the Location Manager API * Sends additional commands to a location provider. Can be used to support provider specific * extensions to the Location Manager API. * * @param provider name of the location provider. * @param command name of the command to send to the provider. * @param extras optional arguments for the command (or null). * The provider may optionally fill the extras Bundle with results from the command. * * @return true if the command succeeds. * @return true always */ public boolean sendExtraCommand( @NonNull String provider, @NonNull String command, @Nullable Bundle extras) { Preconditions.checkArgument(provider != null, "invalid null provider"); Preconditions.checkArgument(command != null, "invalid null command"); try { return mService.sendExtraCommand(provider, command, extras); } catch (RemoteException e) { Loading
services/core/java/com/android/server/LocationManagerService.java +3 −6 Original line number Diff line number Diff line Loading @@ -1098,12 +1098,9 @@ public class LocationManagerService extends ILocationManager.Stub { @GuardedBy("mLock") public void sendExtraCommandLocked(String command, Bundle extras) { if (mProvider != null) { long identity = Binder.clearCallingIdentity(); try { // intentionally do not clear binder identity so that providers can evaluate who // is sending the extra command mProvider.sendExtraCommand(command, extras); } finally { Binder.restoreCallingIdentity(identity); } } } Loading
services/core/java/com/android/server/location/AbstractLocationProvider.java +4 −1 Original line number Diff line number Diff line Loading @@ -142,6 +142,9 @@ public abstract class AbstractLocationProvider { return 0; } /** Sends a custom command to this provider. */ /** * Sends a custom command to this provider. Called with the original binder identity of the * caller. */ public abstract void sendExtraCommand(String command, Bundle extras); }