29 Commits

Author SHA1 Message Date
Roy Luo
4439c9caaf usb: upgrade stats AIDL to v2
Upgrade stats AIDL to v2 following pixelstats lib.

Bug: 297224564
Test: Build
Change-Id: I3a1e79faf79f47f19ff3a0c1f51de9aed1020b54
2023-09-21 20:06:46 +00:00
Ricky Niu
784bff3c72 usb: change the usb_gadget_hal permission to system
Change usb_gadget_hal permission from root to system
to be safer.

Bug: 228262168
Test: atest VtsAidlUsbHostTest / mtp,tethering,adb work /
      all the folder user and group change to system
Signed-off-by: Ricky Niu <rickyniu@google.com>
Change-Id: Ibc99c756eb3003a6bb79d35173b125b38db04386
2022-06-01 07:11:21 +00:00
Jimmy Hu
2331d8b6d9 Write the pullup value only if new value applied
Also, remove the non-existing paths and set the initial value of
mUsbDataEnabled.

Bug: 221009551
Test: build, boot
Signed-off-by: Jimmy Hu <hhhuuu@google.com>
Change-Id: I30033a9dc5e2ccfd1fe1dcc5fe8a7796c56fce75
2022-05-25 02:21:54 +00:00
Jimmy Hu
ff6f910f25 Notify port status change for moisture detection
Bug: 224696306
Test: build, boot
Signed-off-by: Jimmy Hu <hhhuuu@google.com>
Change-Id: Ia4945978ae8bf610a7af24974f528f915aea1e04
2022-03-24 10:26:09 +08:00
Badhri Jagan Sridharan
cbb64c7a20 Implement callbacks for limitPowerTransfer
Implements limiting the sink and source current when limitPowerTransfer
is invoked.

Bug: 200993386
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: I44172e6c535137cbb7648fde1fb51d1e2340f298
(cherry picked from commit 20522cf497)
2022-02-24 04:43:59 +00:00
Bob Badour
2016813915 [LSC] Add LOCAL_LICENSE_KINDS to device/google/sunfish
Added SPDX-license-identifier-Apache-2.0 to:
  usb/usb/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I1bbf016c4d6e12834662fbeff36e9b4211a61fa0
2022-02-10 13:38:36 -08:00
Badhri Jagan Sridharan
7b88eb3111 Migrate IUsb implementation to AIDL
This change migrates IUsb implementation to AIDL.
Also, IUsb and IUsbGadget now run in its own processes
to improve stability and isolation.

Port of 3c97a6bb68f6418ee41026f3bd0024405c97cf0c

Bug: 200993386
Change-Id: I681c1ba9c4f547e3cf5dc0fa7c9ee1aaf4fd603c
2022-02-01 00:03:55 -08:00
Ray Chi
ccb26d4372 Revert "sunfish: usb: add state of usb extcon to monitorffs"
This reverts commit 1c89325160.

Reason for revert: using alternate method for original behavior change
Bug: 187261232
Test: build pass

Change-Id: I56d1e1dcbb394364a626b7cf362bc0df8451cf6d
2021-05-12 23:57:25 +08:00
Ray Chi
1c89325160 sunfish: usb: add state of usb extcon to monitorffs
Monitorffs needs to check the state of usb extcon to pull up
USB gadget. Therefore, this patch add state of usb extcon and
send this information to monitorffs.

Bug: 173086594
Test: verified pass
Change-Id: I64b6236aba27242a3babd4f02725aef894a95305
2021-04-23 15:05:13 +08:00
Albert Wang
706dadbc3c Revert "Add USB Gadget HAL 1.2 support"
This reverts commit c991432a74.

Bug: 181938674
Test: USB gadget function switch normally
Change-Id: I07b4f86ed2b3989257876cb2e6c007d1ac7f5717
2021-03-30 17:20:06 +08:00
Albert Wang
89dfe032b8 Update USB HAL to V1.3 implementation
Supports to enable/disable USB data signaling

Bug: 161414036
Test: Pass USB V1.3 HIDL tests
Signed-off-by: Albert Wang <albertccwang@google.com>
Change-Id: I370e69264bec6c2c7ac61094db49f5e3a4b317b6
2021-03-24 09:28:42 +08:00
Albert Wang
c991432a74 Add USB Gadget HAL 1.2 support
Add a new API to query current USB connection speed

Bug: 181938674
Test: Pass USB Gadget V1.2 HIDL tests
Signed-off-by: Albert Wang <albertccwang@google.com>
Change-Id: I2cbdb0d73eb5c586524ef4a4083940e07269241b
2021-03-23 15:49:20 +08:00
Bob Badour
864ce48b08 [LSC] Add LOCAL_LICENSE_KINDS to device/google/sunfish
Added SPDX-license-identifier-Apache-2.0 to:
  bootctrl/Android.bp
  dumpstate/Android.mk
  health/Android.bp
  keymaster/Android.bp
  overlay_packages/SettingsOverlayG025J/Android.bp
  overlay_packages/SettingsOverlayG025M/Android.bp
  overlay_packages/SettingsOverlayG025N/Android.bp
  pixelstats/Android.bp
  powerstats/Android.bp
  rro_overlays/WifiOverlay/Android.bp
  self-extractors/qcom/staging/Android.mk
  usb/Android.bp
  vibrator/Android.bp
  vibrator/apex/Android.bp
  vibrator/common/Android.bp
  vibrator/common/bench/Android.bp
  vibrator/drv2624/Android.bp
  vibrator/drv2624/bench/Android.bp
  vibrator/drv2624/tests/Android.bp
  voice_processing/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-MIT legacy_not_a_contribution
    legacy_unencumbered
to:
  Android.bp

Added SPDX-license-identifier-BSD
to:
  gpt-utils/Android.bp

Added SPDX-license-identifier-MIT legacy_unencumbered
to:
  json-c/Android.mk

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I63560849d80af79ae86a0a97c375c5ab221ea477
Merged-in: I63560849d80af79ae86a0a97c375c5ab221ea477
2021-03-12 13:15:09 -08:00
Howard Yen
e9d0b7eb47 Update USB Gadget HAL to V1.1 implementation
Bug: 138702846
Test: build pass, function works
Change-Id: I82a74d31f4339e4b4b8c59d879871550b943a36e
2020-05-12 16:02:19 +08:00
Puma Hsu
a2917f554f Add write permission of moisture_detection_enabled
The owner group of moisture_detection_enabled
is system system, but usb hal is in system group
without write permission. Add the permossion because
the user space may need to controll it.

Bug: 154890486
Test: User can manually enable USB once moisture detected
Signed-off-by: Puma Hsu <pumahsu@google.com>
Change-Id: I8b376ebb5f5406a00283d019bcf59bb8e0b59061
2020-04-27 16:41:31 +08:00
Puma Hsu
073f3f6533 Merge "Prevent null vector accessing in USB HAL" into qt-qpr1-dev am: 1089a51182
am: d7c87d7315

Change-Id: I324f038ba8a179a2a8d772cf26c8a33b2384d718
2019-10-14 19:21:01 -07:00
pumahsu
9ef039824f Prevent null vector accessing in USB HAL
If getPortStatusHelper() failed to allocate currentPortStatus_1_2 size,
it should not access this vector, otherwise it would cause crash.

Bug: 142366879
Test: try to adb root and re-connect USB
Change-Id: I0d0d9cd1dccd646ce270b562f2922da15338bfc1
Signed-off-by: pumahsu <pumahsu@google.com>
2019-10-14 20:06:40 +08:00
Cyan_Hsieh
0e77414b8c Revert "Modify android.hardware.usb to 1.1" am: e2e286e15b
am: 0bb7520003

Change-Id: Ib9d7df77c59582675f1e251ca1679d6a25dc637a
2019-10-03 06:35:27 -07:00
Cyan_Hsieh
e2e286e15b Revert "Modify android.hardware.usb to 1.1"
This reverts commit e50629f51b.

Test: adb work
Change-Id: I6df9c37bb118edce5876762e324b68f64b672fdb
2019-10-03 12:31:57 +00:00
rickyniu
e7b0fad7c0 [USB] USB Gadget add Sunfish function set am: d3ca4dd1da
am: 104e70c763

Change-Id: I6bdae230e1729d22c5da11285f1c516c5f97bde3
2019-10-02 21:34:26 -07:00
Wilson Sung
9d5a359013 Modify android.hardware.usb to 1.1 am: e50629f51b
am: 188a143521

Change-Id: I19240a44c515ec5679e0374dac9ea4ebc31cfb2d
2019-10-02 21:34:20 -07:00
Badhri Jagan Sridharan
8957bb7923 Add vendor prop to disable moisture detection. am: c765ae8150
am: afb035b058

Change-Id: I911fa8ee524ff00f16327dfe4baa65b74150bbd4
2019-10-02 21:34:16 -07:00
Badhri Jagan Sridharan
3472050b22 Do not moisture detection when uart is enabled. am: 9b4f79057d
am: 80a5100d8a

Change-Id: I08bcb2c9cfc348c4f079d1b551eefe0ffb535da4
2019-10-02 21:34:13 -07:00
Steven Moreland
775cbe829a Remove libhwbinder/libhidltransport deps
Since these were combined into libhidlbase.

Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: I730d07f26a4e874634453b632e9c2d87be7cbee0
2019-10-02 12:49:22 -07:00
rickyniu
d3ca4dd1da [USB] USB Gadget add Sunfish function set
Functions == "diag,serial_cdev,rmnet_gsi,dpl_gsi,qdss"
VidPid("0x05C6", "0x90DB");

Bug: 141348246
Change-Id: I55869ddb38bf4fb748393bb788f89f53939a05d1
2019-10-02 21:26:18 +08:00
Wilson Sung
e50629f51b Modify android.hardware.usb to 1.1
Copy from b1c1
Bug: 140395581

Change-Id: I1468c9ef6cbafa61da824e11fe3de393b33d8922
2019-10-02 21:26:18 +08:00
Badhri Jagan Sridharan
c765ae8150 Add vendor prop to disable moisture detection.
setprop vendor.usb.contaminantdisable true
disable contaminant detection.

Bug: 130175818
Test: setprop vendor.usb.contaminantdisable true

Change-Id: I9c9faa219cfae05431db8b0f1bec173c24c0d437
(cherry picked from commit 21e7d5aec7e3e5b9b032b71a3153310376a46ae2)
2019-10-02 21:26:18 +08:00
Badhri Jagan Sridharan
9b4f79057d Do not moisture detection when uart is enabled.
Bug: 128534822
Test: Tested with mock circuit. Moisture detection does not
reenable when serial uart is enabled.

Change-Id: Ieb85cb7843bae9bfb5aef79f7d2058b79b7823e6
(cherry picked from commit ccc09ed8a9b826d56f685d0e618e1f3cc0403c12)
2019-10-02 21:26:18 +08:00
Cyan_Hsieh
2ec6373901 Initial S5 device folder
Reference
67d47b661b457286b602df626c3aa8ba0bc721fe
aa6f4ddc29c893aacb41e3ae06ae031b605bbde4
device/qcom/common and device/qcom/sm6150 of LA.UM.8.9.R1.09.00.00.558.029

Bug: 139269901
Change-Id: I663fd9ae5d0ecb92c579200cef9eae6f6c0e3ccd
2019-08-21 16:59:10 +08:00