Quick fix: fix bug when using binary search,

Bug: 296507968
Test: Manual
Change-Id: I644160cf97e4873a2cf7c88dc2ff1fd6c0c94d33
This commit is contained in:
Yiyi Shen
2023-09-20 18:33:55 +08:00
parent d835649147
commit 9a05a180fa

View File

@@ -142,7 +142,7 @@ public class FastPairDevicePreferenceController extends BasePreferenceController
// The insertion point is defined as the point at which the key would be inserted into the
// list: the index of the first element greater than the key, or list.size() if all elements
// in the list are less than the specified key.
if (idx > 0) {
if (idx >= 0) {
if (DEBUG) {
Log.d(TAG, "onDeviceAdd receives duplicate preference. Ignore.");
}