Check iface by TextUtils.equals
In current equals method, if iface is null then it will cause null object reference when checking iface. Thus, use TextUtils.equals to check iface so that it can compare null iface. Bug: 210073043 Test: FrameworksNetTests, NetworkStaticLibTests Change-Id: I2bd8127cb030ea54438382ee89961590fffbc31a
This commit is contained in:
@@ -28,6 +28,7 @@ import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.os.Process;
|
||||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
import android.util.SparseBooleanArray;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
@@ -410,7 +411,7 @@ public final class NetworkStats implements Parcelable {
|
||||
&& roaming == e.roaming && defaultNetwork == e.defaultNetwork
|
||||
&& rxBytes == e.rxBytes && rxPackets == e.rxPackets
|
||||
&& txBytes == e.txBytes && txPackets == e.txPackets
|
||||
&& operations == e.operations && iface.equals(e.iface);
|
||||
&& operations == e.operations && TextUtils.equals(iface, e.iface);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user