summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-prod (mdb) <android-build-team-robot@google.com>2021-03-04 00:37:08 +0000
committerandroid-build-prod (mdb) <android-build-team-robot@google.com>2021-03-04 00:37:08 +0000
commite4bcf6fa01e1eae46ce964d62d5f720d3d2d7fd9 (patch)
treeb04401a7d5a0c792c3093aeff5394114e4652902
parent8a897e7173ba1e30be766c2ad972e96ffb1ad87c (diff)
parente1344339e3f1f0714a55fd2a66367eda16b9ebc9 (diff)
Snap for 7183507 from e1344339e3f1f0714a55fd2a66367eda16b9ebc9 to sdk-releaseplatform-tools-31.0.1
Change-Id: Ib1265b1cb8510ae690f430103c20e3b967900a38
-rw-r--r--Android.bp34
-rw-r--r--METADATA5
-rw-r--r--audio/Android.mk2
-rw-r--r--audio/audio_hw.c132
-rw-r--r--gralloc/Android.mk4
-rwxr-xr-xinstaller/db845c/flash-all-aosp.sh2
-rw-r--r--libmemtrack/Android.mk2
-rw-r--r--qcom/pd-mapper/Android.bp19
-rw-r--r--qcom/qrtr/Android.bp19
-rw-r--r--qcom/rmtfs/Android.bp19
-rw-r--r--qcom/tqftpserv/Android.bp19
-rw-r--r--ueventd.common.rc3
12 files changed, 198 insertions, 62 deletions
diff --git a/Android.bp b/Android.bp
index 03c85c1..c9f7e86 100644
--- a/Android.bp
+++ b/Android.bp
@@ -14,6 +14,40 @@
soong_namespace {}
+// *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS. PLEASE
+// CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE
+// DEPENDING ON IT IN YOUR PROJECT. ***
+package {
+ default_applicable_licenses: ["device_linaro_dragonboard_license"],
+}
+
+// Added automatically by a large-scale-change that took the approach of
+// 'apply every license found to every target'. While this makes sure we respect
+// every license restriction, it may not be entirely correct.
+//
+// e.g. GPL in an MIT project might only apply to the contrib/ directory.
+//
+// Please consider splitting the single license below into multiple licenses,
+// taking care not to lose any license_kind information, and overriding the
+// default license using the 'licenses: [...]' property on targets as needed.
+//
+// For unused files, consider creating a 'fileGroup' with "//visibility:private"
+// to attach the license to, and including a comment whether the files may be
+// used in the current project.
+// See: http://go/android-license-faq
+license {
+ name: "device_linaro_dragonboard_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-Apache-2.0",
+ "SPDX-license-identifier-BSD",
+ "SPDX-license-identifier-MIT",
+ "SPDX-license-identifier-OpenSSL",
+ "legacy_by_exception_only", // by exception only
+ ],
+ // large-scale-change unable to identify any license_text files
+}
+
subdirs = [
"qcom/pd-mapper",
"qcom/qrtr",
diff --git a/METADATA b/METADATA
index d97975c..3814b8d 100644
--- a/METADATA
+++ b/METADATA
@@ -1,3 +1,6 @@
+# *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS. PLEASE
+# CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE
+# DEPENDING ON IT IN YOUR PROJECT. ***
third_party {
- license_type: NOTICE
+ license_type: BY_EXCEPTION_ONLY
}
diff --git a/audio/Android.mk b/audio/Android.mk
index 90c18fa..4356384 100644
--- a/audio/Android.mk
+++ b/audio/Android.mk
@@ -24,6 +24,8 @@ include $(CLEAR_VARS)
LOCAL_HEADER_LIBRARIES += libhardware_headers
LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_VENDOR_MODULE := true
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 4a16ac1..5a0953c 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -57,6 +57,16 @@ static int adev_get_microphones(const struct audio_hw_device* dev,
size_t* mic_count);
static size_t out_get_buffer_size(const struct audio_stream* stream);
+static bool is_aec_input(const struct alsa_stream_in* in) {
+ /* If AEC is in the app, only configure based on ECHO_REFERENCE spec.
+ * If AEC is in the HAL, configure using the given mic stream. */
+ bool aec_input = true;
+#if !defined(AEC_HAL)
+ aec_input = (in->source == AUDIO_SOURCE_ECHO_REFERENCE);
+#endif
+ return aec_input;
+}
+
static int get_audio_output_port(audio_devices_t devices) {
/* Only HDMI out for now #FIXME */
return PORT_HDMI;
@@ -784,19 +794,17 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
ALOGV("adev_open_output_stream...");
struct alsa_audio_device *ladev = (struct alsa_audio_device *)dev;
- struct alsa_stream_out *out;
- struct pcm_params *params;
- int ret = 0;
-
int out_port = get_audio_output_port(devices);
-
- params = pcm_params_get(CARD_OUT, out_port, PCM_OUT);
- if (!params)
+ struct pcm_params* params = pcm_params_get(CARD_OUT, out_port, PCM_OUT);
+ if (!params) {
return -ENOSYS;
+ }
- out = (struct alsa_stream_out *)calloc(1, sizeof(struct alsa_stream_out));
- if (!out)
+ struct alsa_stream_out* out =
+ (struct alsa_stream_out*)calloc(1, sizeof(struct alsa_stream_out));
+ if (!out) {
return -ENOMEM;
+ }
out->stream.common.get_sample_rate = out_get_sample_rate;
out->stream.common.set_sample_rate = out_set_sample_rate;
@@ -829,7 +837,7 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
config->sample_rate = out->config.rate;
config->format = audio_format_from_pcm_format(out->config.format);
config->channel_mask = audio_channel_out_mask_from_count(CHANNEL_STEREO);
- ret = -EINVAL;
+ goto error_1;
}
ALOGI("adev_open_output_stream selects channels=%d rate=%d format=%d, devices=%d",
@@ -844,8 +852,6 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
config->channel_mask = out_get_channels(&out->stream.common);
config->sample_rate = out_get_sample_rate(&out->stream.common);
- *stream_out = &out->stream;
-
out->speaker_eq = NULL;
if (out_port == PORT_INTERNAL_SPEAKER) {
out_set_eq(out);
@@ -854,18 +860,20 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
}
}
- /* TODO The retry mechanism isn't implemented in AudioPolicyManager/AudioFlinger. */
- ret = 0;
-
- if (ret == 0) {
- int aec_ret = init_aec_reference_config(ladev->aec, out);
- if (aec_ret) {
- ALOGE("AEC: Speaker config init failed!");
- return -EINVAL;
- }
+ int aec_ret = init_aec_reference_config(ladev->aec, out);
+ if (aec_ret) {
+ ALOGE("AEC: Speaker config init failed!");
+ goto error_2;
}
- return ret;
+ *stream_out = &out->stream;
+ return 0;
+
+error_2:
+ fir_release(out->speaker_eq);
+error_1:
+ free(out);
+ return -EINVAL;
}
static void adev_close_output_stream(struct audio_hw_device *dev,
@@ -982,17 +990,16 @@ static int adev_open_input_stream(struct audio_hw_device* dev, audio_io_handle_t
ALOGV("adev_open_input_stream...");
struct alsa_audio_device *ladev = (struct alsa_audio_device *)dev;
- struct alsa_stream_in *in;
- struct pcm_params *params;
- int ret = 0;
- params = pcm_params_get(CARD_IN, PORT_BUILTIN_MIC, PCM_IN);
- if (!params)
+ struct pcm_params* params = pcm_params_get(CARD_IN, PORT_BUILTIN_MIC, PCM_IN);
+ if (!params) {
return -ENOSYS;
+ }
- in = (struct alsa_stream_in *)calloc(1, sizeof(struct alsa_stream_in));
- if (!in)
+ struct alsa_stream_in* in = (struct alsa_stream_in*)calloc(1, sizeof(struct alsa_stream_in));
+ if (!in) {
return -ENOMEM;
+ }
in->stream.common.get_sample_rate = in_get_sample_rate;
in->stream.common.set_sample_rate = in_set_sample_rate;
@@ -1025,7 +1032,10 @@ static int adev_open_input_stream(struct audio_hw_device* dev, audio_io_handle_t
if (in->config.rate != config->sample_rate ||
audio_channel_count_from_in_mask(config->channel_mask) != CHANNEL_STEREO ||
in->config.format != pcm_format_from_audio_format(config->format) ) {
- ret = -EINVAL;
+ config->format = in_get_format(&in->stream.common);
+ config->channel_mask = in_get_channels(&in->stream.common);
+ config->sample_rate = in_get_sample_rate(&in->stream.common);
+ goto error_1;
}
ALOGI("adev_open_input_stream selects channels=%d rate=%d format=%d source=%d",
@@ -1037,46 +1047,37 @@ static int adev_open_input_stream(struct audio_hw_device* dev, audio_io_handle_t
in->source = source;
in->devices = devices;
- config->format = in_get_format(&in->stream.common);
- config->channel_mask = in_get_channels(&in->stream.common);
- config->sample_rate = in_get_sample_rate(&in->stream.common);
-
- /* If AEC is in the app, only configure based on ECHO_REFERENCE spec.
- * If AEC is in the HAL, configure using the given mic stream. */
- bool aecInput = true;
-#if !defined(AEC_HAL)
- aecInput = (in->source == AUDIO_SOURCE_ECHO_REFERENCE);
-#endif
-
- if ((ret == 0) && aecInput) {
+ if (is_aec_input(in)) {
int aec_ret = init_aec_mic_config(ladev->aec, in);
if (aec_ret) {
ALOGE("AEC: Mic config init failed!");
- return -EINVAL;
+ goto error_1;
}
}
- if (ret) {
- free(in);
- } else {
- *stream_in = &in->stream;
- }
-
#if DEBUG_AEC
remove("/data/local/traces/aec_ref.pcm");
remove("/data/local/traces/aec_in.pcm");
remove("/data/local/traces/aec_ref_timestamps.txt");
remove("/data/local/traces/aec_in_timestamps.txt");
#endif
- return ret;
+
+ *stream_in = &in->stream;
+ return 0;
+
+error_1:
+ free(in);
+ return -EINVAL;
}
static void adev_close_input_stream(struct audio_hw_device *dev,
struct audio_stream_in *stream)
{
ALOGV("adev_close_input_stream...");
- struct alsa_audio_device *adev = (struct alsa_audio_device *)dev;
- destroy_aec_mic_config(adev->aec);
+ struct alsa_stream_in* in = (struct alsa_stream_in*)stream;
+ if (is_aec_input(in)) {
+ destroy_aec_mic_config(in->dev->aec);
+ }
free(stream);
return;
}
@@ -1093,6 +1094,8 @@ static int adev_close(hw_device_t *device)
struct alsa_audio_device *adev = (struct alsa_audio_device *)device;
release_aec(adev->aec);
+ audio_route_free(adev->audio_route);
+ mixer_close(adev->mixer);
free(device);
return 0;
}
@@ -1100,16 +1103,16 @@ static int adev_close(hw_device_t *device)
static int adev_open(const hw_module_t* module, const char* name,
hw_device_t** device)
{
- struct alsa_audio_device *adev;
-
ALOGV("adev_open: %s", name);
- if (strcmp(name, AUDIO_HARDWARE_INTERFACE) != 0)
+ if (strcmp(name, AUDIO_HARDWARE_INTERFACE) != 0) {
return -EINVAL;
+ }
- adev = calloc(1, sizeof(struct alsa_audio_device));
- if (!adev)
+ struct alsa_audio_device* adev = calloc(1, sizeof(struct alsa_audio_device));
+ if (!adev) {
return -ENOMEM;
+ }
adev->hw_device.common.tag = HARDWARE_DEVICE_TAG;
adev->hw_device.common.version = AUDIO_DEVICE_API_VERSION_2_0;
@@ -1137,27 +1140,34 @@ static int adev_open(const hw_module_t* module, const char* name,
*device = &adev->hw_device.common;
adev->mixer = mixer_open(CARD_OUT);
-
if (!adev->mixer) {
ALOGE("Unable to open the mixer, aborting.");
- return -EINVAL;
+ goto error_1;
}
adev->audio_route = audio_route_init(CARD_OUT, MIXER_XML_PATH);
if (!adev->audio_route) {
ALOGE("%s: Failed to init audio route controls, aborting.", __func__);
- return -EINVAL;
+ goto error_2;
}
pthread_mutex_lock(&adev->lock);
if (init_aec(CAPTURE_CODEC_SAMPLING_RATE, NUM_AEC_REFERENCE_CHANNELS,
CHANNEL_STEREO, &adev->aec)) {
pthread_mutex_unlock(&adev->lock);
- return -EINVAL;
+ goto error_3;
}
pthread_mutex_unlock(&adev->lock);
return 0;
+
+error_3:
+ audio_route_free(adev->audio_route);
+error_2:
+ mixer_close(adev->mixer);
+error_1:
+ free(adev);
+ return -EINVAL;
}
static struct hw_module_methods_t hal_module_methods = {
diff --git a/gralloc/Android.mk b/gralloc/Android.mk
index ec1c38e..e517e3d 100644
--- a/gralloc/Android.mk
+++ b/gralloc/Android.mk
@@ -39,6 +39,8 @@ LOCAL_C_INCLUDES += system/core/include hardware/libhardware/include
LOCAL_C_INCLUDES += system/core/libsystem/include system/core
LOCAL_MODULE := gralloc.gbm
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-MIT
+LOCAL_LICENSE_CONDITIONS := notice
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_PROPRIETARY_MODULE := true
@@ -51,6 +53,8 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
$(LOCAL_PATH)
LOCAL_MODULE := libgralloc_drm
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-MIT
+LOCAL_LICENSE_CONDITIONS := notice
LOCAL_MODULE_TAGS := optional
LOCAL_PROPRIETARY_MODULE := true
diff --git a/installer/db845c/flash-all-aosp.sh b/installer/db845c/flash-all-aosp.sh
index 3451998..dd6c755 100755
--- a/installer/db845c/flash-all-aosp.sh
+++ b/installer/db845c/flash-all-aosp.sh
@@ -44,5 +44,7 @@ echo "FLASH-ALL-AOSP: Flash userdata image"
fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img
echo "FLASH-ALL-AOSP: Flash vendor_boot image"
fastboot flash vendor_boot "${ANDROID_PRODUCT_OUT}"/vendor_boot.img
+echo "FLASH-ALL-AOSP: Formatting metadata"
+fastboot format:ext4 metadata
fastboot reboot
diff --git a/libmemtrack/Android.mk b/libmemtrack/Android.mk
index 913cb22..c52b417 100644
--- a/libmemtrack/Android.mk
+++ b/libmemtrack/Android.mk
@@ -26,4 +26,6 @@ LOCAL_CLANG := true
LOCAL_SHARED_LIBRARIES := liblog libhardware
LOCAL_SRC_FILES := memtrack_dragonboard.c
LOCAL_MODULE := memtrack.default
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
include $(BUILD_SHARED_LIBRARY)
diff --git a/qcom/pd-mapper/Android.bp b/qcom/pd-mapper/Android.bp
index 3bdbc32..7e86231 100644
--- a/qcom/pd-mapper/Android.bp
+++ b/qcom/pd-mapper/Android.bp
@@ -1,3 +1,22 @@
+package {
+ default_applicable_licenses: [
+ "device_linaro_dragonboard_qcom_pd-mapper_license",
+ ],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+ name: "device_linaro_dragonboard_qcom_pd-mapper_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-BSD",
+ ],
+ license_text: [
+ "LICENSE",
+ ],
+}
+
cc_binary {
name: "pd-mapper",
vendor: true,
diff --git a/qcom/qrtr/Android.bp b/qcom/qrtr/Android.bp
index 9544a75..8103bb6 100644
--- a/qcom/qrtr/Android.bp
+++ b/qcom/qrtr/Android.bp
@@ -1,3 +1,22 @@
+package {
+ default_applicable_licenses: [
+ "device_linaro_dragonboard_qcom_qrtr_license",
+ ],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+ name: "device_linaro_dragonboard_qcom_qrtr_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-BSD",
+ ],
+ license_text: [
+ "LICENSE",
+ ],
+}
+
cc_library {
name: "libqrtr",
vendor: true,
diff --git a/qcom/rmtfs/Android.bp b/qcom/rmtfs/Android.bp
index 7865a99..82cf7e1 100644
--- a/qcom/rmtfs/Android.bp
+++ b/qcom/rmtfs/Android.bp
@@ -1,3 +1,22 @@
+package {
+ default_applicable_licenses: [
+ "device_linaro_dragonboard_qcom_rmtfs_license",
+ ],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+ name: "device_linaro_dragonboard_qcom_rmtfs_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-BSD",
+ ],
+ license_text: [
+ "LICENSE",
+ ],
+}
+
cc_binary {
name: "rmtfs",
vendor: true,
diff --git a/qcom/tqftpserv/Android.bp b/qcom/tqftpserv/Android.bp
index b2c5090..248c323 100644
--- a/qcom/tqftpserv/Android.bp
+++ b/qcom/tqftpserv/Android.bp
@@ -1,3 +1,22 @@
+package {
+ default_applicable_licenses: [
+ "device_linaro_dragonboard_qcom_tqftpserv_license",
+ ],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+ name: "device_linaro_dragonboard_qcom_tqftpserv_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-BSD",
+ ],
+ license_text: [
+ "LICENSE",
+ ],
+}
+
cc_binary {
name: "tqftpserv",
vendor: true,
diff --git a/ueventd.common.rc b/ueventd.common.rc
index b87dccf..c0ba022 100644
--- a/ueventd.common.rc
+++ b/ueventd.common.rc
@@ -1,5 +1,8 @@
modalias_handling enabled
+subsystem usbmisc
+ devname uevent_devname
+
/dev/sw_sync 0660 root graphics
# gpu