diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-11-11 02:02:22 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-11-11 02:02:22 +0000 |
commit | 49c9e763ac977983146c496f80a26cdd55293e30 (patch) | |
tree | 3af8d73a1f310d185de7029eb7947df4becd699b | |
parent | 93e116bcd02d4a735bdc041b6bc40edbc6649023 (diff) | |
parent | bc4af7cd501ae374fe7d4995c21056c9b39db099 (diff) | |
download | gs201-49c9e763ac977983146c496f80a26cdd55293e30.tar.gz |
Snap for 11084970 from bc4af7cd501ae374fe7d4995c21056c9b39db099 to 24Q1-release
Change-Id: Ic12a6f3dcc9a8e3841759241770ecee7c80f591d
-rw-r--r-- | Android.mk | 30 | ||||
-rw-r--r-- | usb/usb/Android.bp | 12 | ||||
-rw-r--r-- | usb/usb/Usb.cpp | 21 | ||||
-rw-r--r-- | vibrator/Android.mk | 17 |
4 files changed, 28 insertions, 52 deletions
diff --git a/Android.mk b/Android.mk deleted file mode 100644 index 367e845..0000000 --- a/Android.mk +++ /dev/null @@ -1,30 +0,0 @@ -# -# Copyright (C) 2011 The Android Open-Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# WARNING: Everything listed here will be built on ALL platforms, -# including x86, the universal, and the SDK. Modules must be uniquely -# named (liblights.panda), and must build everywhere, or limit themselves -# to only building on ARM if they include assembly. Individual makefiles -# are responsible for having their own logic, for fine-grained control. - -LOCAL_PATH := $(call my-dir) - -# if some modules are built directly from this directory (not subdirectories), -# their rules should be written here. - -ifeq ($(USES_DEVICE_GOOGLE_GS201),true) - include $(call first-makefiles-under,$(LOCAL_PATH)) -endif diff --git a/usb/usb/Android.bp b/usb/usb/Android.bp index e28667f..8fd373b 100644 --- a/usb/usb/Android.bp +++ b/usb/usb/Android.bp @@ -47,21 +47,29 @@ cc_binary { "android.hardware.thermal@2.0", "android.hardware.thermal-V1-ndk", "android.hardware.usb.gadget@1.0", - "android.hardware.usb-V2-ndk", + "android.hardware.usb-V3-ndk", "android.hardware.usb.gadget-V1-ndk", "libcutils", "android.frameworks.stats-V2-ndk", "pixelatoms-cpp", "libbinder_ndk", - "libprotobuf-cpp-lite", + "libprotobuf-cpp-lite", + "server_configurable_flags", ], static_libs: [ "libpixelusb-aidl", "libpixelstats", "libthermalutils", + "android.hardware.usb.flags-aconfig-c-lib", ], export_shared_lib_headers: [ "android.frameworks.stats-V2-ndk", "pixelatoms-cpp", ], } + +cc_aconfig_library { + name: "android.hardware.usb.flags-aconfig-c-lib", + vendor: true, + aconfig_declarations: "android.hardware.usb.flags-aconfig", +} diff --git a/usb/usb/Usb.cpp b/usb/usb/Usb.cpp index 9aa09da..224951a 100644 --- a/usb/usb/Usb.cpp +++ b/usb/usb/Usb.cpp @@ -43,10 +43,13 @@ #include "Usb.h" #include <aidl/android/frameworks/stats/IStats.h> +#include <android_hardware_usb_flags.h> #include <pixelusb/CommonUtils.h> #include <pixelusb/UsbGadgetAidlCommon.h> #include <pixelstats/StatsHelper.h> +namespace usb_flags = android::hardware::usb::flags; + using aidl::android::frameworks::stats::IStats; using android::base::GetProperty; using android::base::Tokenize; @@ -75,6 +78,7 @@ constexpr char kComplianceWarningBC12[] = "bc12"; constexpr char kComplianceWarningDebugAccessory[] = "debug-accessory"; constexpr char kComplianceWarningMissingRp[] = "missing_rp"; constexpr char kComplianceWarningOther[] = "other"; +constexpr char kComplianceWarningInputPowerLimited[] = "input_power_limited"; constexpr char kContaminantDetectionPath[] = "i2c-max77759tcpc/contaminant_detection"; constexpr char kStatusPath[] = "i2c-max77759tcpc/contaminant_detection_status"; constexpr char kSinkLimitEnable[] = "i2c-max77759tcpc/usb_limit_sink_enable"; @@ -333,9 +337,20 @@ Status queryNonCompliantChargerStatus(std::vector<PortStatus> *currentPortStatus continue; } if (!strncmp(reason.c_str(), kComplianceWarningOther, - strlen(kComplianceWarningOther))) { - (*currentPortStatus)[i].complianceWarnings.push_back(ComplianceWarning::OTHER); - continue; + strlen(kComplianceWarningOther)) || + !strncmp(reason.c_str(), kComplianceWarningInputPowerLimited, + strlen(kComplianceWarningInputPowerLimited))) { + if (usb_flags::enable_usb_data_compliance_warning() && + usb_flags::enable_input_power_limited_warning()) { + ALOGI("Report through INPUT_POWER_LIMITED warning"); + (*currentPortStatus)[i].complianceWarnings.push_back( + ComplianceWarning::INPUT_POWER_LIMITED); + continue; + } else { + (*currentPortStatus)[i].complianceWarnings.push_back( + ComplianceWarning::OTHER); + continue; + } } } if ((*currentPortStatus)[i].complianceWarnings.size() > 0 && diff --git a/vibrator/Android.mk b/vibrator/Android.mk deleted file mode 100644 index 5b089be..0000000 --- a/vibrator/Android.mk +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright (C) 2020 The Android Open-Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -include $(call first-makefiles-under, $(call my-dir)) |