Add toString() method for NetworkScanResult
To enhance debug-ability of NetworkScanResult, the toString() method should return the contents of the structure rather than a stringified reference. Bug: 119055885 Test: NetworkScanResultTest#testParcel Change-Id: Ib4fce53d57d1a1cd3382c65fc2c8cb1b7d6ea92d
This commit is contained in:
@@ -19,6 +19,7 @@ package com.android.internal.telephony;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.telephony.CellInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -105,6 +106,17 @@ public final class NetworkScanResult implements Parcelable {
|
||||
&& networkInfos.equals(nsr.networkInfos));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder()
|
||||
.append("{")
|
||||
.append("scanStatus=" + scanStatus)
|
||||
.append(", scanError=" + scanError)
|
||||
.append(", networkInfos=" + networkInfos)
|
||||
.append("}")
|
||||
.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode () {
|
||||
return ((scanStatus * 31)
|
||||
|
||||
Reference in New Issue
Block a user