Add a null check before accessing int[] parameter in ModemActivityInfo

Bug: 26842468
Change-Id: I3a5f7c8e454e7b9ace20f8082ee3fd1d0a24eb64
This commit is contained in:
Amit Mahajan
2016-01-28 15:30:39 -08:00
parent 24c5e7c4ce
commit 938dcc88fd

View File

@@ -48,7 +48,9 @@ public class ModemActivityInfo implements Parcelable {
mTimestamp = timestamp;
mSleepTimeMs = sleepTimeMs;
mIdleTimeMs = idleTimeMs;
System.arraycopy(txTimeMs, 0, mTxTimeMs, 0, Math.min(txTimeMs.length, TX_POWER_LEVELS));
if (txTimeMs != null) {
System.arraycopy(txTimeMs, 0, mTxTimeMs, 0, Math.min(txTimeMs.length, TX_POWER_LEVELS));
}
mRxTimeMs = rxTimeMs;
mEnergyUsed = energyUsed;
}