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

Commit 28628969 authored by RD Babiera's avatar RD Babiera
Browse files

USB: remove empty stats logging for compliance warnings

Removes a call to FrameworkStatsLog.write when mUsbPortStatus
is null or when compliance warnings array is empty.

Test: atest CtsStatsdAtomHostTestCases:UsbStatsTests
Bug: 269342794
Change-Id: I7f03b66c6c713d8b2afa7905a962a458cce285fe
parent 6f7a3562
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -1362,12 +1362,10 @@ public class UsbPortManager implements IBinder.DeathRecipient {
        }
    }

    // Need to create new version to prevent double counting existing stats due
    // to new broadcast
    private void logToStatsdComplianceWarnings(PortInfo portInfo) {
        if (portInfo.mUsbPortStatus == null) {
            FrameworkStatsLog.write(FrameworkStatsLog.USB_COMPLIANCE_WARNINGS_REPORTED,
                portInfo.mUsbPort.getId(), new int[0]);
        // Don't report if there isn't anything to report
        if (portInfo.mUsbPortStatus == null
                || portInfo.mUsbPortStatus.getComplianceWarnings().length == 0) {
            return;
        }