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

Commit f71144e8 authored by Dichen Zhang's avatar Dichen Zhang
Browse files

video: Add null checks for MediaAnalyticsItem class

Check if MediaAnalyticsItem class is valid before
calling any of its functions.

Author: Paras Nagda <pnagda@codeaurora.org>

Bug: 70919418
Test: TBD
Change-Id: I2d5704063b9479301f03d6f57ce74108873ef4cc
parent 0d8553c9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -772,7 +772,7 @@ status_t NuPlayerDriver::setParameter(

status_t NuPlayerDriver::getParameter(int key, Parcel *reply) {

    if (key == FOURCC('m','t','r','X')) {
    if (key == FOURCC('m','t','r','X') && mAnalyticsItem != NULL) {
        // mtrX -- a play on 'metrics' (not matrix)
        // gather current info all together, parcel it, and send it back
        updateMetrics("api");
@@ -1000,7 +1000,7 @@ void NuPlayerDriver::notifyListener_l(
            // when we have an error, add it to the analytics for this playback.
            // ext1 is our primary 'error type' value. Only add ext2 when non-zero.
            // [test against msg is due to fall through from previous switch value]
            if (msg == MEDIA_ERROR) {
            if (msg == MEDIA_ERROR && mAnalyticsItem != NULL) {
                mAnalyticsItem->setInt32(kPlayerError, ext1);
                if (ext2 != 0) {
                    mAnalyticsItem->setInt32(kPlayerErrorCode, ext2);