Skip to content
Snippets Groups Projects
  1. Dec 21, 2023
    • Cole Faust's avatar
      List baseline_filename on modules that are implititly using it · 5479e810
      Cole Faust authored
      lintable modules currently pick up files named "lint-baseline.xml" to use as the
      lint baseline implicitly. This is confusing because you could end up using the
      baseline files in more modules than intended. Lint also has a feature where it
      requests you remove unnecessary findings from the baseline file, so something
      could be necessary for one module, but unnecessary for another that accidentally
      picked up the baseline.
      
      We're removing the implicit detection of the baseline file, which requires
      all modules using it to list the baseline file explicitly.
      
      Bug: 272769514
      Test: Presubmits
      Change-Id: I4e74094eed3f5a0b7395bcb5e16cbee9f0f28b7e
      Merged-In: I4e74094eed3f5a0b7395bcb5e16cbee9f0f28b7e
      5479e810
  2. Dec 05, 2023
  3. Nov 14, 2023
  4. Nov 07, 2023
    • Roy Luo's avatar
      Extend USB compliance warning API · fc495445
      Roy Luo authored
      Add USB feature flags and guard the new compliance warning APIs.
      
      Test: atest VtsAidlUsbTargetTest
            atest CtsUsbManagerTestCases
      Bug: 296119135
      Bug: 300340959
      Change-Id: Iffca537a85cb03ab5eeb2ad331a145ef1d2b848a
      fc495445
  5. Sep 26, 2023
  6. Aug 07, 2023
  7. Jun 27, 2023
  8. Jun 26, 2023
    • jiabin's avatar
      Fix USB power regression when connecting USB headset during phone/voip call. · 96fbf175
      jiabin authored
      When a bi-direction USB device plugged in, first connect the output device and then the input device. The policy will prefer the paired input and output device. Connecting USB output device first can make the USB input device be used for phone/voip call once it is available.
      
      Also cache if the USB device support jack detect to avoid opening mixer when the jack detect is not supported.
      
      Bug: 282094846
      Test: make
      Test: repo steps in the bug
      Change-Id: I7cc10b63c887493da284c8fad4384ee68bfd9337
      96fbf175
  9. Jun 15, 2023
  10. May 30, 2023
    • jiabin's avatar
      USB: update logic for reporting playback and capture capability of USB devices. · e8e0134c
      jiabin authored
      Report USB devices support audio capture when there is a terminal whose
      subtype is ACI_OUTPUT_TERMINAL and terminal type is USB streaming and
      there is another terminal whose subtype is ACI_INPUT_TERMINAL and
      terminal type is not USB streaming.
      
      Report USB devices support audio playback when there is a terminal whose
      subtype is ACI_INPUT_TERMINAL and terminal type is USB streaming and
      there is another terminal whose subtype is ACI_OUTPUT_TERMINAL and
      terminal type is not USB streaming.
      
      Bug: 279151646
      Bug: 278603582
      Test: connect usb headset, dumpsys audio policy
      Change-Id: If1c14cc0a4e3fbdfbed2c105d37ece9a866f18ed
      Merged-In: If1c14cc0a4e3fbdfbed2c105d37ece9a866f18ed
      (cherry picked from commit 9a5cab13)
      e8e0134c
  11. May 24, 2023
  12. May 09, 2023
  13. May 08, 2023
  14. Apr 25, 2023
    • jiabin's avatar
      USB: update logic for reporting playback and capture capability of USB devices. · 9a5cab13
      jiabin authored
      Report USB devices support audio capture when there is a terminal whose
      subtype is ACI_OUTPUT_TERMINAL and terminal type is USB streaming and
      there is another terminal whose subtype is ACI_INPUT_TERMINAL and
      terminal type is not USB streaming.
      
      Report USB devices support audio playback when there is a terminal whose
      subtype is ACI_INPUT_TERMINAL and terminal type is USB streaming and
      there is another terminal whose subtype is ACI_OUTPUT_TERMINAL and
      terminal type is not USB streaming.
      
      Bug: 279151646
      Test: connect usb headset, dumpsys audio policy
      Change-Id: If1c14cc0a4e3fbdfbed2c105d37ece9a866f18ed
      9a5cab13
  15. Apr 11, 2023
    • jiabin's avatar
      Multiple USB support. · 96dce366
      jiabin authored
      By reading system property ro.audio.multi_usb_mode to decide if only one
      or multiple usb devices can be connected to audio system at a certain
      time.
      In multi USB mode, it is allowed to connect multiple USB devices to
      audio system as long as their device type is different.
      
      Bug: 262415494
      Test: manual
      Change-Id: I10d6ea14188105b4cd96ed0973dbea1f3e80a852
      96dce366
  16. Apr 03, 2023
    • mattgilbride's avatar
      @EnforcePermission migrations - services.usb · a1d46b7e
      mattgilbride authored
      Migrates call sites to use the @EnforcePermission annotation
      instead of manually checking permissions.
      
      These are fully behavior-preserving changes that can be identified by
      Android Lint (see SimpleManualPermissionEnforcementDetector)
      
      Bug: 265014041
      Test: TH
      Change-Id: Icd25c77e971e30c233bfa233b2dca587ace36bc5
      a1d46b7e
  17. Mar 09, 2023
    • RD Babiera's avatar
      USB: remove empty stats logging for compliance warnings · 28628969
      RD Babiera authored
      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
      28628969
  18. Mar 07, 2023
  19. Feb 22, 2023
    • Robert Wu's avatar
      USB MIDI: Multijack MIDI 1.0 for MIDI 2.0 devices · 88e10487
      Robert Wu authored
      MIDI 2.0 devices only show one input and output port for its backup
      MIDI 1.0 path. This CL reads the jack counts and creates encoders
      and decoders accordingly.
      
      UsbMidiPacketConverter has been refactored to use cable numbers for
      multiplexing USB MIDI streams.
      
      Bug: 266473128
      Test: MidiScope/MidiKeyboard on multiport MIDI device
      Test: UmpMidiScope on MIDI 2.0 devices
      Change-Id: I58799393ab0bddf7c6a6c63f1ab014accf1ab10e
      88e10487
  20. Feb 21, 2023
    • Robert Wu's avatar
      USB MIDI: Fix incorrect timestamps · c9da3f78
      Robert Wu authored
      Timestamp is calculated before waiting for USB data. When USB data comes in,
      the timestamp from when it starts to wait is used. This makes the timestamp
      very inaccurate.
      
      The fix is to move "timestamp = System.nanoTime()" after getting the USB
      response.
      
      Bug: 267519645
      Test: Connect phone with MIDI Scope app to USB MIDI 2.0 keyboard
      Test: Play notes on the keyboard and verify timestamps look reasonable
      Change-Id: Ic3bccd89b65787badf3139964983572f83d99eaa
      c9da3f78
  21. Feb 07, 2023
    • Andrei Onea's avatar
      Remove static dependency on usb gadget aidl libs · 5be6fe38
      Andrei Onea authored
      These libraries are already part of framework.jar, so there's no need to
      duplicate them in services.jar.
      
      Bug: 266855401
      Test: atest StrictJavaPackagesTest
      Change-Id: Ia23b12e0b00d5ba7ff81ccc4fdc34f8e4e63db5b
      5be6fe38
  22. Feb 06, 2023
    • Ricky Niu's avatar
      Add resetCb · 143de4a5
      Ricky Niu authored
      Add the resetCb to complete asynchronous
      
      Bug: 267252826
      Test: Boot to home and function work
      Change-Id: I52291bb89951339ac26e41f9ca3a63abaeb78fef
      143de4a5
  23. Feb 04, 2023
    • Avichal Rakesh's avatar
      Usb: Add UVC support to UsbManager and UsbDeviceManager · 16f4589a
      Avichal Rakesh authored
      This CL adds support for UVC gadget function in USB System service.
      
      Bug: 242344221
      Test: Manually tested that the UVC function can be enabled when needed.
      API-Coverage-Bug: 267667903
      Change-Id: Ifd93f065426a224274ec39f53366dd6e3fee0bfa
      16f4589a
  24. Jan 26, 2023
    • Robert Wu's avatar
      USB MIDI: Rename as UsbAlsaMidiDevice · 8e7bf0ff
      Robert Wu authored
      UsbMidiDevice is a confusing name for the ALSA MIDI path when
      UsbDirectMidiDevice exists. This CL renames UsbMidiDevice as
      UsbAlsaMidiDevice.
      
      Bug: 266753421
      Test: MIDI Keyboard and MIDI Scope
      Change-Id: I6aca2b9c10043bcaa28fee1066cbece66578397a
      8e7bf0ff
    • Robert Wu's avatar
      USB MIDI: Add more info to MIDI Endpoints · a7dee5d9
      Robert Wu authored
      Add more info to MIDI endpoint descriptors.
      
      Bug: 266473128
      Test: adb shell dumpsys usb dump-descriptors -dump-list
      Change-Id: I047b542f34de97b72b429454c7592dda8c1d2884
      a7dee5d9
  25. Jan 25, 2023
    • RD Babiera's avatar
      Add hpd and link training status to displayport alt mode api · f1570be6
      RD Babiera authored
      Adds isHotPlugDetectActive() and getLinkTraining() status to
      DisplayPortAltModeInfo as well as necessary enums within
      LINK_TRAINING_STATUS_
      
      Test: atest CtsUsbManagerTestCases
      Bug: 253534975
      Change-Id: Ibbd3cd979b352f49819a7da01f030abfcae66444
      f1570be6
  26. Jan 24, 2023
    • jiabin's avatar
      Monitor alsa device files to notify USB devices connection. · e2707bf8
      jiabin authored
      Only notify new USB device connection when there is any alsa device
      file present. When the USB bus notifies new USB device connection, the
      alsa device files may not be present. If new USB device connection is
      notified immediately when the bus detects new device attached, the HAL
      may not be able to open any input/output stream over USB devices given
      the alsa device files may not be ready. In this CL, adding the monitor
      to watch new alsa device files creation and only notify audio framework
      about new USB device connection when there is nay alsa device file
      ready.
      
      Bug: 261538121
      Test: play and record audio via USB headset
      Change-Id: I2a93f4868f9db82c69dd839cef550244c7d9d3e7
      e2707bf8
  27. Jan 23, 2023
    • RD Babiera's avatar
      Add hpd and link training status to usb frameworks · 6ed805f8
      RD Babiera authored
      Adds hpd and linkTrainingStatus fields to DisplayPortAltModeInfo.
      Changes dumpsys simulation to update new fields, and defines expected types
      for all DisplayPortAltModeInfo fields.
      
      Test: manually check field population using simulator
      Bug: 253534975
      Change-Id: Icd49fb468bbc186ae44f9b8169cb8045997390c0
      6ed805f8
  28. Jan 18, 2023
    • Badhri Jagan Sridharan's avatar
      Do not debounce disconnect while resetUsbGadget · f81a09f4
      Badhri Jagan Sridharan authored
      When resetUsbGadget is requested, do not debounce disconnect to allow
      falling back to the the default configuration. Also remove
      accessory mode enter timeout messages to prevent leaving AOAP
      enabled when resetUsbGadget is requested.
      
      Bug: 260145166
      Change-Id: I538f405312049846839297dc3835ec2ff7d75084
      Merged-in: I538f405312049846839297dc3835ec2ff7d75084
      (cherry picked from commit 0b2be9a6)
      f81a09f4
    • Badhri Jagan Sridharan's avatar
      Do not debounce disconnect while resetUsbGadget · 6eef64fe
      Badhri Jagan Sridharan authored
      When resetUsbGadget is requested, do not debounce disconnect to allow
      falling back to the the default configuration. Also remove
      accessory mode enter timeout messages to prevent leaving AOAP
      enabled when resetUsbGadget is requested.
      
      Backport of ag/20953426.
      
      Bug: 260145166
      Change-Id: I538f405312049846839297dc3835ec2ff7d75084
      Merged-in: I538f405312049846839297dc3835ec2ff7d75084
      6eef64fe
  29. Jan 13, 2023
    • Robert Wu's avatar
      Use ALSA for USB MIDI 1.0 devices · 6ad1d8cc
      Robert Wu authored
      In Android T, we added USB MIDI 2.0 support. As part of the change,
      we changed USB MIDI 1.0 devices to also not use ALSA.
      
      Users have reported bugs where audio stops working after MIDI is used.
      The root cause of this is because ALSA disconnects the sound card if
      one part of the sound card is removed. Android disconnects the ALSA
      MIDI interface as a direct USB connection is made.
      
      As long as ALSA is used for audio, ALSA needs to be used for MIDI.
      Thus, Android will go back to using ALSA for MIDI 1.0 USB devices.
      
      Refer to ag/16835029 for the change where ALSA is no longer used for
      host mode. This change is a partial revert of it.
      
      Bug: 251243033
      Bug: 259365701
      Test: MIDI Scope on Korg device
      Test: MIDI Keyboard and Scope loopback on 2x2 MIDI interface
      Test: MIDI Scope on MIDI 2.0 device
      Test: OboeTester Tap to Tone with MIDI and Audio
      Change-Id: Ia6a6021619e05dc5b483d4644d7fd152d89e1d46
      (cherry picked from commit 768236ce)
      6ad1d8cc
    • Badhri Jagan Sridharan's avatar
      Do not debounce disconnect while resetUsbGadget · 0b2be9a6
      Badhri Jagan Sridharan authored
      When resetUsbGadget is requested, do not debounce disconnect to allow
      falling back to the the default configuration. Also remove
      accessory mode enter timeout messages to prevent leaving AOAP
      enabled when resetUsbGadget is requested.
      
      Bug: 260145166
      Change-Id: I538f405312049846839297dc3835ec2ff7d75084
      0b2be9a6
  30. Jan 11, 2023
    • Robert Wu's avatar
      Use ALSA for USB MIDI 1.0 devices · 768236ce
      Robert Wu authored
      In Android T, we added USB MIDI 2.0 support. As part of the change,
      we changed USB MIDI 1.0 devices to also not use ALSA.
      
      Users have reported bugs where audio stops working after MIDI is used.
      The root cause of this is because ALSA disconnects the sound card if
      one part of the sound card is removed. Android disconnects the ALSA
      MIDI interface as a direct USB connection is made.
      
      As long as ALSA is used for audio, ALSA needs to be used for MIDI.
      Thus, Android will go back to using ALSA for MIDI 1.0 USB devices.
      
      Refer to ag/16835029 for the change where ALSA is no longer used for
      host mode. This change is a partial revert of it.
      
      Bug: 251243033
      Bug: 259365701
      Test: MIDI Scope on Korg device
      Test: MIDI Keyboard and Scope loopback on 2x2 MIDI interface
      Test: MIDI Scope on MIDI 2.0 device
      Test: OboeTester Tap to Tone with MIDI and Audio
      Change-Id: Ia6a6021619e05dc5b483d4644d7fd152d89e1d46
      768236ce
Loading