commit | 9a05a180fa8e1251154eed7cd5a005ea18bd9441 | [log] [tgz] |
---|---|---|
author | Yiyi Shen <yiyishen@google.com> | Wed Sep 20 18:33:55 2023 +0800 |
committer | Yiyi Shen <yiyishen@google.com> | Wed Sep 20 18:33:55 2023 +0800 |
tree | 98d75db2f5291efc61d877f86d39c2a11b42edbd | |
parent | d835649147db1e1812d9cdf0a5d0fdafb86f23a7 [diff] |
Quick fix: fix bug when using binary search, Bug: 296507968 Test: Manual Change-Id: I644160cf97e4873a2cf7c88dc2ff1fd6c0c94d33
diff --git a/src/com/android/settings/connecteddevice/fastpair/FastPairDevicePreferenceController.java b/src/com/android/settings/connecteddevice/fastpair/FastPairDevicePreferenceController.java index 47b2dae..6a5b6b9 100644 --- a/src/com/android/settings/connecteddevice/fastpair/FastPairDevicePreferenceController.java +++ b/src/com/android/settings/connecteddevice/fastpair/FastPairDevicePreferenceController.java
@@ -142,7 +142,7 @@ // 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."); }