Removes the necessity for LMS to call back into client code to inform the client that a location listener has been removed. This is replaced with weak references instead, which allows the garbage collector to handle cleanup instead. This simplifies LMS implementation and makes it less buggy. Also includes some rewrites of getCurrentLocation to use a dedicated AIDL interface now that the onRemoved channel is no longer available, as well as various other minor refactors. Test: manual + presubmits Change-Id: Ic61ce278c44e23bc5da5b703f89f6e656e89dea2
29 lines
828 B
Plaintext
29 lines
828 B
Plaintext
/*
|
|
* Copyright (C) 2020, The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
package android.location;
|
|
|
|
import android.location.Location;
|
|
|
|
/**
|
|
* Listener for single locations.
|
|
* {@hide}
|
|
*/
|
|
oneway interface ILocationCallback
|
|
{
|
|
void onLocation(in @nullable Location location);
|
|
}
|