Add debug log for tracking NPE of mMobileIfaces

Test: TH
Bug: 192758557
Change-Id: Ib048c18b1c64627de5a9d2b04d10e084a014ff64
This commit is contained in:
Junyu Lai
2021-07-26 09:16:59 +00:00
parent 3a7f671f45
commit 73993fbb68

View File

@@ -934,6 +934,11 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
@Override
public String[] getMobileIfaces() {
// TODO (b/192758557): Remove debug log.
if (ArrayUtils.contains(mMobileIfaces, null)) {
throw new NullPointerException(
"null element in mMobileIfaces: " + Arrays.toString(mMobileIfaces));
}
return mMobileIfaces.clone();
}
@@ -1383,6 +1388,11 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
}
mMobileIfaces = mobileIfaces.toArray(new String[0]);
// TODO (b/192758557): Remove debug log.
if (ArrayUtils.contains(mMobileIfaces, null)) {
throw new NullPointerException(
"null element in mMobileIfaces: " + Arrays.toString(mMobileIfaces));
}
}
private static int getSubIdForMobile(@NonNull NetworkStateSnapshot state) {