Merge "Add EvsCamera Class and Buffer Manipulation" into main
diff --git a/audio/aidl/default/Configuration.cpp b/audio/aidl/default/Configuration.cpp
index 9131935..85e4e24 100644
--- a/audio/aidl/default/Configuration.cpp
+++ b/audio/aidl/default/Configuration.cpp
@@ -285,6 +285,20 @@
return std::make_unique<Configuration>(configuration);
}
+// Note: When transitioning to loading of XML configs, either keep the configuration
+// of the remote submix sources from this static configuration, or update the XML
+// config to match it. There are two reasons for that:
+// 1. The canonical r_submix configuration only lists 'STEREO' and '48000',
+// however the framework attempts to open streams for other sample rates
+// as well. The legacy r_submix implementation allowed that, but libaudiohal@aidl
+// will not find a mix port to use. Because of that, list all channel
+// masks and sample rates that the legacy implementation allowed.
+// 2. The legacy implementation had a hard limit on the number of routes (10),
+// and this is checked indirectly by AudioPlaybackCaptureTest#testPlaybackCaptureDoS
+// CTS test. Instead of hardcoding the number of routes, we can use
+// "maxOpen/ActiveStreamCount" to enforce a similar limit. However, the canonical
+// XML file lacks this specification.
+//
// Remote Submix configuration:
//
// Device ports:
@@ -294,16 +308,10 @@
// - no profiles specified
//
// Mix ports:
-// * "r_submix output", unlimited max open, unlimited max active stream
+// * "r_submix output", maximum 20 opened streams, maximum 10 active streams
// - profile PCM 16-bit; MONO, STEREO; 8000, 11025, 16000, 32000, 44100, 48000
-// - profile PCM 24-bit; MONO, STEREO; 8000, 11025, 16000, 32000, 44100, 48000
-// - profile PCM 32-bit; MONO, STEREO; 8000, 11025, 16000, 32000, 44100, 48000
-// - profile PCM 32-bit float; MONO, STEREO; 8000, 11025, 16000, 32000, 44100, 48000
-// * "r_submix input", unlimited max open, unlimited max active stream
+// * "r_submix input", maximum 20 opened streams, maximum 10 active streams
// - profile PCM 16-bit; MONO, STEREO; 8000, 11025, 16000, 32000, 44100, 48000
-// - profile PCM 24-bit; MONO, STEREO; 8000, 11025, 16000, 32000, 44100, 48000
-// - profile PCM 32-bit; MONO, STEREO; 8000, 11025, 16000, 32000, 44100, 48000
-// - profile PCM 32-bit float; MONO, STEREO; 8000, 11025, 16000, 32000, 44100, 48000
//
// Routes:
// "r_submix output" -> "Remote Submix Out"
@@ -313,15 +321,6 @@
static const Configuration configuration = []() {
Configuration c;
const std::vector<AudioProfile> standardPcmAudioProfiles{
- createProfile(PcmType::FLOAT_32_BIT,
- {AudioChannelLayout::LAYOUT_MONO, AudioChannelLayout::LAYOUT_STEREO},
- {8000, 11025, 16000, 32000, 44100, 48000}),
- createProfile(PcmType::INT_32_BIT,
- {AudioChannelLayout::LAYOUT_MONO, AudioChannelLayout::LAYOUT_STEREO},
- {8000, 11025, 16000, 32000, 44100, 48000}),
- createProfile(PcmType::INT_24_BIT,
- {AudioChannelLayout::LAYOUT_MONO, AudioChannelLayout::LAYOUT_STEREO},
- {8000, 11025, 16000, 32000, 44100, 48000}),
createProfile(PcmType::INT_16_BIT,
{AudioChannelLayout::LAYOUT_MONO, AudioChannelLayout::LAYOUT_STEREO},
{8000, 11025, 16000, 32000, 44100, 48000})};
@@ -332,25 +331,25 @@
createPort(c.nextPortId++, "Remote Submix Out", 0, false,
createDeviceExt(AudioDeviceType::OUT_SUBMIX, 0,
AudioDeviceDescription::CONNECTION_VIRTUAL));
+ rsubmixOutDevice.profiles = standardPcmAudioProfiles;
c.ports.push_back(rsubmixOutDevice);
- c.connectedProfiles[rsubmixOutDevice.id] = standardPcmAudioProfiles;
AudioPort rsubmixInDevice =
createPort(c.nextPortId++, "Remote Submix In", 0, true,
createDeviceExt(AudioDeviceType::IN_SUBMIX, 0,
AudioDeviceDescription::CONNECTION_VIRTUAL));
+ rsubmixInDevice.profiles = standardPcmAudioProfiles;
c.ports.push_back(rsubmixInDevice);
- c.connectedProfiles[rsubmixInDevice.id] = standardPcmAudioProfiles;
// Mix ports
AudioPort rsubmixOutMix =
- createPort(c.nextPortId++, "r_submix output", 0, false, createPortMixExt(0, 0));
+ createPort(c.nextPortId++, "r_submix output", 0, false, createPortMixExt(20, 10));
rsubmixOutMix.profiles = standardPcmAudioProfiles;
c.ports.push_back(rsubmixOutMix);
AudioPort rsubmixInMix =
- createPort(c.nextPortId++, "r_submix input", 0, true, createPortMixExt(0, 0));
+ createPort(c.nextPortId++, "r_submix input", 0, true, createPortMixExt(20, 10));
rsubmixInMix.profiles = standardPcmAudioProfiles;
c.ports.push_back(rsubmixInMix);
@@ -461,6 +460,10 @@
// - no profiles specified
// * "Test In", IN_AFE_PROXY
// - no profiles specified
+// * "Wired Headset", OUT_HEADSET
+// - profile PCM 24-bit; STEREO; 48000
+// * "Wired Headset Mic", IN_HEADSET
+// - profile PCM 24-bit; MONO; 48000
//
// Mix ports:
// * "test output", 1 max open, 1 max active stream
@@ -476,7 +479,8 @@
//
// Routes:
// "test output", "test fast output", "test compressed offload" -> "Test Out"
-// "Test In" -> "test input"
+// "test output" -> "Wired Headset"
+// "Test In", "Wired Headset Mic" -> "test input"
//
// Initial port configs:
// * "Test Out" device port: PCM 24-bit; STEREO; 48000
@@ -496,6 +500,14 @@
AudioChannelLayout::LAYOUT_STEREO, 48000, 0, false,
createDeviceExt(AudioDeviceType::OUT_AFE_PROXY, 0)));
+ AudioPort headsetOutDevice =
+ createPort(c.nextPortId++, "Wired Headset", 0, false,
+ createDeviceExt(AudioDeviceType::OUT_HEADSET, 0,
+ AudioDeviceDescription::CONNECTION_ANALOG));
+ headsetOutDevice.profiles.push_back(
+ createProfile(PcmType::INT_24_BIT, {AudioChannelLayout::LAYOUT_STEREO}, {48000}));
+ c.ports.push_back(headsetOutDevice);
+
AudioPort testInDevice = createPort(c.nextPortId++, "Test In", 0, true,
createDeviceExt(AudioDeviceType::IN_AFE_PROXY, 0));
c.ports.push_back(testInDevice);
@@ -504,6 +516,14 @@
AudioChannelLayout::LAYOUT_MONO, 48000, 0, true,
createDeviceExt(AudioDeviceType::IN_AFE_PROXY, 0)));
+ AudioPort headsetInDevice =
+ createPort(c.nextPortId++, "Wired Headset Mic", 0, true,
+ createDeviceExt(AudioDeviceType::IN_HEADSET, 0,
+ AudioDeviceDescription::CONNECTION_ANALOG));
+ headsetInDevice.profiles.push_back(
+ createProfile(PcmType::INT_24_BIT, {AudioChannelLayout::LAYOUT_MONO}, {48000}));
+ c.ports.push_back(headsetInDevice);
+
// Mix ports
AudioPort testOutMix =
@@ -549,7 +569,8 @@
c.routes.push_back(
createRoute({testOutMix, testFastOutMix, compressedOffloadOutMix}, testOutDevice));
- c.routes.push_back(createRoute({testInDevice}, testInMIx));
+ c.routes.push_back(createRoute({testOutMix}, headsetOutDevice));
+ c.routes.push_back(createRoute({testInDevice, headsetInDevice}, testInMIx));
c.portConfigs.insert(c.portConfigs.end(), c.initialConfigs.begin(), c.initialConfigs.end());
diff --git a/audio/aidl/vts/TestUtils.h b/audio/aidl/vts/TestUtils.h
index 10c2fc6..b559669 100644
--- a/audio/aidl/vts/TestUtils.h
+++ b/audio/aidl/vts/TestUtils.h
@@ -78,9 +78,9 @@
EXPECT_PRED_FORMAT2(::android::hardware::audio::common::testing::detail::assertResult, \
expected, ret)
-#define SKIP_TEST_IF_DATA_UNSUPPORTED(flags) \
- ({ \
- if ((flags).hwAcceleratorMode == Flags::HardwareAccelerator::TUNNEL || (flags).bypass) { \
- GTEST_SKIP() << "Skip data path for offload"; \
- } \
+#define SKIP_TEST_IF_DATA_UNSUPPORTED(flags) \
+ ({ \
+ if ((flags).hwAcceleratorMode == Flags::HardwareAccelerator::TUNNEL || (flags).bypass) { \
+ GTEST_SKIP() << "Skip data path for offload"; \
+ } \
})
\ No newline at end of file
diff --git a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
index 20062e9..ccf7cfc 100644
--- a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
@@ -145,28 +145,36 @@
}
AudioPort GenerateUniqueDeviceAddress(const AudioPort& port) {
+ // Point-to-point connections do not use addresses.
+ static const std::set<std::string> kPointToPointConnections = {
+ AudioDeviceDescription::CONNECTION_ANALOG, AudioDeviceDescription::CONNECTION_HDMI,
+ AudioDeviceDescription::CONNECTION_HDMI_ARC,
+ AudioDeviceDescription::CONNECTION_HDMI_EARC, AudioDeviceDescription::CONNECTION_SPDIF};
static int nextId = 0;
using Tag = AudioDeviceAddress::Tag;
+ const auto& deviceDescription = port.ext.get<AudioPortExt::Tag::device>().device.type;
AudioDeviceAddress address;
- switch (suggestDeviceAddressTag(port.ext.get<AudioPortExt::Tag::device>().device.type)) {
- case Tag::id:
- address = AudioDeviceAddress::make<Tag::id>(std::to_string(++nextId));
- break;
- case Tag::mac:
- address = AudioDeviceAddress::make<Tag::mac>(
- std::vector<uint8_t>{1, 2, 3, 4, 5, static_cast<uint8_t>(++nextId & 0xff)});
- break;
- case Tag::ipv4:
- address = AudioDeviceAddress::make<Tag::ipv4>(
- std::vector<uint8_t>{192, 168, 0, static_cast<uint8_t>(++nextId & 0xff)});
- break;
- case Tag::ipv6:
- address = AudioDeviceAddress::make<Tag::ipv6>(std::vector<int32_t>{
- 0xfc00, 0x0123, 0x4567, 0x89ab, 0xcdef, 0, 0, ++nextId & 0xffff});
- break;
- case Tag::alsa:
- address = AudioDeviceAddress::make<Tag::alsa>(std::vector<int32_t>{1, ++nextId});
- break;
+ if (kPointToPointConnections.count(deviceDescription.connection) == 0) {
+ switch (suggestDeviceAddressTag(deviceDescription)) {
+ case Tag::id:
+ address = AudioDeviceAddress::make<Tag::id>(std::to_string(++nextId));
+ break;
+ case Tag::mac:
+ address = AudioDeviceAddress::make<Tag::mac>(
+ std::vector<uint8_t>{1, 2, 3, 4, 5, static_cast<uint8_t>(++nextId & 0xff)});
+ break;
+ case Tag::ipv4:
+ address = AudioDeviceAddress::make<Tag::ipv4>(
+ std::vector<uint8_t>{192, 168, 0, static_cast<uint8_t>(++nextId & 0xff)});
+ break;
+ case Tag::ipv6:
+ address = AudioDeviceAddress::make<Tag::ipv6>(std::vector<int32_t>{
+ 0xfc00, 0x0123, 0x4567, 0x89ab, 0xcdef, 0, 0, ++nextId & 0xffff});
+ break;
+ case Tag::alsa:
+ address = AudioDeviceAddress::make<Tag::alsa>(std::vector<int32_t>{1, ++nextId});
+ break;
+ }
}
AudioPort result = port;
result.ext.get<AudioPortExt::Tag::device>().device.address = std::move(address);
diff --git a/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp b/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
index 3011a5e..1876756 100644
--- a/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
@@ -42,11 +42,11 @@
using aidl::android::hardware::audio::effect::CommandId;
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::Flags;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
using aidl::android::hardware::audio::effect::Parameter;
using aidl::android::hardware::audio::effect::State;
-using aidl::android::hardware::audio::effect::Flags;
using aidl::android::media::audio::common::AudioDeviceDescription;
using aidl::android::media::audio::common::AudioDeviceType;
using aidl::android::media::audio::common::AudioMode;
@@ -87,11 +87,11 @@
};
class AudioEffectDataPathTest : public AudioEffectTest {
- public:
- void SetUp() override {
- AudioEffectTest::SetUp();
- SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
- }
+ public:
+ void SetUp() override {
+ AudioEffectTest::SetUp();
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ }
};
TEST_P(AudioEffectTest, SetupAndTearDown) {
@@ -504,6 +504,11 @@
// Set and get AudioDeviceDescription in Parameter
TEST_P(AudioEffectTest, SetAndGetParameterDeviceDescription) {
+ if (!mDescriptor.common.flags.deviceIndication) {
+ GTEST_SKIP() << "Skipping test as effect does not support deviceIndication"
+ << mDescriptor.common.flags.toString();
+ }
+
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
ASSERT_NO_FATAL_FAILURE(open(mEffect));
@@ -527,6 +532,11 @@
// Set and get AudioMode in Parameter
TEST_P(AudioEffectTest, SetAndGetParameterAudioMode) {
+ if (!mDescriptor.common.flags.audioModeIndication) {
+ GTEST_SKIP() << "Skipping test as effect does not support audioModeIndication"
+ << mDescriptor.common.flags.toString();
+ }
+
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
ASSERT_NO_FATAL_FAILURE(open(mEffect));
@@ -547,6 +557,11 @@
// Set and get AudioSource in Parameter
TEST_P(AudioEffectTest, SetAndGetParameterAudioSource) {
+ if (!mDescriptor.common.flags.audioSourceIndication) {
+ GTEST_SKIP() << "Skipping test as effect does not support audioSourceIndication"
+ << mDescriptor.common.flags.toString();
+ }
+
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
ASSERT_NO_FATAL_FAILURE(open(mEffect));
@@ -567,6 +582,11 @@
// Set and get VolumeStereo in Parameter
TEST_P(AudioEffectTest, SetAndGetParameterVolume) {
+ if (mDescriptor.common.flags.volume == Flags::Volume::NONE) {
+ GTEST_SKIP() << "Skipping test as effect does not support volume"
+ << mDescriptor.common.flags.toString();
+ }
+
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
ASSERT_NO_FATAL_FAILURE(open(mEffect));
diff --git a/automotive/can/1.0/default/libc++fs/include/automotive/filesystem b/automotive/can/1.0/default/libc++fs/include/automotive/filesystem
index 660ad09..bd3dda5 100644
--- a/automotive/can/1.0/default/libc++fs/include/automotive/filesystem
+++ b/automotive/can/1.0/default/libc++fs/include/automotive/filesystem
@@ -9,6 +9,18 @@
//===----------------------------------------------------------------------===//
#ifndef _LIBAUTO_FILESYSTEM
#define _LIBAUTO_FILESYSTEM
+
+// TODO(152067309): Remove this once the libc++ upgrade is complete.
+#include <__config>
+#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION > 8000
+
+#include <filesystem>
+namespace android::hardware::automotive {
+namespace filesystem = std::filesystem;
+}
+
+#else
+
/*
filesystem synopsis
@@ -2696,4 +2708,6 @@
_LIBCPP_POP_MACROS
+#endif // defined(_LIBCPP_VERSION) && _LIBCPP_VERSION > 8000
+
#endif // _LIBAUTO_FILESYSTEM
diff --git a/automotive/can/1.0/default/libc++fs/src/filesystem/directory_iterator.cpp b/automotive/can/1.0/default/libc++fs/src/filesystem/directory_iterator.cpp
index 37c863b..0dbf492 100644
--- a/automotive/can/1.0/default/libc++fs/src/filesystem/directory_iterator.cpp
+++ b/automotive/can/1.0/default/libc++fs/src/filesystem/directory_iterator.cpp
@@ -6,9 +6,15 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+
+// TODO(152067309): Remove this once the libc++ upgrade is complete.
+#include <__config>
+#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 8000
+
/* clang-format off */
#include "automotive/filesystem"
#include <__config>
+
#if defined(_LIBCPP_WIN32API)
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
@@ -395,3 +401,5 @@
} // namespace android::hardware::automotive::filesystem
/* clang-format on */
+
+#endif // defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 8000
diff --git a/automotive/can/1.0/default/libc++fs/src/filesystem/operations.cpp b/automotive/can/1.0/default/libc++fs/src/filesystem/operations.cpp
index 404c0bd..6a76bdc 100644
--- a/automotive/can/1.0/default/libc++fs/src/filesystem/operations.cpp
+++ b/automotive/can/1.0/default/libc++fs/src/filesystem/operations.cpp
@@ -6,6 +6,11 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+
+// TODO(152067309): Remove this once the libc++ upgrade is complete.
+#include <__config>
+#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 8000
+
/* clang-format off */
#include "automotive/filesystem"
#include <array>
@@ -1771,3 +1776,5 @@
#endif
} // namespace android::hardware::automotive::filesystem
/* clang-format on */
+
+#endif // defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 8000
diff --git a/automotive/remoteaccess/Android.bp b/automotive/remoteaccess/Android.bp
index 7cd6f60..e1e9041 100644
--- a/automotive/remoteaccess/Android.bp
+++ b/automotive/remoteaccess/Android.bp
@@ -42,6 +42,5 @@
imports: [],
},
],
- frozen: true,
-
+ frozen: false,
}
diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
index b0935c2..ccfa22d 100644
--- a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
+++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
@@ -40,4 +40,10 @@
void setRemoteTaskCallback(android.hardware.automotive.remoteaccess.IRemoteTaskCallback callback);
void clearRemoteTaskCallback();
void notifyApStateChange(in android.hardware.automotive.remoteaccess.ApState state);
+ boolean isTaskScheduleSupported();
+ void scheduleTask(in android.hardware.automotive.remoteaccess.ScheduleInfo scheduleInfo);
+ void unscheduleTask(String clientId, String scheduleId);
+ void unscheduleAllTasks(String clientId);
+ boolean isTaskScheduled(String clientId, String scheduleId);
+ List<android.hardware.automotive.remoteaccess.ScheduleInfo> getAllScheduledTasks(String clientId);
}
diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
new file mode 100644
index 0000000..a929e10
--- /dev/null
+++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.automotive.remoteaccess;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable ScheduleInfo {
+ String clientId;
+ String scheduleId;
+ byte[] taskData;
+ int count;
+ long startTimeInEpochSeconds;
+ long periodicInSeconds;
+}
diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
index 0f4125f..4912651 100644
--- a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
+++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
@@ -18,6 +18,7 @@
import android.hardware.automotive.remoteaccess.ApState;
import android.hardware.automotive.remoteaccess.IRemoteTaskCallback;
+import android.hardware.automotive.remoteaccess.ScheduleInfo;
/**
* Interface representing a remote wakeup client.
@@ -96,4 +97,69 @@
* <p>If {@code isWakeupRequired} is false, it must not try to wake up AP.
*/
void notifyApStateChange(in ApState state);
+
+ /**
+ * Returns whether task scheduling is supported.
+ *
+ * <p>If this returns {@code true}, user may use {@link scheduleTask} to schedule a task to be
+ * executed at a later time. If the device is off when the task is scheduled to be executed,
+ * the device will be woken up to execute the task.
+ *
+ * @return {@code true} if serverless remote task scheduling is supported.
+ */
+ boolean isTaskScheduleSupported();
+
+ /**
+ * Schedules a task to be executed later even when the vehicle is off.
+ *
+ * <p>If {@link isTaskScheduleSupported} returns {@code false}. This is no-op.
+ *
+ * <p>This sends a scheduled task message to a device external to Android so that the device
+ * can wake up Android and deliver the task through {@link IRemoteTaskCallback}.
+ *
+ * <p>Note that the scheduled task execution is on a best-effort basis. Multiple situations
+ * might cause the task not to execute successfully:
+ *
+ * <ul>
+ * <li>The vehicle is low on battery and the other device decides not to wake up Android.
+ * <li>User turns off vehicle while the task is executing.
+ * <li>The task logic itself fails.
+ *
+ * <p>Must return {@code EX_ILLEGAL_ARGUMENT} if a pending schedule with the same
+ * {@code scheduleId} for this client exists.
+ */
+ void scheduleTask(in ScheduleInfo scheduleInfo);
+
+ /**
+ * Unschedules a scheduled task.
+ *
+ * <p>If {@link isTaskScheduleSupported} returns {@code false}. This is no-op.
+ *
+ * <p>Does nothing if a pending schedule with {@code clientId} and {@code scheduleId} does not
+ * exist.
+ */
+ void unscheduleTask(String clientId, String scheduleId);
+
+ /**
+ * Unschedules all scheduled tasks for the client.
+ *
+ * <p>If {@link isTaskScheduleSupported} returns {@code false}. This is no-op.
+ */
+ void unscheduleAllTasks(String clientId);
+
+ /**
+ * Returns whether the specified task is scheduled.
+ *
+ * <p>If {@link isTaskScheduleSupported} returns {@code false}, This must return {@code false}.
+ */
+ boolean isTaskScheduled(String clientId, String scheduleId);
+
+ /**
+ * Gets all pending scheduled tasks for the client.
+ *
+ * <p>If {@link isTaskScheduleSupported} returns {@code false}. This must return empty array.
+ *
+ * <p>The finished scheduled tasks will not be included.
+ */
+ List<ScheduleInfo> getAllScheduledTasks(String clientId);
}
diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
new file mode 100644
index 0000000..cf1437b
--- /dev/null
+++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+package android.hardware.automotive.remoteaccess;
+
+@VintfStability
+@JavaDerive(equals=true, toString=true)
+parcelable ScheduleInfo {
+ /**
+ * The ID used to identify the client this schedule is for. This must be one of the
+ * preconfigured remote access serverless client ID defined in car service resource
+ * {@code R.xml.remote_access_serverless_client_map}.
+ */
+ String clientId;
+ /**
+ * A unique scheduling ID (among the same client). Adding a new schedule info with a duplicate
+ * scheduleId will return {@code EX_ILLEGAL_ARGUMENT}.
+ */
+ String scheduleId;
+ /**
+ * The opaque task data that will be sent back to the remote task client app when the task is
+ * executed. It is not interpreted/parsed by the Android system.
+ */
+ byte[] taskData;
+ /**
+ * How many times this task will be executed. 0 means infinite.
+ *
+ * <p>This must be >= 0.
+ */
+ int count;
+ /**
+ * The start time in epoch seconds.
+ *
+ * <p>The external device issuing remote task must have a clock synced with the
+ * {@code System.currentTimeMillis()} used in Android system.
+ *
+ * <p>Optionally, the VHAL property {@code EPOCH_TIME} can be used to sync the time.
+ *
+ * <p>This must be >= 0.
+ */
+ long startTimeInEpochSeconds;
+ /**
+ * The interval (in seconds) between scheduled task execution.
+ *
+ * <p>This must be >=0. This is not useful when {@code count} is 1. If this is 0,
+ * The tasks will be delivered multiple times with no interval in between.
+ */
+ long periodicInSeconds;
+}
diff --git a/automotive/remoteaccess/hal/default/Android.bp b/automotive/remoteaccess/hal/default/Android.bp
index 48a7309..70dba30 100644
--- a/automotive/remoteaccess/hal/default/Android.bp
+++ b/automotive/remoteaccess/hal/default/Android.bp
@@ -47,9 +47,20 @@
],
}
+// TODO(b/295393732): remove this once we finish the migration from V1 to V2.
cc_binary {
name: "android.hardware.automotive.remoteaccess@V1-default-service",
defaults: ["remote-access-hal-defaults"],
+ vintf_fragments: ["remoteaccess-default-service-v1.xml"],
+ init_rc: ["remoteaccess-default-service-v1.rc"],
+ cflags: [
+ "-DGRPC_SERVICE_ADDRESS=\"10.0.2.2:50051\"",
+ ],
+}
+
+cc_binary {
+ name: "android.hardware.automotive.remoteaccess@V2-default-service",
+ defaults: ["remote-access-hal-defaults"],
vintf_fragments: ["remoteaccess-default-service.xml"],
init_rc: ["remoteaccess-default-service.rc"],
cflags: [
@@ -57,9 +68,21 @@
],
}
+// TODO(b/295393732): remove this once we finish the migration from V1 to V2.
cc_binary {
name: "android.hardware.automotive.remoteaccess@V1-tcu-test-service",
defaults: ["remote-access-hal-defaults"],
+ vintf_fragments: ["remoteaccess-default-service-v1.xml"],
+ init_rc: ["remoteaccess-tcu-test-service-v1.rc"],
+ cflags: [
+ "-DGRPC_SERVICE_ADDRESS=\"10.10.10.1:50051\"",
+ "-DGRPC_SERVICE_IFNAME=\"eth1\"",
+ ],
+}
+
+cc_binary {
+ name: "android.hardware.automotive.remoteaccess@V2-tcu-test-service",
+ defaults: ["remote-access-hal-defaults"],
vintf_fragments: ["remoteaccess-default-service.xml"],
init_rc: ["remoteaccess-tcu-test-service.rc"],
cflags: [
@@ -77,7 +100,7 @@
"src/RemoteAccessService.cpp",
],
whole_static_libs: [
- "android.hardware.automotive.remoteaccess-V1-ndk",
+ "android.hardware.automotive.remoteaccess-V2-ndk",
"wakeup_client_protos",
"libvhalclient",
],
@@ -99,7 +122,7 @@
}
cc_fuzz {
- name: "android.hardware.automotive.remoteaccess@V1-default-service.aidl_fuzzer",
+ name: "android.hardware.automotive.remoteaccess@V2-default-service.aidl_fuzzer",
srcs: ["fuzzer/fuzzer.cpp"],
whole_static_libs: [
"RemoteAccessService",
diff --git a/automotive/remoteaccess/hal/default/include/RemoteAccessService.h b/automotive/remoteaccess/hal/default/include/RemoteAccessService.h
index b18986a..1fc4037 100644
--- a/automotive/remoteaccess/hal/default/include/RemoteAccessService.h
+++ b/automotive/remoteaccess/hal/default/include/RemoteAccessService.h
@@ -21,6 +21,7 @@
#include <aidl/android/hardware/automotive/remoteaccess/BnRemoteAccess.h>
#include <aidl/android/hardware/automotive/remoteaccess/BnRemoteTaskCallback.h>
#include <aidl/android/hardware/automotive/remoteaccess/IRemoteTaskCallback.h>
+#include <aidl/android/hardware/automotive/remoteaccess/ScheduleInfo.h>
#include <android-base/thread_annotations.h>
#include <android/binder_auto_utils.h>
#include <utils/SystemClock.h>
@@ -78,6 +79,25 @@
ndk::ScopedAStatus notifyApStateChange(
const aidl::android::hardware::automotive::remoteaccess::ApState& newState) override;
+ ndk::ScopedAStatus isTaskScheduleSupported(bool* out) override;
+
+ ndk::ScopedAStatus scheduleTask(
+ const aidl::android::hardware::automotive::remoteaccess::ScheduleInfo& scheduleInfo)
+ override;
+
+ ndk::ScopedAStatus unscheduleTask(const std::string& clientId,
+ const std::string& scheduleId) override;
+
+ ndk::ScopedAStatus unscheduleAllTasks(const std::string& clientId) override;
+
+ ndk::ScopedAStatus isTaskScheduled(const std::string& clientId, const std::string& scheduleId,
+ bool* out) override;
+
+ ndk::ScopedAStatus getAllScheduledTasks(
+ const std::string& clientId,
+ std::vector<aidl::android::hardware::automotive::remoteaccess::ScheduleInfo>* out)
+ override;
+
binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
private:
diff --git a/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.rc b/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.rc
new file mode 100644
index 0000000..b7a9cdc
--- /dev/null
+++ b/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.rc
@@ -0,0 +1,4 @@
+service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V1-default-service
+ class hal
+ user vehicle_network
+ group system inet
diff --git a/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.xml b/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.xml
new file mode 100644
index 0000000..d050a1b
--- /dev/null
+++ b/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.xml
@@ -0,0 +1,7 @@
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.automotive.remoteaccess</name>
+ <version>1</version>
+ <fqname>IRemoteAccess/default</fqname>
+ </hal>
+</manifest>
diff --git a/automotive/remoteaccess/hal/default/remoteaccess-default-service.rc b/automotive/remoteaccess/hal/default/remoteaccess-default-service.rc
index b7a9cdc..c9b282c 100644
--- a/automotive/remoteaccess/hal/default/remoteaccess-default-service.rc
+++ b/automotive/remoteaccess/hal/default/remoteaccess-default-service.rc
@@ -1,4 +1,4 @@
-service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V1-default-service
+service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V2-default-service
class hal
user vehicle_network
group system inet
diff --git a/automotive/remoteaccess/hal/default/remoteaccess-default-service.xml b/automotive/remoteaccess/hal/default/remoteaccess-default-service.xml
index d050a1b..44ac309 100644
--- a/automotive/remoteaccess/hal/default/remoteaccess-default-service.xml
+++ b/automotive/remoteaccess/hal/default/remoteaccess-default-service.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.automotive.remoteaccess</name>
- <version>1</version>
+ <version>2</version>
<fqname>IRemoteAccess/default</fqname>
</hal>
</manifest>
diff --git a/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service-v1.rc b/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service-v1.rc
new file mode 100644
index 0000000..59315eb
--- /dev/null
+++ b/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service-v1.rc
@@ -0,0 +1,5 @@
+service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V1-tcu-test-service
+ class hal
+ user vehicle_network
+ group system inet
+ capabilities NET_RAW
diff --git a/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service.rc b/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service.rc
index 59315eb..19faaf4 100644
--- a/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service.rc
+++ b/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service.rc
@@ -1,4 +1,4 @@
-service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V1-tcu-test-service
+service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V2-tcu-test-service
class hal
user vehicle_network
group system inet
diff --git a/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp b/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp
index 5081ac0..7721bf4 100644
--- a/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp
+++ b/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp
@@ -39,6 +39,7 @@
using ::aidl::android::hardware::automotive::remoteaccess::ApState;
using ::aidl::android::hardware::automotive::remoteaccess::IRemoteTaskCallback;
+using ::aidl::android::hardware::automotive::remoteaccess::ScheduleInfo;
using ::aidl::android::hardware::automotive::vehicle::VehicleProperty;
using ::android::base::Error;
using ::android::base::ParseInt;
@@ -313,6 +314,41 @@
return ScopedAStatus::ok();
}
+ScopedAStatus RemoteAccessService::isTaskScheduleSupported([[maybe_unused]] bool* out) {
+ // TODO(b/297271235): implement this.
+ return ScopedAStatus::ok();
+}
+
+ScopedAStatus RemoteAccessService::scheduleTask([[maybe_unused]] const ScheduleInfo& scheduleInfo) {
+ // TODO(b/297271235): implement this.
+ return ScopedAStatus::ok();
+}
+
+ScopedAStatus RemoteAccessService::unscheduleTask([[maybe_unused]] const std::string& clientId,
+ [[maybe_unused]] const std::string& scheduleId) {
+ // TODO(b/297271235): implement this.
+ return ScopedAStatus::ok();
+}
+
+ScopedAStatus RemoteAccessService::unscheduleAllTasks(
+ [[maybe_unused]] const std::string& clientId) {
+ // TODO(b/297271235): implement this.
+ return ScopedAStatus::ok();
+}
+
+ScopedAStatus RemoteAccessService::isTaskScheduled([[maybe_unused]] const std::string& clientId,
+ [[maybe_unused]] const std::string& scheduleId,
+ [[maybe_unused]] bool* out) {
+ // TODO(b/297271235): implement this.
+ return ScopedAStatus::ok();
+}
+
+ScopedAStatus RemoteAccessService::getAllScheduledTasks(const std::string& clientId,
+ std::vector<ScheduleInfo>* out) {
+ // TODO(b/297271235): implement this.
+ return ScopedAStatus::ok();
+}
+
bool RemoteAccessService::checkDumpPermission() {
uid_t uid = AIBinder_getCallingUid();
return uid == AID_ROOT || uid == AID_SHELL || uid == AID_SYSTEM;
diff --git a/automotive/remoteaccess/test_grpc_server/README.md b/automotive/remoteaccess/test_grpc_server/README.md
index af3d54a..d2b6bbe 100644
--- a/automotive/remoteaccess/test_grpc_server/README.md
+++ b/automotive/remoteaccess/test_grpc_server/README.md
@@ -141,7 +141,7 @@
* The android lunch target: sdk_car_x86_64-userdebug and
cf_x86_64_auto-userdebug already contains the default remote access HAL. For
other lunch target, you can add the default remote access HAL by adding
- 'android.hardware.automotive.remoteaccess@V1-default-service' to
+ 'android.hardware.automotive.remoteaccess@V2-default-service' to
'PRODUCT_PACKAGES' variable in mk file, see `device/generic/car/common/car.mk`
as example.
diff --git a/automotive/vehicle/aidl/impl/README.md b/automotive/vehicle/aidl/impl/README.md
index 121ffd1..2cd3a3e 100644
--- a/automotive/vehicle/aidl/impl/README.md
+++ b/automotive/vehicle/aidl/impl/README.md
@@ -46,7 +46,7 @@
use this library, along with their own implementation for `IVehicleHardware`
interface.
-Also defines a binary `android.hardware.automotive.vehicle@V1-default-service`
+Also defines a binary `android.hardware.automotive.vehicle@V3-default-service`
which is the reference VHAL implementation. It implements `IVehicle.aidl`
interface. It uses `DefaultVehicleHal`, along with `FakeVehicleHardware`
(in fake_impl). It simulates the vehicle bus interaction by using an
diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp
index 4feea79..c29345f 100644
--- a/automotive/vehicle/aidl/impl/vhal/Android.bp
+++ b/automotive/vehicle/aidl/impl/vhal/Android.bp
@@ -19,7 +19,7 @@
}
cc_binary {
- name: "android.hardware.automotive.vehicle@V1-default-service",
+ name: "android.hardware.automotive.vehicle@V3-default-service",
vendor: true,
defaults: [
"FakeVehicleHardwareDefaults",
@@ -68,7 +68,7 @@
}
cc_fuzz {
- name: "android.hardware.automotive.vehicle@V1-default-service_fuzzer",
+ name: "android.hardware.automotive.vehicle-default-service_fuzzer",
vendor: true,
defaults: [
"FakeVehicleHardwareDefaults",
diff --git a/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc
index 19267cd..9fa7b98 100644
--- a/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc
+++ b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc
@@ -1,4 +1,4 @@
-service vendor.vehicle-hal-default /vendor/bin/hw/android.hardware.automotive.vehicle@V1-default-service
+service vendor.vehicle-hal-default /vendor/bin/hw/android.hardware.automotive.vehicle@V3-default-service
class early_hal
user vehicle_network
group system inet
diff --git a/boot/1.1/default/Android.bp b/boot/1.1/default/Android.bp
index 0b0a5b7..e7a8d6e 100644
--- a/boot/1.1/default/Android.bp
+++ b/boot/1.1/default/Android.bp
@@ -20,6 +20,7 @@
srcs: ["BootControl.cpp"],
shared_libs: [
+ "libbase",
"liblog",
"libhidlbase",
"libhardware",
diff --git a/boot/1.1/default/boot_control/Android.bp b/boot/1.1/default/boot_control/Android.bp
index 6aa30c2..d0dcb59 100644
--- a/boot/1.1/default/boot_control/Android.bp
+++ b/boot/1.1/default/boot_control/Android.bp
@@ -35,14 +35,13 @@
],
shared_libs: [
- "android.hardware.boot@1.1",
- "libbase",
"liblog",
],
static_libs: [
"libbootloader_message",
"libfstab",
],
+
}
cc_library_static {
@@ -52,7 +51,13 @@
recovery_available: true,
vendor_available: true,
- srcs: ["libboot_control.cpp"],
+ srcs: [
+ "libboot_control.cpp",
+ ],
+ static_libs: [
+ "android.hardware.boot@1.1",
+ "libbase",
+ ],
}
cc_library_shared {
@@ -67,6 +72,8 @@
"libboot_control",
],
shared_libs: [
+ "android.hardware.boot@1.1",
+ "libbase",
"libhardware",
],
}
diff --git a/boot/1.2/default/Android.bp b/boot/1.2/default/Android.bp
index 4e1c35e..f1e9c34 100644
--- a/boot/1.2/default/Android.bp
+++ b/boot/1.2/default/Android.bp
@@ -20,6 +20,7 @@
srcs: ["BootControl.cpp"],
shared_libs: [
+ "libbase",
"liblog",
"libhidlbase",
"libhardware",
diff --git a/boot/aidl/default/Android.bp b/boot/aidl/default/Android.bp
index dcb40db..c1d3c57 100644
--- a/boot/aidl/default/Android.bp
+++ b/boot/aidl/default/Android.bp
@@ -27,7 +27,39 @@
name: "android.hardware.boot-service_common",
relative_install_path: "hw",
defaults: ["libboot_control_defaults"],
+ srcs: [
+ "main.cpp",
+ "BootControl.cpp",
+ ],
+}
+
+cc_binary {
+ name: "android.hardware.boot-service.default",
+ defaults: ["android.hardware.boot-service_common"],
+ vendor: true,
+
+ stl: "c++_static",
+ shared_libs: [
+ "libbinder_ndk",
+ "liblog",
+ ],
+ static_libs: [
+ "android.hardware.boot@1.1",
+ "android.hardware.boot-V1-ndk",
+ "libbase",
+ "libboot_control",
+ ],
+
+ installable: false, // installed in APEX
+}
+
+cc_binary {
+ name: "android.hardware.boot-service.default_recovery",
+ defaults: ["android.hardware.boot-service_common"],
+ init_rc: ["android.hardware.boot-service.default_recovery.rc"],
vintf_fragments: ["android.hardware.boot-service.default.xml"],
+ recovery: true,
+
shared_libs: [
"libbase",
"libbinder_ndk",
@@ -37,19 +69,35 @@
static_libs: [
"libboot_control",
],
- srcs: ["main.cpp", "BootControl.cpp"],
}
-cc_binary {
- name: "android.hardware.boot-service.default",
- defaults: ["android.hardware.boot-service_common"],
- init_rc: ["android.hardware.boot-service.default.rc"],
+prebuilt_etc {
+ name: "android.hardware.boot-service.default.rc",
+ src: "android.hardware.boot-service.default.rc",
+ installable: false,
+}
+
+prebuilt_etc {
+ name: "android.hardware.boot-service.default.xml",
+ src: "android.hardware.boot-service.default.xml",
+ sub_dir: "vintf",
+ installable: false,
+}
+
+apex {
+ name: "com.android.hardware.boot",
vendor: true,
-}
+ manifest: "apex_manifest.json",
+ file_contexts: "apex_file_contexts",
+ key: "com.android.hardware.key",
+ certificate: ":com.android.hardware.certificate",
+ updatable: false,
-cc_binary {
- name: "android.hardware.boot-service.default_recovery",
- defaults: ["android.hardware.boot-service_common"],
- init_rc: ["android.hardware.boot-service.default_recovery.rc"],
- recovery: true,
+ binaries: [
+ "android.hardware.boot-service.default",
+ ],
+ prebuilts: [
+ "android.hardware.boot-service.default.rc",
+ "android.hardware.boot-service.default.xml",
+ ],
}
diff --git a/boot/aidl/default/android.hardware.boot-service.default.rc b/boot/aidl/default/android.hardware.boot-service.default.rc
index 589f803..5090e2c 100644
--- a/boot/aidl/default/android.hardware.boot-service.default.rc
+++ b/boot/aidl/default/android.hardware.boot-service.default.rc
@@ -1,4 +1,4 @@
-service vendor.boot-default /vendor/bin/hw/android.hardware.boot-service.default
+service vendor.boot-default /apex/com.android.hardware.boot/bin/hw/android.hardware.boot-service.default
class early_hal
user root
group root
diff --git a/boot/aidl/default/apex_file_contexts b/boot/aidl/default/apex_file_contexts
new file mode 100644
index 0000000..bf03585
--- /dev/null
+++ b/boot/aidl/default/apex_file_contexts
@@ -0,0 +1,3 @@
+(/.*)? u:object_r:vendor_file:s0
+/etc(/.*)? u:object_r:vendor_configs_file:s0
+/bin/hw/android\.hardware\.boot-service\.default u:object_r:hal_bootctl_default_exec:s0
diff --git a/boot/aidl/default/apex_manifest.json b/boot/aidl/default/apex_manifest.json
new file mode 100644
index 0000000..92661c9
--- /dev/null
+++ b/boot/aidl/default/apex_manifest.json
@@ -0,0 +1,5 @@
+{
+ "name": "com.android.hardware.boot",
+ "version": 1,
+ "vendorBootstrap": true
+}
\ No newline at end of file
diff --git a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
index 2845180..b6b5206 100644
--- a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
+++ b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
@@ -242,6 +242,7 @@
verifyCameraCharacteristics(chars);
verifyMonochromeCharacteristics(chars);
verifyRecommendedConfigs(chars);
+ verifyHighSpeedRecordingCharacteristics(name, chars);
verifyLogicalOrUltraHighResCameraMetadata(name, device, chars, cameraDeviceNames);
ASSERT_TRUE(ret.isOk());
diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp
index 5f9d605..6a17453 100644
--- a/camera/provider/aidl/vts/camera_aidl_test.cpp
+++ b/camera/provider/aidl/vts/camera_aidl_test.cpp
@@ -831,6 +831,90 @@
ASSERT_TRUE(hasBokehStillCaptureMode || hasBokehContinuousMode || hasVendorMode);
}
+void CameraAidlTest::verifyHighSpeedRecordingCharacteristics(const std::string& cameraName,
+ const CameraMetadata& chars) {
+ const camera_metadata_t* metadata =
+ reinterpret_cast<const camera_metadata_t*>(chars.metadata.data());
+
+ // Check capabilities
+ bool hasHighSpeedRecordingCapability = false;
+ bool hasUltraHighResolutionCapability = false;
+ camera_metadata_ro_entry entry;
+ int rc =
+ find_camera_metadata_ro_entry(metadata, ANDROID_REQUEST_AVAILABLE_CAPABILITIES, &entry);
+ if ((0 == rc) && (entry.count > 0)) {
+ hasHighSpeedRecordingCapability =
+ std::find(entry.data.u8, entry.data.u8 + entry.count,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO) !=
+ entry.data.u8 + entry.count;
+
+ hasUltraHighResolutionCapability =
+ std::find(entry.data.u8, entry.data.u8 + entry.count,
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR) !=
+ entry.data.u8 + entry.count;
+ }
+
+ // Check high speed video configurations
+ camera_metadata_ro_entry highSpeedEntry;
+ rc = find_camera_metadata_ro_entry(
+ metadata, ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS, &highSpeedEntry);
+ bool hasHighSpeedEntry = (0 == rc && highSpeedEntry.count > 0);
+
+ camera_metadata_ro_entry highSpeedMaxResEntry;
+ rc = find_camera_metadata_ro_entry(
+ metadata, ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS_MAXIMUM_RESOLUTION,
+ &highSpeedMaxResEntry);
+ bool hasHighSpeedMaxResEntry = (0 == rc && highSpeedMaxResEntry.count > 0);
+
+ // High speed recording configuration entry must be available based on capabilities
+ bool noHighSpeedRecording =
+ !hasHighSpeedRecordingCapability && !hasHighSpeedEntry && !hasHighSpeedMaxResEntry;
+ if (noHighSpeedRecording) {
+ return;
+ }
+ bool hasHighSpeedRecording = hasHighSpeedRecordingCapability && hasHighSpeedEntry &&
+ ((hasHighSpeedMaxResEntry && hasUltraHighResolutionCapability) ||
+ !hasHighSpeedMaxResEntry);
+ ASSERT_TRUE(hasHighSpeedRecording);
+
+ std::string version, cameraId;
+ ASSERT_TRUE(matchDeviceName(cameraName, mProviderType, &version, &cameraId));
+ bool needBatchSizeCheck = (version != CAMERA_DEVICE_API_VERSION_1);
+
+ // Check each entry item
+ ASSERT_TRUE(highSpeedEntry.count > 0 && highSpeedEntry.count % 5 == 0);
+ for (auto i = 4; i < highSpeedEntry.count; i += 5) {
+ int32_t fps_min = highSpeedEntry.data.i32[i - 2];
+ int32_t fps_max = highSpeedEntry.data.i32[i - 1];
+ int32_t batch_size_max = highSpeedEntry.data.i32[i];
+ int32_t allowedMaxBatchSize = fps_max / 30;
+
+ ASSERT_GE(fps_max, 120);
+ ASSERT_TRUE(fps_min % 30 == 0 && fps_max % 30 == 0);
+ if (needBatchSizeCheck) {
+ ASSERT_LE(batch_size_max, 32);
+ ASSERT_TRUE(allowedMaxBatchSize % batch_size_max == 0);
+ }
+ }
+
+ if (hasHighSpeedMaxResEntry) {
+ ASSERT_TRUE(highSpeedMaxResEntry.count > 0 && highSpeedMaxResEntry.count % 5 == 0);
+ for (auto i = 4; i < highSpeedMaxResEntry.count; i += 5) {
+ int32_t fps_min = highSpeedMaxResEntry.data.i32[i - 2];
+ int32_t fps_max = highSpeedMaxResEntry.data.i32[i - 1];
+ int32_t batch_size_max = highSpeedMaxResEntry.data.i32[i];
+ int32_t allowedMaxBatchSize = fps_max / 30;
+
+ ASSERT_GE(fps_max, 120);
+ ASSERT_TRUE(fps_min % 30 == 0 && fps_max % 30 == 0);
+ if (needBatchSizeCheck) {
+ ASSERT_LE(batch_size_max, 32);
+ ASSERT_TRUE(allowedMaxBatchSize % batch_size_max == 0);
+ }
+ }
+ }
+}
+
Status CameraAidlTest::getAvailableOutputStreams(const camera_metadata_t* staticMeta,
std::vector<AvailableStream>& outputStreams,
const AvailableStream* threshold,
diff --git a/camera/provider/aidl/vts/camera_aidl_test.h b/camera/provider/aidl/vts/camera_aidl_test.h
index 6f8f380..3018d5a 100644
--- a/camera/provider/aidl/vts/camera_aidl_test.h
+++ b/camera/provider/aidl/vts/camera_aidl_test.h
@@ -253,6 +253,9 @@
static void verifyExtendedSceneModeCharacteristics(const camera_metadata_t* metadata);
+ void verifyHighSpeedRecordingCharacteristics(const std::string& cameraName,
+ const CameraMetadata& chars);
+
static void verifyZoomCharacteristics(const camera_metadata_t* metadata);
static void verifyRecommendedConfigs(const CameraMetadata& chars);
@@ -610,6 +613,8 @@
namespace {
// device@<major>.<minor>/<type>/id
const char* kDeviceNameRE = "device@([0-9]+\\.[0-9]+)/\\s+/(.+)";
+const std::string CAMERA_DEVICE_API_VERSION_1 = "1.1";
+
const int32_t kMaxVideoWidth = 4096;
const int32_t kMaxVideoHeight = 2160;
diff --git a/cas/aidl/default/Android.bp b/cas/aidl/default/Android.bp
index 576016e..9d094e0 100644
--- a/cas/aidl/default/Android.bp
+++ b/cas/aidl/default/Android.bp
@@ -26,6 +26,7 @@
"liblog",
"libutils",
"libcutils",
+ "libvndksupport",
],
static_libs: [
"libaidlcommonsupport",
@@ -43,34 +44,39 @@
srcs: ["service.cpp"],
+ stl: "c++_static",
static_libs: [
+ "android.hardware.cas-V1-ndk",
+ "android.hardware.common-V2-ndk",
"libaidlcommonsupport",
+ "libbase",
"libcasexampleimpl",
+ "libcutils",
+ "libutils",
],
shared_libs: [
- "android.hardware.cas-V1-ndk",
- "libbase",
"libbinder_ndk",
"liblog",
- "libutils",
- "libcutils",
+ "libvndksupport",
],
header_libs: ["media_plugin_headers"],
- vintf_fragments: ["android.hardware.cas-service.xml"],
}
cc_binary {
name: "android.hardware.cas-service.example",
defaults: ["cas_service_example_defaults"],
- init_rc: ["cas-default.rc"],
+ // Installed in APEX
+ installable: false,
}
+// TODO(b/297467514) Convert to VAPEX
cc_binary {
name: "android.hardware.cas-service.example-lazy",
defaults: ["cas_service_example_defaults"],
init_rc: ["cas-default-lazy.rc"],
+ vintf_fragments: ["android.hardware.cas-service.xml"],
cflags: ["-DLAZY_SERVICE"],
- overrides: ["android.hardware.cas-service.example"],
+ overrides: ["com.android.hardware.cas"],
}
cc_fuzz {
@@ -84,6 +90,7 @@
"android.hardware.cas-V1-ndk",
"libcutils",
"liblog",
+ "libvndksupport",
],
static_libs: [
"libaidlcommonsupport",
@@ -94,3 +101,34 @@
componentid: 1344,
},
}
+
+apex {
+ name: "com.android.hardware.cas",
+ manifest: "manifest.json",
+ file_contexts: "file_contexts",
+ key: "com.android.hardware.key",
+ certificate: ":com.android.hardware.certificate",
+ updatable: false,
+ vendor: true,
+
+ binaries: [
+ "android.hardware.cas-service.example",
+ ],
+ prebuilts: [
+ "cas-default.rc",
+ "android.hardware.cas-service.xml",
+ ],
+}
+
+prebuilt_etc {
+ name: "cas-default.rc",
+ src: "cas-default.rc",
+ installable: false,
+}
+
+prebuilt_etc {
+ name: "android.hardware.cas-service.xml",
+ src: "android.hardware.cas-service.xml",
+ sub_dir: "vintf",
+ installable: false,
+}
diff --git a/cas/aidl/default/SharedLibrary.cpp b/cas/aidl/default/SharedLibrary.cpp
index c12d17d..6322ff3 100644
--- a/cas/aidl/default/SharedLibrary.cpp
+++ b/cas/aidl/default/SharedLibrary.cpp
@@ -19,6 +19,7 @@
#include "SharedLibrary.h"
#include <dlfcn.h>
#include <utils/Log.h>
+#include <vndksupport/linker.h>
namespace aidl {
namespace android {
@@ -26,12 +27,12 @@
namespace cas {
SharedLibrary::SharedLibrary(const String8& path) {
- mLibHandle = dlopen(path.c_str(), RTLD_NOW);
+ mLibHandle = android_load_sphal_library(path.c_str(), RTLD_NOW);
}
SharedLibrary::~SharedLibrary() {
if (mLibHandle != NULL) {
- dlclose(mLibHandle);
+ android_unload_sphal_library(mLibHandle);
mLibHandle = NULL;
}
}
diff --git a/cas/aidl/default/cas-default.rc b/cas/aidl/default/cas-default.rc
index 5a60368..0ac7fe5 100644
--- a/cas/aidl/default/cas-default.rc
+++ b/cas/aidl/default/cas-default.rc
@@ -1,4 +1,4 @@
-service vendor.cas-default /vendor/bin/hw/android.hardware.cas-service.example
+service vendor.cas-default /apex/com.android.hardware.cas/bin/hw/android.hardware.cas-service.example
interface aidl android.hardware.cas.IMediaCasService/default
class hal
user media
diff --git a/cas/aidl/default/file_contexts b/cas/aidl/default/file_contexts
new file mode 100644
index 0000000..98bde53
--- /dev/null
+++ b/cas/aidl/default/file_contexts
@@ -0,0 +1,3 @@
+(/.*)? u:object_r:vendor_file:s0
+/etc(/.*)? u:object_r:vendor_configs_file:s0
+/bin/hw/android\.hardware\.cas-service\.example u:object_r:hal_cas_default_exec:s0
diff --git a/cas/aidl/default/manifest.json b/cas/aidl/default/manifest.json
new file mode 100644
index 0000000..16b4f67
--- /dev/null
+++ b/cas/aidl/default/manifest.json
@@ -0,0 +1,9 @@
+{
+ "name": "com.android.hardware.cas",
+ "version": 1,
+ // For CAS HAL to open plugins from /vendor/lib, "vendor" namespace should be imported.
+ // ":sphal" is an alias for the "vendor" namespace in Vendor APEX.
+ "requireNativeLibs": [
+ ":sphal"
+ ]
+}
diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml
index 57fa2bf..0013923 100644
--- a/compatibility_matrices/compatibility_matrix.9.xml
+++ b/compatibility_matrices/compatibility_matrix.9.xml
@@ -102,6 +102,7 @@
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.automotive.remoteaccess</name>
+ <version>1-2</version>
<interface>
<name>IRemoteAccess</name>
<instance>default</instance>
diff --git a/contexthub/aidl/default/Android.bp b/contexthub/aidl/default/Android.bp
index 74bac69..03213bc 100644
--- a/contexthub/aidl/default/Android.bp
+++ b/contexthub/aidl/default/Android.bp
@@ -57,3 +57,34 @@
],
srcs: ["main.cpp"],
}
+
+prebuilt_etc {
+ name: "android.hardware.contexthub-service.example.rc",
+ src: "android.hardware.contexthub-service.example.rc",
+ installable: false,
+}
+
+prebuilt_etc {
+ name: "contexthub-default.xml",
+ src: "contexthub-default.xml",
+ sub_dir: "vintf",
+ installable: false,
+}
+
+apex {
+ name: "com.android.hardware.contexthub",
+ vendor: true,
+ manifest: "apex_manifest.json",
+ file_contexts: "apex_file_contexts",
+ key: "com.android.hardware.key",
+ certificate: ":com.android.hardware.certificate",
+ updatable: false,
+
+ binaries: [
+ "android.hardware.contexthub-service.example",
+ ],
+ prebuilts: [
+ "android.hardware.contexthub-service.example.rc",
+ "contexthub-default.xml",
+ ],
+}
diff --git a/contexthub/aidl/default/android.hardware.contexthub-service.example.rc b/contexthub/aidl/default/android.hardware.contexthub-service.example.rc
new file mode 100644
index 0000000..7d5d2aa
--- /dev/null
+++ b/contexthub/aidl/default/android.hardware.contexthub-service.example.rc
@@ -0,0 +1,4 @@
+service vendor.contexthub-default /apex/com.android.hardware.contexthub/bin/hw/android.hardware.contexthub-service.example
+ class hal
+ user context_hub
+ group context_hub
diff --git a/contexthub/aidl/default/apex_file_contexts b/contexthub/aidl/default/apex_file_contexts
new file mode 100644
index 0000000..c3c67df
--- /dev/null
+++ b/contexthub/aidl/default/apex_file_contexts
@@ -0,0 +1,3 @@
+(/.*)? u:object_r:vendor_file:s0
+/etc(/.*)? u:object_r:vendor_configs_file:s0
+/bin/hw/android\.hardware\.contexthub-service\.example u:object_r:hal_contexthub_default_exec:s0
diff --git a/contexthub/aidl/default/apex_manifest.json b/contexthub/aidl/default/apex_manifest.json
new file mode 100644
index 0000000..aed7081
--- /dev/null
+++ b/contexthub/aidl/default/apex_manifest.json
@@ -0,0 +1,4 @@
+{
+ "name": "com.android.hardware.contexthub",
+ "version": 1
+}
\ No newline at end of file
diff --git a/dumpstate/aidl/default/Android.bp b/dumpstate/aidl/default/Android.bp
index 45fdc17..a9da69c 100644
--- a/dumpstate/aidl/default/Android.bp
+++ b/dumpstate/aidl/default/Android.bp
@@ -44,3 +44,41 @@
"-DLOG_TAG=\"android.hardware.dumpstate-service.example\"",
],
}
+
+prebuilt_etc {
+ name: "dumpstate-default.xml",
+ src: "dumpstate-default.xml",
+ sub_dir: "vintf",
+ installable: false,
+}
+
+prebuilt_etc {
+ name: "dumpstate-default.rc",
+ src: ":gen-dumpstate-default.rc-for-apex",
+ installable: false,
+}
+
+genrule {
+ name: "gen-dumpstate-default.rc-for-apex",
+ srcs: ["dumpstate-default.rc"],
+ out: ["dumpstate-default-apex.rc"],
+ cmd: "sed -E 's/\\/vendor\\/bin\\/hw/\\/apex\\/com.android.hardware.dumpstate\\/bin\\/hw/' $(in) > $(out)",
+}
+
+apex {
+ name: "com.android.hardware.dumpstate",
+ vendor: true,
+ manifest: "apex_manifest.json",
+ file_contexts: "apex_file_contexts",
+ key: "com.android.hardware.key",
+ certificate: ":com.android.hardware.certificate",
+ updatable: false,
+
+ binaries: [
+ "android.hardware.dumpstate-service.example",
+ ],
+ prebuilts: [
+ "dumpstate-default.rc",
+ "dumpstate-default.xml",
+ ],
+}
diff --git a/dumpstate/aidl/default/apex_file_contexts b/dumpstate/aidl/default/apex_file_contexts
new file mode 100644
index 0000000..91153a9
--- /dev/null
+++ b/dumpstate/aidl/default/apex_file_contexts
@@ -0,0 +1,3 @@
+(/.*)? u:object_r:vendor_file:s0
+/etc(/.*)? u:object_r:vendor_configs_file:s0
+/bin/hw/android\.hardware\.dumpstate-service\.example u:object_r:hal_dumpstate_default_exec:s0
\ No newline at end of file
diff --git a/dumpstate/aidl/default/apex_manifest.json b/dumpstate/aidl/default/apex_manifest.json
new file mode 100644
index 0000000..32beea4
--- /dev/null
+++ b/dumpstate/aidl/default/apex_manifest.json
@@ -0,0 +1,4 @@
+{
+ "name": "com.android.hardware.dumpstate",
+ "version": 1
+}
\ No newline at end of file
diff --git a/memtrack/aidl/default/Android.bp b/memtrack/aidl/default/Android.bp
index 6c77177..cf95bbb 100644
--- a/memtrack/aidl/default/Android.bp
+++ b/memtrack/aidl/default/Android.bp
@@ -37,3 +37,56 @@
"Memtrack.cpp",
],
}
+
+cc_binary {
+ name: "android.hardware.memtrack-service.apex",
+ stem: "android.hardware.memtrack-service.example",
+ relative_install_path: "hw",
+ vendor: true,
+
+ stl: "c++_static",
+ static_libs: [
+ "libbase",
+ "android.hardware.memtrack-V1-ndk",
+ ],
+ shared_libs: [
+ "libbinder_ndk",
+ "liblog",
+ ],
+ srcs: [
+ "main.cpp",
+ "Memtrack.cpp",
+ ],
+ installable: false, // installed in APEX
+}
+
+prebuilt_etc {
+ name: "memtrack-default-apex.rc",
+ src: "memtrack-default-apex.rc",
+ installable: false,
+}
+
+prebuilt_etc {
+ name: "memtrack-default.xml",
+ src: "memtrack-default.xml",
+ sub_dir: "vintf",
+ installable: false,
+}
+
+apex {
+ name: "com.android.hardware.memtrack",
+ file_contexts: "apex_file_contexts",
+ manifest: "apex_manifest.json",
+ key: "com.android.hardware.key",
+ certificate: ":com.android.hardware.certificate",
+ updatable: false,
+ vendor: true,
+
+ binaries: [
+ "android.hardware.memtrack-service.apex",
+ ],
+ prebuilts: [
+ "memtrack-default-apex.rc",
+ "memtrack-default.xml",
+ ],
+}
diff --git a/memtrack/aidl/default/apex_file_contexts b/memtrack/aidl/default/apex_file_contexts
new file mode 100644
index 0000000..40c0af4
--- /dev/null
+++ b/memtrack/aidl/default/apex_file_contexts
@@ -0,0 +1,3 @@
+(/.*)? u:object_r:vendor_file:s0
+/etc(/.*)? u:object_r:vendor_configs_file:s0
+/bin/hw/android\.hardware\.memtrack-service\.example u:object_r:hal_memtrack_default_exec:s0
diff --git a/memtrack/aidl/default/apex_manifest.json b/memtrack/aidl/default/apex_manifest.json
new file mode 100644
index 0000000..16d195e
--- /dev/null
+++ b/memtrack/aidl/default/apex_manifest.json
@@ -0,0 +1,4 @@
+{
+ "name": "com.android.hardware.memtrack",
+ "version": 1
+}
\ No newline at end of file
diff --git a/memtrack/aidl/default/memtrack-default-apex.rc b/memtrack/aidl/default/memtrack-default-apex.rc
new file mode 100644
index 0000000..53e712a
--- /dev/null
+++ b/memtrack/aidl/default/memtrack-default-apex.rc
@@ -0,0 +1,4 @@
+service vendor.memtrack-default /apex/com.android.hardware.memtrack/bin/hw/android.hardware.memtrack-service.example
+ class hal
+ user nobody
+ group system
diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp
index 253ef82..6643c1e 100644
--- a/radio/aidl/vts/radio_network_test.cpp
+++ b/radio/aidl/vts/radio_network_test.cpp
@@ -23,6 +23,19 @@
#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
+namespace {
+const RadioAccessSpecifierBands EUTRAN_BAND_17 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::eutranBands>(
+ {EutranBands::BAND_17});
+const RadioAccessSpecifierBands EUTRAN_BAND_20 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::eutranBands>(
+ {EutranBands::BAND_20});
+const RadioAccessSpecifier EUTRAN_SPECIFIER_17 = {
+ .accessNetwork = AccessNetwork::EUTRAN, .bands = EUTRAN_BAND_17, .channels = {1, 2}};
+const RadioAccessSpecifier EUTRAN_SPECIFIER_20 = {
+ .accessNetwork = AccessNetwork::EUTRAN, .bands = EUTRAN_BAND_20, .channels = {128, 129}};
+} // namespace
+
void RadioNetworkTest::SetUp() {
RadioServiceTest::SetUp();
std::string serviceName = GetParam();
@@ -289,7 +302,7 @@
signalThresholdInfo.hysteresisDb = 10; // hysteresisDb too large given threshold list deltas
signalThresholdInfo.thresholds = {-109, -103, -97, -89};
signalThresholdInfo.isEnabled = true;
- signalThresholdInfo.ran = AccessNetwork::GERAN;
+ signalThresholdInfo.ran = AccessNetwork::EUTRAN;
ndk::ScopedAStatus res =
radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo});
@@ -314,7 +327,7 @@
signalThresholdInfo.hysteresisMs = 0;
signalThresholdInfo.hysteresisDb = 0;
signalThresholdInfo.isEnabled = true;
- signalThresholdInfo.ran = AccessNetwork::GERAN;
+ signalThresholdInfo.ran = AccessNetwork::EUTRAN;
ndk::ScopedAStatus res =
radio_network->setSignalStrengthReportingCriteria(serial, {signalThresholdInfo});
@@ -351,7 +364,8 @@
ALOGI("setSignalStrengthReportingCriteria_Geran, rspInfo.error = %s\n",
toString(radioRsp_network->rspInfo.error).c_str());
- ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE}));
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
}
/*
@@ -677,7 +691,7 @@
ASSERT_OK(res);
EXPECT_EQ(std::cv_status::no_timeout, wait());
if (radioRsp_network->rspInfo.error == RadioError::NONE) {
- supportedSignalThresholdInfos.push_back(signalThresholdInfoGeran);
+ supportedSignalThresholdInfos.push_back(signalThresholdInfoEutran);
} else {
// Refer to IRadioNetworkResponse#setSignalStrengthReportingCriteriaResponse
ASSERT_TRUE(CheckAnyOfErrors(
@@ -711,7 +725,7 @@
ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria(
serial, 5000,
5000, // hysteresisDlKbps too big for thresholds delta
- 100, {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000}, AccessNetwork::GERAN);
+ 100, {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000}, AccessNetwork::EUTRAN);
ASSERT_OK(res);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
@@ -719,11 +733,7 @@
ALOGI("setLinkCapacityReportingCriteria_invalidHysteresisDlKbps, rspInfo.error = %s\n",
toString(radioRsp_network->rspInfo.error).c_str());
- // Allow REQUEST_NOT_SUPPORTED as setLinkCapacityReportingCriteria() may not be supported
- // for GERAN
- ASSERT_TRUE(
- CheckAnyOfErrors(radioRsp_network->rspInfo.error,
- {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
}
/*
@@ -734,7 +744,7 @@
ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria(
serial, 5000, 500, 1000, // hysteresisUlKbps too big for thresholds delta
- {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000}, AccessNetwork::GERAN);
+ {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000}, AccessNetwork::EUTRAN);
ASSERT_OK(res);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
@@ -742,11 +752,7 @@
ALOGI("setLinkCapacityReportingCriteria_invalidHysteresisUlKbps, rspInfo.error = %s\n",
toString(radioRsp_network->rspInfo.error).c_str());
- // Allow REQUEST_NOT_SUPPORTED as setLinkCapacityReportingCriteria() may not be supported
- // for GERAN
- ASSERT_TRUE(
- CheckAnyOfErrors(radioRsp_network->rspInfo.error,
- {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
}
/*
@@ -756,7 +762,7 @@
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria(
- serial, 0, 0, 0, {}, {}, AccessNetwork::GERAN);
+ serial, 0, 0, 0, {}, {}, AccessNetwork::EUTRAN);
ASSERT_OK(res);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
@@ -764,10 +770,7 @@
ALOGI("setLinkCapacityReportingCriteria_emptyParams, rspInfo.error = %s\n",
toString(radioRsp_network->rspInfo.error).c_str());
- // Allow REQUEST_NOT_SUPPORTED as setLinkCapacityReportingCriteria() may not be supported
- // for GERAN
- ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
- {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE}));
}
/*
@@ -808,19 +811,9 @@
}
std::vector<RadioAccessSpecifier> originalSpecifiers = radioRsp_network->specifiers;
- RadioAccessSpecifierBands bandP900 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_P900});
- RadioAccessSpecifierBands band850 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_850});
- RadioAccessSpecifier specifierP900 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
- RadioAccessSpecifier specifier850 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
-
serial = GetRandomSerialNumber();
- res = radio_network->setSystemSelectionChannels(serial, true, {specifierP900, specifier850});
+ res = radio_network->setSystemSelectionChannels(serial, true,
+ {::EUTRAN_SPECIFIER_17, ::EUTRAN_SPECIFIER_20});
ASSERT_OK(res);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
@@ -833,8 +826,8 @@
if (radioRsp_network->rspInfo.error == RadioError::NONE) {
serial = GetRandomSerialNumber();
- res = radio_network->setSystemSelectionChannels(serial, false,
- {specifierP900, specifier850});
+ res = radio_network->setSystemSelectionChannels(
+ serial, false, {::EUTRAN_SPECIFIER_17, ::EUTRAN_SPECIFIER_20});
ASSERT_OK(res);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
@@ -857,20 +850,9 @@
TEST_P(RadioNetworkTest, startNetworkScan) {
serial = GetRandomSerialNumber();
- RadioAccessSpecifierBands band17 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::eutranBands>(
- {EutranBands::BAND_17});
- RadioAccessSpecifierBands band20 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::eutranBands>(
- {EutranBands::BAND_20});
- RadioAccessSpecifier specifier17 = {
- .accessNetwork = AccessNetwork::EUTRAN, .bands = band17, .channels = {1, 2}};
- RadioAccessSpecifier specifier20 = {
- .accessNetwork = AccessNetwork::EUTRAN, .bands = band20, .channels = {128, 129}};
-
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
.interval = 60,
- .specifiers = {specifier17, specifier20},
+ .specifiers = {::EUTRAN_SPECIFIER_17, ::EUTRAN_SPECIFIER_20},
.maxSearchTime = 60,
.incrementalResults = false,
.incrementalResultsPeriodicity = 1};
@@ -892,10 +874,9 @@
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::NONE, RadioError::OPERATION_NOT_ALLOWED}));
} else {
- ASSERT_TRUE(CheckAnyOfErrors(
- radioRsp_network->rspInfo.error,
- {RadioError::NONE, RadioError::OPERATION_NOT_ALLOWED, RadioError::NONE,
- RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::OPERATION_NOT_ALLOWED,
+ RadioError::INVALID_ARGUMENTS}));
}
}
@@ -925,9 +906,8 @@
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
- ASSERT_TRUE(CheckAnyOfErrors(
- radioRsp_network->rspInfo.error,
- {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
}
}
@@ -937,20 +917,9 @@
TEST_P(RadioNetworkTest, startNetworkScan_InvalidInterval1) {
serial = GetRandomSerialNumber();
- RadioAccessSpecifierBands bandP900 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_P900});
- RadioAccessSpecifierBands band850 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_850});
- RadioAccessSpecifier specifierP900 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
- RadioAccessSpecifier specifier850 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
-
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_PERIODIC,
.interval = 4,
- .specifiers = {specifierP900, specifier850},
+ .specifiers = {::EUTRAN_SPECIFIER_17, ::EUTRAN_SPECIFIER_20},
.maxSearchTime = 60,
.incrementalResults = false,
.incrementalResultsPeriodicity = 1};
@@ -966,9 +935,8 @@
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
- ASSERT_TRUE(CheckAnyOfErrors(
- radioRsp_network->rspInfo.error,
- {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
}
}
@@ -978,20 +946,9 @@
TEST_P(RadioNetworkTest, startNetworkScan_InvalidInterval2) {
serial = GetRandomSerialNumber();
- RadioAccessSpecifierBands bandP900 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_P900});
- RadioAccessSpecifierBands band850 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_850});
- RadioAccessSpecifier specifierP900 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
- RadioAccessSpecifier specifier850 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
-
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_PERIODIC,
.interval = 301,
- .specifiers = {specifierP900, specifier850},
+ .specifiers = {::EUTRAN_SPECIFIER_17, ::EUTRAN_SPECIFIER_20},
.maxSearchTime = 60,
.incrementalResults = false,
.incrementalResultsPeriodicity = 1};
@@ -1007,9 +964,8 @@
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
- ASSERT_TRUE(CheckAnyOfErrors(
- radioRsp_network->rspInfo.error,
- {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
}
}
@@ -1019,20 +975,9 @@
TEST_P(RadioNetworkTest, startNetworkScan_InvalidMaxSearchTime1) {
serial = GetRandomSerialNumber();
- RadioAccessSpecifierBands bandP900 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_P900});
- RadioAccessSpecifierBands band850 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_850});
- RadioAccessSpecifier specifierP900 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
- RadioAccessSpecifier specifier850 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
-
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
.interval = 60,
- .specifiers = {specifierP900, specifier850},
+ .specifiers = {::EUTRAN_SPECIFIER_17, ::EUTRAN_SPECIFIER_20},
.maxSearchTime = 59,
.incrementalResults = false,
.incrementalResultsPeriodicity = 1};
@@ -1048,9 +993,8 @@
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
- ASSERT_TRUE(CheckAnyOfErrors(
- radioRsp_network->rspInfo.error,
- {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
}
}
@@ -1060,20 +1004,9 @@
TEST_P(RadioNetworkTest, startNetworkScan_InvalidMaxSearchTime2) {
serial = GetRandomSerialNumber();
- RadioAccessSpecifierBands bandP900 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_P900});
- RadioAccessSpecifierBands band850 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_850});
- RadioAccessSpecifier specifierP900 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
- RadioAccessSpecifier specifier850 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
-
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
.interval = 60,
- .specifiers = {specifierP900, specifier850},
+ .specifiers = {::EUTRAN_SPECIFIER_17, ::EUTRAN_SPECIFIER_20},
.maxSearchTime = 3601,
.incrementalResults = false,
.incrementalResultsPeriodicity = 1};
@@ -1089,9 +1022,8 @@
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
- ASSERT_TRUE(CheckAnyOfErrors(
- radioRsp_network->rspInfo.error,
- {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
}
}
@@ -1101,20 +1033,9 @@
TEST_P(RadioNetworkTest, startNetworkScan_InvalidPeriodicity1) {
serial = GetRandomSerialNumber();
- RadioAccessSpecifierBands bandP900 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_P900});
- RadioAccessSpecifierBands band850 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_850});
- RadioAccessSpecifier specifierP900 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
- RadioAccessSpecifier specifier850 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
-
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
.interval = 60,
- .specifiers = {specifierP900, specifier850},
+ .specifiers = {::EUTRAN_SPECIFIER_17, ::EUTRAN_SPECIFIER_20},
.maxSearchTime = 600,
.incrementalResults = true,
.incrementalResultsPeriodicity = 0};
@@ -1130,9 +1051,8 @@
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
- ASSERT_TRUE(CheckAnyOfErrors(
- radioRsp_network->rspInfo.error,
- {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
}
}
@@ -1142,20 +1062,9 @@
TEST_P(RadioNetworkTest, startNetworkScan_InvalidPeriodicity2) {
serial = GetRandomSerialNumber();
- RadioAccessSpecifierBands bandP900 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_P900});
- RadioAccessSpecifierBands band850 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_850});
- RadioAccessSpecifier specifierP900 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
- RadioAccessSpecifier specifier850 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
-
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
.interval = 60,
- .specifiers = {specifierP900, specifier850},
+ .specifiers = {::EUTRAN_SPECIFIER_17, ::EUTRAN_SPECIFIER_20},
.maxSearchTime = 600,
.incrementalResults = true,
.incrementalResultsPeriodicity = 11};
@@ -1171,9 +1080,8 @@
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
- ASSERT_TRUE(CheckAnyOfErrors(
- radioRsp_network->rspInfo.error,
- {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
}
}
@@ -1183,20 +1091,9 @@
TEST_P(RadioNetworkTest, startNetworkScan_GoodRequest1) {
serial = GetRandomSerialNumber();
- RadioAccessSpecifierBands bandP900 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_P900});
- RadioAccessSpecifierBands band850 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_850});
- RadioAccessSpecifier specifierP900 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
- RadioAccessSpecifier specifier850 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
-
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
.interval = 60,
- .specifiers = {specifierP900, specifier850},
+ .specifiers = {::EUTRAN_SPECIFIER_17, ::EUTRAN_SPECIFIER_20},
.maxSearchTime = 360,
.incrementalResults = false,
.incrementalResultsPeriodicity = 10};
@@ -1213,8 +1110,7 @@
{RadioError::NONE, RadioError::SIM_ABSENT}));
} else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
- {RadioError::NONE, RadioError::INVALID_ARGUMENTS,
- RadioError::REQUEST_NOT_SUPPORTED}));
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS}));
}
if (radioRsp_network->rspInfo.error == RadioError::NONE) {
@@ -1229,20 +1125,9 @@
TEST_P(RadioNetworkTest, startNetworkScan_GoodRequest2) {
serial = GetRandomSerialNumber();
- RadioAccessSpecifierBands bandP900 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_P900});
- RadioAccessSpecifierBands band850 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_850});
- RadioAccessSpecifier specifierP900 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
- RadioAccessSpecifier specifier850 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
-
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
.interval = 60,
- .specifiers = {specifierP900, specifier850},
+ .specifiers = {::EUTRAN_SPECIFIER_17, ::EUTRAN_SPECIFIER_20},
.maxSearchTime = 360,
.incrementalResults = false,
.incrementalResultsPeriodicity = 10,
@@ -1260,8 +1145,7 @@
{RadioError::NONE, RadioError::SIM_ABSENT}));
} else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
- {RadioError::NONE, RadioError::INVALID_ARGUMENTS,
- RadioError::REQUEST_NOT_SUPPORTED}));
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS}));
}
if (radioRsp_network->rspInfo.error == RadioError::NONE) {
@@ -1278,21 +1162,23 @@
// can't camp on nonexistent MCCMNC, so we expect this to fail.
ndk::ScopedAStatus res =
- radio_network->setNetworkSelectionModeManual(serial, "123456", AccessNetwork::GERAN);
+ radio_network->setNetworkSelectionModeManual(serial, "123456", AccessNetwork::EUTRAN);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
- ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
- {RadioError::NONE, RadioError::ILLEGAL_SIM_OR_ME,
- RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE},
- CHECK_GENERAL_ERROR));
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::ILLEGAL_SIM_OR_ME, RadioError::INVALID_ARGUMENTS,
+ RadioError::INVALID_STATE, RadioError::RADIO_NOT_AVAILABLE, RadioError::NO_MEMORY,
+ RadioError::INTERNAL_ERR, RadioError::SYSTEM_ERR, RadioError::CANCELLED}));
} else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
- ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
- {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
- RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE},
- CHECK_GENERAL_ERROR));
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_ARGUMENTS,
+ RadioError::INVALID_STATE, RadioError::NO_MEMORY, RadioError::INTERNAL_ERR,
+ RadioError::SYSTEM_ERR, RadioError::CANCELLED}));
}
}
diff --git a/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp b/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp
index 97b4e27..9678da4 100644
--- a/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp
+++ b/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp
@@ -293,11 +293,13 @@
std::vector<uint8_t> response;
LogicalChannelResponse logical_channel_response;
+ /* Temporaly disable this check to clarify Basic Channel behavior (b/300502872)
// Note: no channel is opened for this test
// transmit() will return an empty response with the error
// code CHANNEL_NOT_AVAILABLE when the SE cannot be
// communicated with.
EXPECT_ERR(secure_element_->transmit(kDataApdu, &response));
+ */
EXPECT_OK(secure_element_->openLogicalChannel(kSelectableAid, 0x00, &logical_channel_response));
EXPECT_GE(logical_channel_response.selectResponse.size(), 2u);
diff --git a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
index 2e4fc15..aeb0163 100644
--- a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
+++ b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
@@ -379,6 +379,12 @@
* validate it against the key material. In the event of a mismatch, importKey must return
* ErrorCode::IMPORT_PARAMETER_MISMATCH.
*
+ * o Tag::EC_CURVE is not necessary in the input parameters for import of EC keys. If not
+ * provided the IKeyMintDevice must deduce the value from the provided key material and add
+ * the tag and value to the key characteristics. If Tag::EC_CURVE is provided, the
+ * IKeyMintDevice must validate it against the key material. In the event of a mismatch,
+ * importKey must return ErrorCode::IMPORT_PARAMETER_MISMATCH.
+ *
* o Tag::RSA_PUBLIC_EXPONENT (for RSA keys only) is not necessary in the input parameters. If
* not provided, the IKeyMintDevice must deduce the value from the provided key material and
* add the tag and value to the key characteristics. If Tag::RSA_PUBLIC_EXPONENT is provided,
diff --git a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
index 4c46719..cc97c13 100644
--- a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
+++ b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
@@ -88,30 +88,6 @@
return imei;
}
-
-// Use `ro.product.<property>_for_attestation` property for attestation if it is present else
-// fallback to use `ro.product.vendor.<property>` if it is present else fallback to
-// `ro.product.<property>`. Similar logic can be seen in Java method `getVendorDeviceIdProperty`
-// in frameworks/base/core/java/android/os/Build.java.
-template <Tag tag>
-void add_attestation_id(AuthorizationSetBuilder* attestation_id_tags,
- TypedTag<TagType::BYTES, tag> tag_type, const char* prop) {
- ::android::String8 prop_name =
- ::android::String8::format("ro.product.%s_for_attestation", prop);
- std::string prop_value = ::android::base::GetProperty(prop_name.c_str(), /* default= */ "");
- if (!prop_value.empty()) {
- add_tag_from_prop(attestation_id_tags, tag_type, prop_name.c_str());
- } else {
- prop_name = ::android::String8::format("ro.product.vendor.%s", prop);
- prop_value = ::android::base::GetProperty(prop_name.c_str(), /* default= */ "");
- if (!prop_value.empty()) {
- add_tag_from_prop(attestation_id_tags, tag_type, prop_name.c_str());
- } else {
- prop_name = ::android::String8::format("ro.product.%s", prop);
- add_tag_from_prop(attestation_id_tags, tag_type, prop_name.c_str());
- }
- }
-}
} // namespace
class AttestKeyTest : public KeyMintAidlTestBase {
diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
index 8934a57..9778b3d 100644
--- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
+++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
@@ -454,6 +454,29 @@
::android::PrintInstanceNameToString); \
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(name);
+// Use `ro.product.<property>_for_attestation` property for attestation if it is present else
+// fallback to use `ro.product.vendor.<property>` if it is present else fallback to
+// `ro.product.<property>`. Similar logic can be seen in Java method `getVendorDeviceIdProperty`
+// in frameworks/base/core/java/android/os/Build.java.
+template <Tag tag>
+void add_attestation_id(AuthorizationSetBuilder* attestation_id_tags,
+ TypedTag<TagType::BYTES, tag> tag_type, const char* prop) {
+ ::android::String8 prop_name =
+ ::android::String8::format("ro.product.%s_for_attestation", prop);
+ std::string prop_value = ::android::base::GetProperty(prop_name.c_str(), /* default= */ "");
+ if (!prop_value.empty()) {
+ add_tag_from_prop(attestation_id_tags, tag_type, prop_name.c_str());
+ } else {
+ prop_name = ::android::String8::format("ro.product.vendor.%s", prop);
+ prop_value = ::android::base::GetProperty(prop_name.c_str(), /* default= */ "");
+ if (!prop_value.empty()) {
+ add_tag_from_prop(attestation_id_tags, tag_type, prop_name.c_str());
+ } else {
+ prop_name = ::android::String8::format("ro.product.%s", prop);
+ add_tag_from_prop(attestation_id_tags, tag_type, prop_name.c_str());
+ }
+ }
+}
} // namespace test
} // namespace aidl::android::hardware::security::keymint
diff --git a/security/keymint/aidl/vts/functional/KeyMintTest.cpp b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
index c2e52c7..de563c4 100644
--- a/security/keymint/aidl/vts/functional/KeyMintTest.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
@@ -2082,11 +2082,6 @@
* attestation extension.
*/
TEST_P(NewKeyGenerationTest, EcdsaAttestationIdTags) {
- if (is_gsi_image()) {
- // GSI sets up a standard set of device identifiers that may not match
- // the device identifiers held by the device.
- GTEST_SKIP() << "Test not applicable under GSI";
- }
auto challenge = "hello";
auto app_id = "foo";
auto subject = "cert subj 2";
@@ -2106,38 +2101,12 @@
// Various ATTESTATION_ID_* tags that map to fields in the attestation extension ASN.1 schema.
auto extra_tags = AuthorizationSetBuilder();
- // Use ro.product.brand_for_attestation property for attestation if it is present else fallback
- // to ro.product.brand
- std::string prop_value =
- ::android::base::GetProperty("ro.product.brand_for_attestation", /* default= */ "");
- if (!prop_value.empty()) {
- add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_BRAND,
- "ro.product.brand_for_attestation");
- } else {
- add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_BRAND, "ro.product.brand");
- }
- add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_DEVICE, "ro.product.device");
- // Use ro.product.name_for_attestation property for attestation if it is present else fallback
- // to ro.product.name
- prop_value = ::android::base::GetProperty("ro.product.name_for_attestation", /* default= */ "");
- if (!prop_value.empty()) {
- add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_PRODUCT,
- "ro.product.name_for_attestation");
- } else {
- add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_PRODUCT, "ro.product.name");
- }
+ add_attestation_id(&extra_tags, TAG_ATTESTATION_ID_BRAND, "brand");
+ add_attestation_id(&extra_tags, TAG_ATTESTATION_ID_DEVICE, "device");
+ add_attestation_id(&extra_tags, TAG_ATTESTATION_ID_PRODUCT, "name");
+ add_attestation_id(&extra_tags, TAG_ATTESTATION_ID_MANUFACTURER, "manufacturer");
+ add_attestation_id(&extra_tags, TAG_ATTESTATION_ID_MODEL, "model");
add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_SERIAL, "ro.serialno");
- add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_MANUFACTURER, "ro.product.manufacturer");
- // Use ro.product.model_for_attestation property for attestation if it is present else fallback
- // to ro.product.model
- prop_value =
- ::android::base::GetProperty("ro.product.model_for_attestation", /* default= */ "");
- if (!prop_value.empty()) {
- add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_MODEL,
- "ro.product.model_for_attestation");
- } else {
- add_tag_from_prop(&extra_tags, TAG_ATTESTATION_ID_MODEL, "ro.product.model");
- }
for (const KeyParameter& tag : extra_tags) {
SCOPED_TRACE(testing::Message() << "tag-" << tag);
@@ -4148,6 +4117,42 @@
}
/*
+ * ImportKeyTest.EcdsaSuccessCurveNotSpecified
+ *
+ * Verifies that importing and using an ECDSA P-256 key pair works correctly
+ * when the EC_CURVE is not explicitly specified.
+ */
+TEST_P(ImportKeyTest, EcdsaSuccessCurveNotSpecified) {
+ if (AidlVersion() < 4) {
+ /*
+ * The KeyMint spec before V4 was not clear as to whether EC_CURVE was optional on import of
+ * EC keys. However, this was not checked at the time so we can only be strict about
+ * checking this for implementations of KeyMint version 4 and above.
+ */
+ GTEST_SKIP() << "Skipping EC_CURVE on import only strict since KeyMint v4";
+ }
+
+ ASSERT_EQ(ErrorCode::OK, ImportKey(AuthorizationSetBuilder()
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .Authorization(TAG_ALGORITHM, Algorithm::EC)
+ .SigningKey()
+ .Digest(Digest::SHA_2_256)
+ .SetDefaultValidity(),
+ KeyFormat::PKCS8, ec_256_key));
+
+ CheckCryptoParam(TAG_ALGORITHM, Algorithm::EC);
+ CheckCryptoParam(TAG_DIGEST, Digest::SHA_2_256);
+ CheckCryptoParam(TAG_EC_CURVE, EcCurve::P_256);
+
+ CheckOrigin();
+
+ string message(32, 'a');
+ auto params = AuthorizationSetBuilder().Digest(Digest::SHA_2_256);
+ string signature = SignMessage(message, params);
+ LocalVerifyMessage(message, signature, params);
+}
+
+/*
* ImportKeyTest.EcdsaP256RFC5915Success
*
* Verifies that importing and using an ECDSA P-256 key pair encoded using RFC5915 works
@@ -4792,7 +4797,7 @@
EXPECT_EQ(ErrorCode::OK, Begin(KeyPurpose::DECRYPT, params));
string result;
- EXPECT_EQ(ErrorCode::UNKNOWN_ERROR, Finish(ciphertext1, &result));
+ EXPECT_NE(ErrorCode::OK, Finish(ciphertext1, &result));
EXPECT_EQ(0U, result.size());
}
}
@@ -5300,7 +5305,7 @@
EXPECT_EQ(ErrorCode::OK, Begin(KeyPurpose::DECRYPT, params));
string result;
- EXPECT_EQ(ErrorCode::UNKNOWN_ERROR, Finish(ciphertext1, &result));
+ EXPECT_NE(ErrorCode::OK, Finish(ciphertext1, &result));
EXPECT_EQ(0U, result.size());
}
}
@@ -5367,7 +5372,7 @@
.Digest(Digest::SHA_2_256)
.Padding(PaddingMode::RSA_OAEP)));
string result;
- EXPECT_EQ(ErrorCode::UNKNOWN_ERROR, Finish(ciphertext, &result));
+ EXPECT_NE(ErrorCode::OK, Finish(ciphertext, &result));
EXPECT_EQ(0U, result.size());
}
@@ -5437,7 +5442,7 @@
EXPECT_EQ(ErrorCode::OK, Begin(KeyPurpose::DECRYPT, params));
string result;
- EXPECT_EQ(ErrorCode::UNKNOWN_ERROR, Finish(ciphertext1, &result));
+ EXPECT_NE(ErrorCode::OK, Finish(ciphertext1, &result));
EXPECT_EQ(0U, result.size());
}
}
@@ -5481,7 +5486,7 @@
EXPECT_EQ(ErrorCode::OK, Begin(KeyPurpose::DECRYPT, params));
string result;
- EXPECT_EQ(ErrorCode::UNKNOWN_ERROR, Finish(ciphertext, &result));
+ EXPECT_NE(ErrorCode::OK, Finish(ciphertext, &result));
EXPECT_EQ(0U, result.size());
}
@@ -5613,7 +5618,7 @@
EXPECT_EQ(ErrorCode::OK, Begin(KeyPurpose::DECRYPT, params));
string result;
- EXPECT_EQ(ErrorCode::UNKNOWN_ERROR, Finish(ciphertext1, &result));
+ EXPECT_NE(ErrorCode::OK, Finish(ciphertext1, &result));
EXPECT_EQ(0U, result.size());
}
diff --git a/security/keymint/support/remote_prov_utils.cpp b/security/keymint/support/remote_prov_utils.cpp
index 780c3d2..34f7ce4 100644
--- a/security/keymint/support/remote_prov_utils.cpp
+++ b/security/keymint/support/remote_prov_utils.cpp
@@ -962,6 +962,20 @@
return signedRequest->value();
}
+ErrMsgOr<hwtrust::DiceChain::Kind> getDiceChainKind() {
+ int vendor_api_level = ::android::base::GetIntProperty("ro.vendor.api_level", -1);
+ switch (vendor_api_level) {
+ case __ANDROID_API_T__:
+ return hwtrust::DiceChain::Kind::kVsr13;
+ case __ANDROID_API_U__:
+ return hwtrust::DiceChain::Kind::kVsr14;
+ case __ANDROID_API_V__:
+ return hwtrust::DiceChain::Kind::kVsr15;
+ default:
+ return "Unsupported vendor API level: " + std::to_string(vendor_api_level);
+ }
+}
+
ErrMsgOr<bytevec> parseAndValidateAuthenticatedRequest(const std::vector<uint8_t>& request,
const std::vector<uint8_t>& challenge) {
auto [parsedRequest, _, csrErrMsg] = cppbor::parse(request);
@@ -996,7 +1010,12 @@
}
// DICE chain is [ pubkey, + DiceChainEntry ].
- auto diceContents = validateBcc(diceCertChain, hwtrust::DiceChain::Kind::kVsr14);
+ auto diceChainKind = getDiceChainKind();
+ if (!diceChainKind) {
+ return diceChainKind.message();
+ }
+
+ auto diceContents = validateBcc(diceCertChain, *diceChainKind);
if (!diceContents) {
return diceContents.message() + "\n" + prettyPrint(diceCertChain);
}
diff --git a/security/rkp/aidl/android/hardware/security/keymint/generateCertificateRequestV2.cddl b/security/rkp/aidl/android/hardware/security/keymint/generateCertificateRequestV2.cddl
index 80f7cbd..15b0442 100644
--- a/security/rkp/aidl/android/hardware/security/keymint/generateCertificateRequestV2.cddl
+++ b/security/rkp/aidl/android/hardware/security/keymint/generateCertificateRequestV2.cddl
@@ -90,9 +90,10 @@
DiceChainEntryPayload = { ; CWT [RFC8392]
1 : tstr, ; Issuer
2 : tstr, ; Subject
+ -4670554 : "android.15", ; Profile Name
-4670552 : bstr .cbor PubKeyEd25519 /
bstr .cbor PubKeyECDSA256 /
- bstr .cbor PubKeyECDSA384, ; Subject Public Key
+ bstr .cbor PubKeyECDSA384, ; Subject Public Key
-4670553 : bstr ; Key Usage
; NOTE: All of the following fields may be omitted for a "Degenerate DICE Chain", as