Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 938dcc88 authored by Amit Mahajan's avatar Amit Mahajan
Browse files

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

Bug: 26842468
Change-Id: I3a5f7c8e454e7b9ace20f8082ee3fd1d0a24eb64
parent 24c5e7c4
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -48,7 +48,9 @@ public class ModemActivityInfo implements Parcelable {
        mTimestamp = timestamp;
        mSleepTimeMs = sleepTimeMs;
        mIdleTimeMs = idleTimeMs;
        if (txTimeMs != null) {
            System.arraycopy(txTimeMs, 0, mTxTimeMs, 0, Math.min(txTimeMs.length, TX_POWER_LEVELS));
        }
        mRxTimeMs = rxTimeMs;
        mEnergyUsed = energyUsed;
    }