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

Commit 9e59f93a authored by Chenjie Yu's avatar Chenjie Yu
Browse files

Null pointer check for Bluetooth traffic

Bug: 77340376
Change-Id: I558c020636564437e040097a2d0f86519c343c4a
Fix: 77340376
Test: manual test
parent ae202c6f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ bool StatsPuller::Pull(const int64_t elapsedTimeNs, std::vector<std::shared_ptr<
        data->setElapsedTimestampNs(elapsedTimeNs);
        data->setLogdWallClockTimestampNs(wallClockTimeNs);
    }
    if (ret) {
    if (ret && mCachedData.size() > 0) {
      mergeIsolatedUidsToHostUid(mCachedData, mUidMap, mTagId);
      (*data) = mCachedData;
    }
+8 −6
Original line number Diff line number Diff line
@@ -658,6 +658,7 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
    private void pullBluetoothBytesTransfer(int tagId, List<StatsLogEventWrapper> pulledData) {
        BluetoothActivityEnergyInfo info = pullBluetoothData();
        long elapsedNanos = SystemClock.elapsedRealtimeNanos();
        if (info.getUidTraffic() != null) {
            for (UidTraffic traffic : info.getUidTraffic()) {
                StatsLogEventWrapper e = new StatsLogEventWrapper(elapsedNanos, tagId, 3);
                e.writeInt(traffic.getUid());
@@ -666,6 +667,7 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
                pulledData.add(e);
            }
        }
    }

    private void pullMobileBytesTransferByFgBg(int tagId, List<StatsLogEventWrapper> pulledData) {
        long token = Binder.clearCallingIdentity();