Merge "Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918" into stage-aosp-master

This commit is contained in:
Xin Li 2021-11-18 21:29:03 +00:00 committed by Android (Google) Code Review
commit 76364127bf
13 changed files with 104 additions and 37 deletions

View file

@ -1025,7 +1025,7 @@ const ConfigDeclaration kVehicleProperties[]{
.config = .config =
{ {
.prop = toInt(VehicleProperty::EPOCH_TIME), .prop = toInt(VehicleProperty::EPOCH_TIME),
.access = VehiclePropertyAccess::READ_WRITE, .access = VehiclePropertyAccess::WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
}, },
}, },

View file

@ -487,8 +487,11 @@ enum VehicleProperty : int32_t {
* int64Values[3] = rear right ticks * int64Values[3] = rear right ticks
* int64Values[4] = rear left ticks * int64Values[4] = rear left ticks
* *
* configArray is used to indicate the micrometers-per-wheel-tick value and * configArray is used to indicate the micrometers-per-wheel-tick values and
* which wheels are supported. configArray is set as follows: * which wheels are supported. Each micrometers-per-wheel-tick value is static (i.e. will not
* update based on wheel's status) and a best approximation. For example, if a vehicle has
* multiple rim/tire size options, the micrometers-per-wheel-tick values are set to those for
* the typically expected rim/tire size. configArray is set as follows:
* *
* configArray[0], bits [0:3] = supported wheels. Uses enum Wheel. * configArray[0], bits [0:3] = supported wheels. Uses enum Wheel.
* configArray[1] = micrometers per front left wheel tick * configArray[1] = micrometers per front left wheel tick
@ -1433,17 +1436,29 @@ enum VehicleProperty : int32_t {
* This value denotes the number of milliseconds seconds that have * This value denotes the number of milliseconds seconds that have
* elapsed since 1/1/1970 UTC. * elapsed since 1/1/1970 UTC.
* *
* Reading this value will give you the systems time. This can be * AAOS will write to this value to give VHAL the Android system's time,
* useful to synchronize other vehicle systems (dash clock etc). * if the VHAL supports this property. This can be useful to synchronize
* other vehicle systems (dash clock etc) with Android's time.
* *
* Writing this value will update the ExternalTimeSuggestion * AAOS writes to this property once during boot, and
* value (if enabled). This value may be consumed by the “Time * will thereafter write only when some time-source changes are propagated.
* Detector Service”, if other sources do not have a higher * AAOS will fill in VehiclePropValue.timestamp correctly.
* priority. For information on how to adjust time source * Note that AAOS will not send updates for natural elapse of time.
* priorities see Time Detector Service documentation. * int64Values[0] = provided Unix time (in milliseconds)
*
* Note that the property may take >0 ms to get propagated through the stack
* and, having a timestamped property helps reduce any time drift. So,
* for all writes to the property, the timestamp can be used to negate this
* drift:
* drift = currentTimeMillis - PropValue.timestamp
* effectiveTime = PropValue.value.int64Values[0] + diff
*
* Aside, this property could have been better named ANDROID_EPOCH_TIME, but it
* continues to be called EPOCH_TIME for legacy reasons. We will try to fix
* this naming discrepancy when we migrate to AIDL.
* *
* @change_mode VehiclePropertyChangeMode:ON_CHANGE * @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE * @access VehiclePropertyAccess:WRITE_ONLY
* @unit VehicleUnit:MILLI_SECS * @unit VehicleUnit:MILLI_SECS
*/ */
EPOCH_TIME = ( EPOCH_TIME = (

View file

@ -3837,6 +3837,8 @@ TEST_P(CameraHidlTest, configureStreamsZSLInputOutputs) {
getAvailableOutputStreams(staticMeta, outputStreams, getAvailableOutputStreams(staticMeta, outputStreams,
&outputThreshold)); &outputThreshold));
for (auto& outputIter : outputStreams) { for (auto& outputIter : outputStreams) {
V3_2::DataspaceFlags outputDataSpace =
getDataspace(static_cast<PixelFormat>(outputIter.format));
V3_2::Stream zslStream = {streamId++, V3_2::Stream zslStream = {streamId++,
StreamType::OUTPUT, StreamType::OUTPUT,
static_cast<uint32_t>(input.width), static_cast<uint32_t>(input.width),
@ -3859,7 +3861,7 @@ TEST_P(CameraHidlTest, configureStreamsZSLInputOutputs) {
static_cast<uint32_t>(outputIter.height), static_cast<uint32_t>(outputIter.height),
static_cast<PixelFormat>(outputIter.format), static_cast<PixelFormat>(outputIter.format),
GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, GRALLOC1_CONSUMER_USAGE_HWCOMPOSER,
0, outputDataSpace,
StreamRotation::ROTATION_0}; StreamRotation::ROTATION_0};
::android::hardware::hidl_vec<V3_2::Stream> streams = {inputStream, zslStream, ::android::hardware::hidl_vec<V3_2::Stream> streams = {inputStream, zslStream,

View file

@ -898,6 +898,8 @@ ea465970e96d9605ee6f6706b3b512726c66d2644738added9128c739f8f8b0c android.hardwar
c8a57364f6ad20842be14f4db284df5304f7521ca8eac6bcc1fa6c5b466fb8a6 android.hardware.wifi.supplicant@1.4::ISupplicantStaNetwork c8a57364f6ad20842be14f4db284df5304f7521ca8eac6bcc1fa6c5b466fb8a6 android.hardware.wifi.supplicant@1.4::ISupplicantStaNetwork
2123482b69f3b531c88023aa2a007110e130efbf4ed68ac9ce0bc55d5e82bc8b android.hardware.wifi.supplicant@1.4::ISupplicantStaNetworkCallback 2123482b69f3b531c88023aa2a007110e130efbf4ed68ac9ce0bc55d5e82bc8b android.hardware.wifi.supplicant@1.4::ISupplicantStaNetworkCallback
0821f516e4d428bc15251969f7e19411c94d8f2ccbd99e1fc8168d8e49e38b0f android.hardware.wifi.supplicant@1.4::types 0821f516e4d428bc15251969f7e19411c94d8f2ccbd99e1fc8168d8e49e38b0f android.hardware.wifi.supplicant@1.4::types
4a087a308608d146b022ebc15633de989f5f4dfe1491a83fa41763290a82e40d android.hardware.automotive.vehicle@2.0::types
70eb14415391f835fb218b43a1e25f5d6495f098f96fa2acaea70985e98e1ce8 android.hardware.automotive.vehicle@2.0::types
# ABI preserving changes to HALs during Android T # ABI preserving changes to HALs during Android T
62ace52d9c3ff1f60f94118557a2aaf0b953513e59dcd34d5f94ae28d4c7e780 android.hardware.fastboot@1.0::IFastboot 62ace52d9c3ff1f60f94118557a2aaf0b953513e59dcd34d5f94ae28d4c7e780 android.hardware.fastboot@1.0::IFastboot

View file

@ -53,17 +53,16 @@ TEST_P(GnssHalTest, SetupTeardownCreateCleanup) {}
/* /*
* TestPsdsExtension: * TestPsdsExtension:
* 1. Gets the PsdsExtension and verifies that it returns a non-null extension. * 1. Gets the PsdsExtension
* 2. Injects empty PSDS data and verifies that it returns an error. * 2. Injects empty PSDS data and verifies that it returns an error.
*/ */
TEST_P(GnssHalTest, TestPsdsExtension) { TEST_P(GnssHalTest, TestPsdsExtension) {
sp<IGnssPsds> iGnssPsds; sp<IGnssPsds> iGnssPsds;
auto status = aidl_gnss_hal_->getExtensionPsds(&iGnssPsds); auto status = aidl_gnss_hal_->getExtensionPsds(&iGnssPsds);
ASSERT_TRUE(status.isOk()); if (status.isOk() && iGnssPsds != nullptr) {
ASSERT_TRUE(iGnssPsds != nullptr); status = iGnssPsds->injectPsdsData(PsdsType::LONG_TERM, std::vector<uint8_t>());
ASSERT_FALSE(status.isOk());
status = iGnssPsds->injectPsdsData(PsdsType::LONG_TERM, std::vector<uint8_t>()); }
ASSERT_FALSE(status.isOk());
} }
void CheckSatellitePvt(const SatellitePvt& satellitePvt) { void CheckSatellitePvt(const SatellitePvt& satellitePvt) {

View file

@ -940,7 +940,11 @@ TEST_P(NewKeyGenerationTest, HmacDigestNone) {
* UNSUPPORTED_KEY_SIZE. * UNSUPPORTED_KEY_SIZE.
*/ */
TEST_P(NewKeyGenerationTest, AesInvalidKeySize) { TEST_P(NewKeyGenerationTest, AesInvalidKeySize) {
int32_t firstApiLevel = property_get_int32("ro.board.first_api_level", 0);
for (auto key_size : InvalidKeySizes(Algorithm::AES)) { for (auto key_size : InvalidKeySizes(Algorithm::AES)) {
if (key_size == 192 && SecLevel() == SecurityLevel::STRONGBOX && firstApiLevel < 31) {
continue;
}
ASSERT_EQ(ErrorCode::UNSUPPORTED_KEY_SIZE, ASSERT_EQ(ErrorCode::UNSUPPORTED_KEY_SIZE,
GenerateKey(AuthorizationSetBuilder() GenerateKey(AuthorizationSetBuilder()
.Authorization(TAG_NO_AUTH_REQUIRED) .Authorization(TAG_NO_AUTH_REQUIRED)

View file

@ -264,11 +264,13 @@ TEST_P(StoreHidlTest, ListRoles) {
// Make sure role name follows expected format based on type and // Make sure role name follows expected format based on type and
// isEncoder // isEncoder
const std::string role_name( const char* role_name = ::android::GetComponentRole(role.isEncoder, role.type.c_str());
::android::GetComponentRole(role.isEncoder, role.type.c_str())); if (role_name != nullptr) {
EXPECT_EQ(role_name, role.role) << "Role \"" << role.role << "\" does not match " EXPECT_EQ(std::string(role_name), role.role)
<< (role.isEncoder ? "an encoder " : "a decoder ") << "Role \"" << role.role << "\" does not match "
<< "for mime type \"" << role.type << "."; << (role.isEncoder ? "an encoder " : "a decoder ") << "for media type \""
<< role.type << ".";
}
// Check the nodes for this role // Check the nodes for this role
std::set<const std::string> nodeKeys; std::set<const std::string> nodeKeys;

View file

@ -204,6 +204,7 @@ bool DvrCallback::readRecordFMQ() {
void DvrCallback::stopRecordThread() { void DvrCallback::stopRecordThread() {
mKeepReadingRecordFMQ = false; mKeepReadingRecordFMQ = false;
mRecordThreadRunning = false; mRecordThreadRunning = false;
android::Mutex::Autolock autoLock(mRecordThreadLock);
} }
AssertionResult DvrTests::openDvrInDemux(DvrType type, uint32_t bufferSize) { AssertionResult DvrTests::openDvrInDemux(DvrType type, uint32_t bufferSize) {

View file

@ -131,8 +131,14 @@ WifiStatus Wifi::startInternal() {
WifiStatus wifi_status = WifiStatus wifi_status =
createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, error); createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, error);
for (const auto& callback : event_cb_handler_.getCallbacks()) { for (const auto& callback : event_cb_handler_.getCallbacks()) {
LOG(INFO) << "Attempting to invoke onSubsystemRestart "
"callback";
if (!callback->onSubsystemRestart(wifi_status).isOk()) { if (!callback->onSubsystemRestart(wifi_status).isOk()) {
LOG(ERROR) << "Failed to invoke onFailure callback"; LOG(ERROR)
<< "Failed to invoke onSubsystemRestart callback";
} else {
LOG(INFO) << "Succeeded to invoke onSubsystemRestart "
"callback";
} }
} }
}; };

View file

@ -38,12 +38,15 @@ class SupplicantHidlTest
: public ::testing::TestWithParam<std::tuple<std::string, std::string>> { : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
public: public:
virtual void SetUp() override { virtual void SetUp() override {
// Stop Wi-Fi
ASSERT_TRUE(stopWifiFramework()); // stop & wait for wifi to shutdown.
wifi_instance_name_ = std::get<0>(GetParam()); wifi_instance_name_ = std::get<0>(GetParam());
supplicant_instance_name_ = std::get<1>(GetParam()); supplicant_instance_name_ = std::get<1>(GetParam());
std::system("/system/bin/start");
ASSERT_TRUE(waitForFrameworkReady());
isP2pOn_ = isP2pOn_ =
testing::deviceSupportsFeature("android.hardware.wifi.direct"); testing::deviceSupportsFeature("android.hardware.wifi.direct");
// Stop Framework
std::system("/system/bin/stop");
stopSupplicant(wifi_instance_name_); stopSupplicant(wifi_instance_name_);
startSupplicantAndWaitForHidlService(wifi_instance_name_, startSupplicantAndWaitForHidlService(wifi_instance_name_,
supplicant_instance_name_); supplicant_instance_name_);
@ -53,8 +56,8 @@ class SupplicantHidlTest
virtual void TearDown() override { virtual void TearDown() override {
stopSupplicant(wifi_instance_name_); stopSupplicant(wifi_instance_name_);
// Start Framework // Start Wi-Fi
std::system("/system/bin/start"); startWifiFramework();
} }
protected: protected:
@ -220,4 +223,4 @@ INSTANTIATE_TEST_CASE_P(
android::hardware::getAllHalInstanceNames(IWifi::descriptor)), android::hardware::getAllHalInstanceNames(IWifi::descriptor)),
testing::ValuesIn(android::hardware::getAllHalInstanceNames( testing::ValuesIn(android::hardware::getAllHalInstanceNames(
ISupplicant::descriptor))), ISupplicant::descriptor))),
android::hardware::PrintInstanceTupleNameToString<>); android::hardware::PrintInstanceTupleNameToString<>);

View file

@ -48,6 +48,26 @@ using ::android::wifi_system::InterfaceTool;
using ::android::wifi_system::SupplicantManager; using ::android::wifi_system::SupplicantManager;
namespace { namespace {
bool waitForSupplicantState(bool is_running) {
SupplicantManager supplicant_manager;
int count = 50; /* wait at most 5 seconds for completion */
while (count-- > 0) {
if (supplicant_manager.IsSupplicantRunning() == is_running) {
return true;
}
usleep(100000);
}
LOG(ERROR) << "Supplicant not " << is_running ? "running" : "stopped";
return false;
}
// Helper function to wait for supplicant to be started by framework on wifi
// enable.
bool waitForSupplicantStart() { return waitForSupplicantState(true); }
// Helper function to wait for supplicant to be stopped by framework on wifi
// disable.
bool waitForSupplicantStop() { return waitForSupplicantState(false); }
// Helper function to initialize the driver and firmware to STA mode // Helper function to initialize the driver and firmware to STA mode
// using the vendor HAL HIDL interface. // using the vendor HAL HIDL interface.
@ -118,6 +138,18 @@ std::string getP2pIfaceName() {
} }
} // namespace } // namespace
bool startWifiFramework() {
std::system("svc wifi enable");
std::system("cmd wifi set-scan-always-available enabled");
return waitForSupplicantStart(); // wait for wifi to start.
}
bool stopWifiFramework() {
std::system("svc wifi disable");
std::system("cmd wifi set-scan-always-available disabled");
return waitForSupplicantStop(); // wait for wifi to shutdown.
}
void stopSupplicant() { stopSupplicant(""); } void stopSupplicant() { stopSupplicant(""); }
void stopSupplicant(const std::string& wifi_instance_name) { void stopSupplicant(const std::string& wifi_instance_name) {

View file

@ -29,9 +29,11 @@
#include "wifi_hidl_test_utils.h" #include "wifi_hidl_test_utils.h"
// Used to start the android wifi framework after every test.
bool startWifiFramework();
// Used to stop the android wifi framework before every test. // Used to stop the android wifi framework before every test.
void stopWifiFramework(const std::string& wifi_instance_name); bool stopWifiFramework();
void startWifiFramework(const std::string& wifi_instance_name);
void stopSupplicant(const std::string& wifi_instance_name); void stopSupplicant(const std::string& wifi_instance_name);
// Used to configure the chip, driver and start wpa_supplicant before every // Used to configure the chip, driver and start wpa_supplicant before every
@ -70,16 +72,16 @@ class SupplicantHidlTestBase
: public ::testing::TestWithParam<std::tuple<std::string, std::string>> { : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
public: public:
virtual void SetUp() override { virtual void SetUp() override {
// Stop Wi-Fi
ASSERT_TRUE(stopWifiFramework()); // stop & wait for wifi to shutdown.
// should always be v1.0 wifi // should always be v1.0 wifi
wifi_v1_0_instance_name_ = std::get<0>(GetParam()); wifi_v1_0_instance_name_ = std::get<0>(GetParam());
supplicant_instance_name_ = std::get<1>(GetParam()); supplicant_instance_name_ = std::get<1>(GetParam());
std::system("/system/bin/start"); std::system("/system/bin/start");
ASSERT_TRUE(waitForFrameworkReady()); ASSERT_TRUE(waitForFrameworkReady());
isP2pOn_ = isP2pOn_ =
testing::deviceSupportsFeature("android.hardware.wifi.direct"); testing::deviceSupportsFeature("android.hardware.wifi.direct");
// Stop Framework
std::system("/system/bin/stop");
stopSupplicant(wifi_v1_0_instance_name_); stopSupplicant(wifi_v1_0_instance_name_);
startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_, startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
supplicant_instance_name_); supplicant_instance_name_);
@ -88,8 +90,8 @@ class SupplicantHidlTestBase
virtual void TearDown() override { virtual void TearDown() override {
stopSupplicant(wifi_v1_0_instance_name_); stopSupplicant(wifi_v1_0_instance_name_);
// Start Framework // Start Wi-Fi
std::system("/system/bin/start"); startWifiFramework();
} }
protected: protected:

View file

@ -74,5 +74,4 @@ cc_test {
"general-tests", "general-tests",
"vts", "vts",
], ],
disable_framework: true,
} }