add usb features

Prevent crashing of settings when going into Connected Devices.

   E SystemServiceRegistry: No service published for: usb

followed by NPE:

   java.lang.RuntimeException: Unable to start activity
   ComponentInfo{com.android.settings/com.android.settings.Settings$ConnectedDeviceDashboardActivity}:
   java.lang.NullPointerException: Attempt to invoke virtual method
   'java.util.List android.hardware.usb.UsbManager.getPorts()'
   on a null object reference

Bug: 189904047
Test: check settings doesn't crash anymore
Signed-off-by: Pat Tjin <pattjin@google.com>
Change-Id: I1dd8df5cf70500b3dbb95009783dc2ba89e5ce13
This commit is contained in:
Pat Tjin 2021-06-02 11:55:10 -07:00
parent aa78dc8437
commit ac54e6697c

View file

@ -565,7 +565,7 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.wifi.passpoint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.passpoint.xml \
frameworks/native/data/etc/android.hardware.wifi.rtt.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.rtt.xml
#PRODUCT_COPY_FILES += \
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \
frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml
@ -581,8 +581,6 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \
frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \
frameworks/native/data/etc/android.hardware.wifi.passpoint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.passpoint.xml \
frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \
frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \
frameworks/native/data/etc/android.hardware.audio.low_latency.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.low_latency.xml \
frameworks/native/data/etc/android.hardware.audio.pro.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.pro.xml \