mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-21 19:55:33 -04:00
universal7885: fm-aidl: Always sort the fetched track list
This commit is contained in:
parent
201c4fa92a
commit
6c962d35a8
2 changed files with 3 additions and 0 deletions
|
|
@ -25,6 +25,7 @@
|
|||
#include <cassert>
|
||||
#include <cerrno>
|
||||
#include <chrono>
|
||||
#include <algorithm>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
|
|
@ -140,6 +141,7 @@ namespace aidl::vendor::eureka::hardware::fmradio {
|
|||
search_thread = std::thread([this] {
|
||||
const std::lock_guard<std::timed_mutex> guard(lock);
|
||||
freqs_list = fm_radio_slsi::get_freqs(fd);
|
||||
std::sort(freqs_list.begin(), freqs_list.end(), std::less<int>());
|
||||
});
|
||||
search_thread.detach();
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ constexpr const char *FM_FREQ_SEEK = FM_SYSFS_BASE "/radio_freq_seek";
|
|||
if (std::find(freqs_list.begin(), freqs_list.end(), freq) != freqs_list.end()) continue;
|
||||
freqs_list.push_back(freq);
|
||||
}
|
||||
std::sort(freqs_list.begin(), freqs_list.end(), std::less<int>());
|
||||
});
|
||||
search_thread.detach();
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue