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

Commit 0fbae8b3 authored by Badhri Jagan Sridharan's avatar Badhri Jagan Sridharan
Browse files

Log all Usb accessories

Logs when connecting/disconnect thumbdrive.

01-14 19:58:45.370   918  1009 I statsd  : { uid(1000) 1547524725000000000 338323224430 (77)0x10000->1921[I] 0x20000->21889[I] 0x30000->0[I] 0x40000->0[I] 0x50000->1[I] 0x60000->0[I] 0x70000->10724[L]  }
01-14 20:00:27.471   918  1009 I statsd  : { uid(1000) 1547524827000000000 440424268612 (77)0x10000->1921[I] 0x20000->21889[I] 0x30000->0[I] 0x40000->0[I] 0x50000->1[I] 0x60000->1[I] 0x70000->0[L]  }
01-14 20:00:36.198   918  1009 I statsd  : { uid(1000) 1547524836000000000 449151666148 (77)0x10000->1921[I] 0x20000->21889[I] 0x30000->0[I] 0x40000->0[I] 0x50000->1[I] 0x60000->0[I] 0x70000->8727[L]  }
01-14 20:00:39.401   918  1009 I statsd  : { uid(1000) 1547524839000000000 452354416467 (77)0x10000->1921[I] 0x20000->21889[I] 0x30000->0[I] 0x40000->0[I] 0x50000->1[I] 0x60000->1[I] 0x70000->0[L]  }
01-14 20:00:48.348   918  1009 I statsd  : { uid(1000) 1547524848000000000 461301290587 (77)0x10000->1921[I] 0x20000->21889[I] 0x30000->0[I] 0x40000->0[I] 0x50000->1[I] 0x60000->0[I] 0x70000->8947[L]  }

Bug: 120566491
Test: Manually tested by running: adb shell cmd stats print-logs,
    adb logcat | grep statsd | grep \(77\)
Change-Id: I172964ad592b910fcadf88c84f9cbd9d47f44131
parent 018edf2c
Loading
Loading
Loading
Loading
+9 −13
Original line number Diff line number Diff line
@@ -418,14 +418,12 @@ public class UsbHostManager {
                        parser.getRawDescriptors());

                // Stats collection
                if (parser.hasAudioInterface()) {
                StatsLog.write(StatsLog.USB_DEVICE_ATTACHED, newDevice.getVendorId(),
                        newDevice.getProductId(), parser.hasAudioInterface(),
                        parser.hasHIDInterface(), parser.hasStorageInterface(),
                        StatsLog.USB_DEVICE_ATTACHED__STATE__STATE_CONNECTED, 0);
            }
        }
        }

        if (DEBUG) {
            Slog.d(TAG, "beginUsbDeviceAdded(" + deviceAddress + ") end");
@@ -455,7 +453,6 @@ public class UsbHostManager {
                if (current != null) {
                    UsbDescriptorParser parser = new UsbDescriptorParser(deviceAddress,
                            current.mDescriptors);
                    if (parser.hasAudioInterface()) {
                        // Stats collection
                    StatsLog.write(StatsLog.USB_DEVICE_ATTACHED, device.getVendorId(),
                            device.getProductId(), parser.hasAudioInterface(),
@@ -463,7 +460,6 @@ public class UsbHostManager {
                            StatsLog.USB_DEVICE_ATTACHED__STATE__STATE_DISCONNECTED,
                            System.currentTimeMillis() - current.mTimestamp);
                }
                }
            } else {
                Slog.d(TAG, "Removed device at " + deviceAddress + " was already gone");
            }