Return an empty batch when there is no location to return

Bug: 205200767
Test: atest LocationManagerFineTest#testRequestFlush_Gnss
Change-Id: I98841f1e83e39289f0e09517d572041ecb058d07
This commit is contained in:
Yu-Han Yang 2021-11-05 15:18:55 -07:00
parent 75eefcda05
commit e7b8ac382e

View file

@ -78,9 +78,6 @@ ndk::ScopedAStatus GnssBatching::start(int64_t periodNanos, int flags) {
ndk::ScopedAStatus GnssBatching::flush() {
ALOGD("flush");
if (mBatchedLocations.empty()) {
return ndk::ScopedAStatus::ok();
}
std::vector<GnssLocation> copy = std::vector<GnssLocation>(mBatchedLocations);
ndk::ScopedAStatus status;
if (sCallback != nullptr) {