Fix TetheredClient and TetheredClientTest
- Ensure that addAddresses preserves the ordering of addresses - Fix assertion that was supposed to check equality of TetheredClient with a different tethering type, and used the same type. Bug: 148996181 Test: atest TetheringTests Change-Id: I86cef7b834d7ae7afa3d1d748ccac6b3a7e57ebc
This commit is contained in:
@@ -25,7 +25,7 @@ import android.os.Parcelable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -83,7 +83,7 @@ public final class TetheredClient implements Parcelable {
|
||||
* @hide
|
||||
*/
|
||||
public TetheredClient addAddresses(@NonNull TetheredClient other) {
|
||||
final HashSet<AddressInfo> newAddresses = new HashSet<>(
|
||||
final LinkedHashSet<AddressInfo> newAddresses = new LinkedHashSet<>(
|
||||
mAddresses.size() + other.mAddresses.size());
|
||||
newAddresses.addAll(mAddresses);
|
||||
newAddresses.addAll(other.mAddresses);
|
||||
|
||||
Reference in New Issue
Block a user