Merge "VTS test for previewStabilization"
diff --git a/authsecret/aidl/default/service.cpp b/authsecret/aidl/default/service.cpp
index efecf10..a7d8678 100644
--- a/authsecret/aidl/default/service.cpp
+++ b/authsecret/aidl/default/service.cpp
@@ -28,7 +28,7 @@
const std::string instance = std::string() + AuthSecret::descriptor + "/default";
binder_status_t status = AServiceManager_addService(authsecret->asBinder().get(), instance.c_str());
- CHECK(status == STATUS_OK);
+ CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return -1; // Should never be reached
diff --git a/automotive/audiocontrol/aidl/default/main.cpp b/automotive/audiocontrol/aidl/default/main.cpp
index 9b259fc..cc15ccb 100644
--- a/automotive/audiocontrol/aidl/default/main.cpp
+++ b/automotive/audiocontrol/aidl/default/main.cpp
@@ -31,7 +31,7 @@
const std::string instance = std::string() + AudioControl::descriptor + "/default";
binder_status_t status =
AServiceManager_addService(audioControl->asBinder().get(), instance.c_str());
- CHECK(status == STATUS_OK);
+ CHECK_EQ(status, STATUS_OK);
std::shared_ptr<PowerPolicyClient> powerPolicyClient =
::ndk::SharedRefBase::make<PowerPolicyClient>(audioControl);
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h
index 46a526c..cab184b 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h
@@ -39,14 +39,6 @@
class FakeVehicleHardware final : public IVehicleHardware {
public:
- using SetValuesCallback = std::function<void(
- const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueResult>&)>;
- using GetValuesCallback = std::function<void(
- const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueResult>&)>;
- using OnPropertyChangeCallback = std::function<void(
- const std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>&)>;
- using OnPropertySetErrorCallback = std::function<void(const std::vector<SetValueErrorEvent>&)>;
-
FakeVehicleHardware();
explicit FakeVehicleHardware(std::unique_ptr<VehiclePropValuePool> valuePool);
@@ -59,7 +51,7 @@
// are sent to vehicle bus or before property set confirmation is received. The callback is
// safe to be called after the function returns and is safe to be called in a different thread.
::aidl::android::hardware::automotive::vehicle::StatusCode setValues(
- SetValuesCallback&& callback,
+ std::shared_ptr<const SetValuesCallback> callback,
const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>&
requests) override;
@@ -67,7 +59,7 @@
// The callback is safe to be called after the function returns and is safe to be called in a
// different thread.
::aidl::android::hardware::automotive::vehicle::StatusCode getValues(
- GetValuesCallback&& callback,
+ std::shared_ptr<const GetValuesCallback> callback,
const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>&
requests) const override;
@@ -78,11 +70,13 @@
::aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() override;
// Register a callback that would be called when there is a property change event from vehicle.
- void registerOnPropertyChangeEvent(OnPropertyChangeCallback&& callback) override;
+ void registerOnPropertyChangeEvent(
+ std::unique_ptr<const PropertyChangeCallback> callback) override;
// Register a callback that would be called when there is a property set error event from
// vehicle.
- void registerOnPropertySetErrorEvent(OnPropertySetErrorCallback&& callback) override;
+ void registerOnPropertySetErrorEvent(
+ std::unique_ptr<const PropertySetErrorCallback> callback) override;
private:
// Expose private methods to unit test.
@@ -94,8 +88,10 @@
const std::unique_ptr<obd2frame::FakeObd2Frame> mFakeObd2Frame;
const std::unique_ptr<FakeUserHal> mFakeUserHal;
std::mutex mCallbackLock;
- OnPropertyChangeCallback mOnPropertyChangeCallback GUARDED_BY(mCallbackLock);
- OnPropertySetErrorCallback mOnPropertySetErrorCallback GUARDED_BY(mCallbackLock);
+ std::unique_ptr<const PropertyChangeCallback> mOnPropertyChangeCallback
+ GUARDED_BY(mCallbackLock);
+ std::unique_ptr<const PropertySetErrorCallback> mOnPropertySetErrorCallback
+ GUARDED_BY(mCallbackLock);
void init();
// Stores the initial value to property store.
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
index 5b2003e..e75f0e7 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
@@ -379,7 +379,7 @@
return {};
}
-StatusCode FakeVehicleHardware::setValues(FakeVehicleHardware::SetValuesCallback&& callback,
+StatusCode FakeVehicleHardware::setValues(std::shared_ptr<const SetValuesCallback> callback,
const std::vector<SetValueRequest>& requests) {
std::vector<VehiclePropValue> updatedValues;
std::vector<SetValueResult> results;
@@ -424,12 +424,12 @@
// In the real vhal, the values will be sent to Car ECU. We just pretend it is done here and
// send back the updated property values to client.
- callback(std::move(results));
+ (*callback)(std::move(results));
return StatusCode::OK;
}
-StatusCode FakeVehicleHardware::getValues(FakeVehicleHardware::GetValuesCallback&& callback,
+StatusCode FakeVehicleHardware::getValues(std::shared_ptr<const GetValuesCallback> callback,
const std::vector<GetValueRequest>& requests) const {
std::vector<GetValueResult> results;
for (auto& request : requests) {
@@ -471,7 +471,7 @@
results.push_back(std::move(getValueResult));
}
- callback(std::move(results));
+ (*callback)(std::move(results));
return StatusCode::OK;
}
@@ -487,23 +487,28 @@
return StatusCode::OK;
}
-void FakeVehicleHardware::registerOnPropertyChangeEvent(OnPropertyChangeCallback&& callback) {
+void FakeVehicleHardware::registerOnPropertyChangeEvent(
+ std::unique_ptr<const PropertyChangeCallback> callback) {
std::scoped_lock<std::mutex> lockGuard(mCallbackLock);
mOnPropertyChangeCallback = std::move(callback);
}
-void FakeVehicleHardware::registerOnPropertySetErrorEvent(OnPropertySetErrorCallback&& callback) {
+void FakeVehicleHardware::registerOnPropertySetErrorEvent(
+ std::unique_ptr<const PropertySetErrorCallback> callback) {
std::scoped_lock<std::mutex> lockGuard(mCallbackLock);
mOnPropertySetErrorCallback = std::move(callback);
}
void FakeVehicleHardware::onValueChangeCallback(const VehiclePropValue& value) {
std::scoped_lock<std::mutex> lockGuard(mCallbackLock);
- if (mOnPropertyChangeCallback != nullptr) {
- std::vector<VehiclePropValue> updatedValues;
- updatedValues.push_back(value);
- mOnPropertyChangeCallback(std::move(updatedValues));
+
+ if (mOnPropertyChangeCallback == nullptr) {
+ return;
}
+
+ std::vector<VehiclePropValue> updatedValues;
+ updatedValues.push_back(value);
+ (*mOnPropertyChangeCallback)(std::move(updatedValues));
}
void FakeVehicleHardware::maybeOverrideProperties(const char* overrideDir) {
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
index 88834f3..f8df6e6 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
@@ -76,24 +76,25 @@
class FakeVehicleHardwareTest : public ::testing::Test {
protected:
void SetUp() override {
- getHardware()->registerOnPropertyChangeEvent(
+ auto callback = std::make_unique<IVehicleHardware::PropertyChangeCallback>(
[this](const std::vector<VehiclePropValue>& values) {
- return onPropertyChangeEvent(values);
+ onPropertyChangeEvent(values);
});
+ getHardware()->registerOnPropertyChangeEvent(std::move(callback));
+ mSetValuesCallback = std::make_shared<IVehicleHardware::SetValuesCallback>(
+ [this](std::vector<SetValueResult> results) { onSetValues(results); });
+ mGetValuesCallback = std::make_shared<IVehicleHardware::GetValuesCallback>(
+ [this](std::vector<GetValueResult> results) { onGetValues(results); });
}
FakeVehicleHardware* getHardware() { return &mHardware; }
StatusCode setValues(const std::vector<SetValueRequest>& requests) {
- return getHardware()->setValues(
- [this](const std::vector<SetValueResult> results) { return onSetValues(results); },
- requests);
+ return getHardware()->setValues(mSetValuesCallback, requests);
}
StatusCode getValues(const std::vector<GetValueRequest>& requests) {
- return getHardware()->getValues(
- [this](const std::vector<GetValueResult> results) { return onGetValues(results); },
- requests);
+ return getHardware()->getValues(mGetValuesCallback, requests);
}
StatusCode setValue(const VehiclePropValue& value) {
@@ -245,6 +246,8 @@
std::vector<SetValueResult> mSetValueResults;
std::vector<GetValueResult> mGetValueResults;
std::vector<VehiclePropValue> mChangedProperties;
+ std::shared_ptr<IVehicleHardware::SetValuesCallback> mSetValuesCallback;
+ std::shared_ptr<IVehicleHardware::GetValuesCallback> mGetValuesCallback;
};
TEST_F(FakeVehicleHardwareTest, testGetAllPropertyConfigs) {
@@ -367,9 +370,9 @@
TEST_F(FakeVehicleHardwareTest, testRegisterOnPropertyChangeEvent) {
// We have already registered this callback in Setup, here we are registering again.
- getHardware()->registerOnPropertyChangeEvent(std::bind(
- &FakeVehicleHardwareTest_testRegisterOnPropertyChangeEvent_Test::onPropertyChangeEvent,
- this, std::placeholders::_1));
+ auto callback = std::make_unique<IVehicleHardware::PropertyChangeCallback>(
+ [this](const std::vector<VehiclePropValue>& values) { onPropertyChangeEvent(values); });
+ getHardware()->registerOnPropertyChangeEvent(std::move(callback));
auto testValues = getTestPropValues();
std::vector<SetValueRequest> requests;
diff --git a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h
index 2e12327..4b9de2d 100644
--- a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h
+++ b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h
@@ -19,6 +19,7 @@
#include <VehicleHalTypes.h>
+#include <memory>
#include <vector>
namespace android {
@@ -49,6 +50,14 @@
// with a VehicleHardware through this interface.
class IVehicleHardware {
public:
+ using SetValuesCallback = std::function<void(
+ std::vector<::aidl::android::hardware::automotive::vehicle::SetValueResult>)>;
+ using GetValuesCallback = std::function<void(
+ std::vector<::aidl::android::hardware::automotive::vehicle::GetValueResult>)>;
+ using PropertyChangeCallback = std::function<void(
+ std::vector<::aidl::android::hardware::automotive::vehicle::VehiclePropValue>)>;
+ using PropertySetErrorCallback = std::function<void(std::vector<SetValueErrorEvent>)>;
+
virtual ~IVehicleHardware() = default;
// Get all the property configs.
@@ -59,9 +68,7 @@
// are sent to vehicle bus or before property set confirmation is received. The callback is
// safe to be called after the function returns and is safe to be called in a different thread.
virtual ::aidl::android::hardware::automotive::vehicle::StatusCode setValues(
- std::function<void(const std::vector<
- ::aidl::android::hardware::automotive::vehicle::SetValueResult>&)>&&
- callback,
+ std::shared_ptr<const SetValuesCallback> callback,
const std::vector<::aidl::android::hardware::automotive::vehicle::SetValueRequest>&
requests) = 0;
@@ -69,9 +76,7 @@
// The callback is safe to be called after the function returns and is safe to be called in a
// different thread.
virtual ::aidl::android::hardware::automotive::vehicle::StatusCode getValues(
- std::function<void(const std::vector<
- ::aidl::android::hardware::automotive::vehicle::GetValueResult>&)>&&
- callback,
+ std::shared_ptr<const GetValuesCallback> callback,
const std::vector<::aidl::android::hardware::automotive::vehicle::GetValueRequest>&
requests) const = 0;
@@ -83,13 +88,12 @@
// Register a callback that would be called when there is a property change event from vehicle.
virtual void registerOnPropertyChangeEvent(
- std::function<void(const std::vector<::aidl::android::hardware::automotive::vehicle::
- VehiclePropValue>&)>&& callback) = 0;
+ std::unique_ptr<const PropertyChangeCallback> callback) = 0;
// Register a callback that would be called when there is a property set error event from
// vehicle.
virtual void registerOnPropertySetErrorEvent(
- std::function<void(const std::vector<SetValueErrorEvent>&)>&& callback) = 0;
+ std::unique_ptr<const PropertySetErrorCallback> callback) = 0;
};
} // namespace vehicle
diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp
index 79d3ebd..454fea5 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-aidl-default-service",
+ name: "android.hardware.automotive.vehicle@V1-default-service",
vendor: true,
defaults: [
"FakeVehicleHardwareDefaults",
diff --git a/automotive/vehicle/aidl/impl/vhal/src/VehicleService.cpp b/automotive/vehicle/aidl/impl/vhal/src/VehicleService.cpp
index 14224a5..c8b5c65 100644
--- a/automotive/vehicle/aidl/impl/vhal/src/VehicleService.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/src/VehicleService.cpp
@@ -32,8 +32,8 @@
::ndk::SharedRefBase::make<DefaultVehicleHal>(std::move(hardware));
ALOGI("Registering as service...");
- binder_exception_t err = AServiceManager_addService(vhal->asBinder().get(),
- "android.hardware.automotive.vehicle");
+ binder_exception_t err = AServiceManager_addService(
+ vhal->asBinder().get(), "android.hardware.automotive.vehicle.IVehicle/default");
if (err != EX_NONE) {
ALOGE("failed to register android.hardware.automotive.vehicle service, exception: %d", err);
return 1;
diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
index 62a7098..2b5ca70 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
@@ -19,6 +19,7 @@
#include <IVehicleHardware.h>
#include <LargeParcelableBase.h>
#include <aidl/android/hardware/automotive/vehicle/IVehicle.h>
+#include <android-base/thread_annotations.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
@@ -53,16 +54,17 @@
class MockVehicleHardware final : public IVehicleHardware {
public:
std::vector<VehiclePropConfig> getAllPropertyConfigs() const override {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
return mPropertyConfigs;
}
- StatusCode setValues(std::function<void(const std::vector<SetValueResult>&)>&&,
+ StatusCode setValues(std::shared_ptr<const SetValuesCallback>,
const std::vector<SetValueRequest>&) override {
// TODO(b/200737967): mock this.
return StatusCode::OK;
}
- StatusCode getValues(std::function<void(const std::vector<GetValueResult>&)>&&,
+ StatusCode getValues(std::shared_ptr<const GetValuesCallback>,
const std::vector<GetValueRequest>&) const override {
// TODO(b/200737967): mock this.
return StatusCode::OK;
@@ -78,23 +80,23 @@
return StatusCode::OK;
}
- void registerOnPropertyChangeEvent(
- std::function<void(const std::vector<VehiclePropValue>&)>&&) override {
+ void registerOnPropertyChangeEvent(std::unique_ptr<const PropertyChangeCallback>) override {
// TODO(b/200737967): mock this.
}
- void registerOnPropertySetErrorEvent(
- std::function<void(const std::vector<SetValueErrorEvent>&)>&&) override {
+ void registerOnPropertySetErrorEvent(std::unique_ptr<const PropertySetErrorCallback>) override {
// TODO(b/200737967): mock this.
}
// Test functions.
void setPropertyConfigs(const std::vector<VehiclePropConfig>& configs) {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
mPropertyConfigs = configs;
}
private:
- std::vector<VehiclePropConfig> mPropertyConfigs;
+ mutable std::mutex mLock;
+ std::vector<VehiclePropConfig> mPropertyConfigs GUARDED_BY(mLock);
};
struct PropConfigCmp {
diff --git a/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc
index 4c8865a..19267cd 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-aidl-default-service
+service vendor.vehicle-hal-default /vendor/bin/hw/android.hardware.automotive.vehicle@V1-default-service
class early_hal
user vehicle_network
group system inet
diff --git a/biometrics/face/aidl/default/main.cpp b/biometrics/face/aidl/default/main.cpp
index 80b153e..b7274e3 100644
--- a/biometrics/face/aidl/default/main.cpp
+++ b/biometrics/face/aidl/default/main.cpp
@@ -29,7 +29,7 @@
const std::string instance = std::string(Face::descriptor) + "/default";
binder_status_t status = AServiceManager_addService(hal->asBinder().get(), instance.c_str());
- CHECK(status == STATUS_OK);
+ CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
diff --git a/biometrics/fingerprint/aidl/default/main.cpp b/biometrics/fingerprint/aidl/default/main.cpp
index 4690d73..c985201 100644
--- a/biometrics/fingerprint/aidl/default/main.cpp
+++ b/biometrics/fingerprint/aidl/default/main.cpp
@@ -29,7 +29,7 @@
const std::string instance = std::string(Fingerprint::descriptor) + "/default";
binder_status_t status = AServiceManager_addService(hal->asBinder().get(), instance.c_str());
- CHECK(status == STATUS_OK);
+ CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
diff --git a/bluetooth/audio/2.1/Android.bp b/bluetooth/audio/2.1/Android.bp
index 822f5b3..1175fb3 100644
--- a/bluetooth/audio/2.1/Android.bp
+++ b/bluetooth/audio/2.1/Android.bp
@@ -25,7 +25,7 @@
],
apex_available: [
"//apex_available:platform",
- "com.android.bluetooth.updatable",
+ "com.android.bluetooth",
],
gen_java: false,
}
diff --git a/bluetooth/audio/2.1/default/BluetoothAudioProvidersFactory.cpp b/bluetooth/audio/2.1/default/BluetoothAudioProvidersFactory.cpp
index b0d171a..d7d5476 100644
--- a/bluetooth/audio/2.1/default/BluetoothAudioProvidersFactory.cpp
+++ b/bluetooth/audio/2.1/default/BluetoothAudioProvidersFactory.cpp
@@ -157,7 +157,11 @@
audio_capabilities[i].codecCapabilities(db_codec_capabilities[i]);
}
}
- } else if (sessionType != SessionType::UNKNOWN) {
+ } else if (sessionType !=
+ SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH &&
+ sessionType !=
+ SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH &&
+ sessionType != SessionType::UNKNOWN) {
std::vector<PcmParameters> db_pcm_capabilities =
android::bluetooth::audio::GetSoftwarePcmCapabilities_2_1();
if (db_pcm_capabilities.size() == 1) {
diff --git a/bluetooth/audio/2.2/Android.bp b/bluetooth/audio/2.2/Android.bp
index 6449c08..d66e84e 100644
--- a/bluetooth/audio/2.2/Android.bp
+++ b/bluetooth/audio/2.2/Android.bp
@@ -14,6 +14,7 @@
root: "android.hardware",
srcs: [
"types.hal",
+ "IBluetoothAudioPort.hal",
"IBluetoothAudioProvider.hal",
"IBluetoothAudioProvidersFactory.hal",
],
@@ -26,7 +27,7 @@
],
apex_available: [
"//apex_available:platform",
- "com.android.bluetooth.updatable",
+ "com.android.bluetooth",
],
gen_java: false,
}
diff --git a/bluetooth/audio/2.2/IBluetoothAudioPort.hal b/bluetooth/audio/2.2/IBluetoothAudioPort.hal
new file mode 100644
index 0000000..344899c
--- /dev/null
+++ b/bluetooth/audio/2.2/IBluetoothAudioPort.hal
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2021 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.bluetooth.audio@2.2;
+
+import @2.0::IBluetoothAudioPort;
+import android.hardware.audio.common@5.0::SinkMetadata;
+
+interface IBluetoothAudioPort extends @2.0::IBluetoothAudioPort {
+ /**
+ * Called when the metadata of the stream's sink has been changed.
+ *
+ * @param sinkMetadata Description of the audio that is recorded by the
+ * clients.
+ */
+ updateSinkMetadata(SinkMetadata sinkMetadata);
+};
diff --git a/bluetooth/audio/2.2/IBluetoothAudioProvider.hal b/bluetooth/audio/2.2/IBluetoothAudioProvider.hal
index ad8c839..bc16b01 100644
--- a/bluetooth/audio/2.2/IBluetoothAudioProvider.hal
+++ b/bluetooth/audio/2.2/IBluetoothAudioProvider.hal
@@ -17,7 +17,7 @@
package android.hardware.bluetooth.audio@2.2;
import @2.1::IBluetoothAudioProvider;
-import @2.0::IBluetoothAudioPort;
+import @2.2::IBluetoothAudioPort;
import @2.0::Status;
/**
diff --git a/bluetooth/audio/2.2/IBluetoothAudioProvidersFactory.hal b/bluetooth/audio/2.2/IBluetoothAudioProvidersFactory.hal
index 7fb5b6c..ae9c598 100644
--- a/bluetooth/audio/2.2/IBluetoothAudioProvidersFactory.hal
+++ b/bluetooth/audio/2.2/IBluetoothAudioProvidersFactory.hal
@@ -48,4 +48,26 @@
*/
openProvider_2_2(SessionType sessionType)
generates (Status status, IBluetoothAudioProvider provider);
+
+ /**
+ * Gets a list of audio capabilities for a session type.
+ *
+ * For software encoding, the PCM capabilities are returned.
+ * For hardware encoding, the supported codecs and their capabilities are
+ * returned.
+ *
+ * @param sessionType The session type (e.g.
+ * A2DP_SOFTWARE_ENCODING_DATAPATH).
+ * @return audioCapabilities A list containing all the capabilities
+ * supported by the sesson type. The capabilities is a list of
+ * available options when configuring the codec for the session.
+ * For software encoding it is the PCM data rate.
+ * For hardware encoding it is the list of supported codecs and their
+ * capabilities.
+ * If a provider isn't supported, an empty list should be returned.
+ * Note: Only one entry should exist per codec when using hardware
+ * encoding.
+ */
+ getProviderCapabilities_2_2(SessionType sessionType)
+ generates (vec<AudioCapabilities> audioCapabilities);
};
diff --git a/bluetooth/audio/2.2/default/A2dpOffloadAudioProvider.cpp b/bluetooth/audio/2.2/default/A2dpOffloadAudioProvider.cpp
index 126bc9e..2a6d93a 100644
--- a/bluetooth/audio/2.2/default/A2dpOffloadAudioProvider.cpp
+++ b/bluetooth/audio/2.2/default/A2dpOffloadAudioProvider.cpp
@@ -54,7 +54,7 @@
}
Return<void> A2dpOffloadAudioProvider::startSession(
- const sp<IBluetoothAudioPort>& hostIf,
+ const sp<V2_0::IBluetoothAudioPort>& hostIf,
const AudioConfiguration& audioConfig, startSession_cb _hidl_cb) {
/**
* Initialize the audio platform if audioConfiguration is supported.
diff --git a/bluetooth/audio/2.2/default/A2dpSoftwareAudioProvider.cpp b/bluetooth/audio/2.2/default/A2dpSoftwareAudioProvider.cpp
index 0d918e1..eb87178 100644
--- a/bluetooth/audio/2.2/default/A2dpSoftwareAudioProvider.cpp
+++ b/bluetooth/audio/2.2/default/A2dpSoftwareAudioProvider.cpp
@@ -21,7 +21,7 @@
#include <android-base/logging.h>
#include "BluetoothAudioSessionReport_2_2.h"
-#include "BluetoothAudioSupportedCodecsDB_2_1.h"
+#include "BluetoothAudioSupportedCodecsDB_2_2.h"
namespace android {
namespace hardware {
@@ -70,7 +70,7 @@
}
Return<void> A2dpSoftwareAudioProvider::startSession(
- const sp<IBluetoothAudioPort>& hostIf,
+ const sp<V2_0::IBluetoothAudioPort>& hostIf,
const AudioConfiguration& audioConfig, startSession_cb _hidl_cb) {
/**
* Initialize the audio platform if audioConfiguration is supported.
diff --git a/bluetooth/audio/2.2/default/A2dpSoftwareAudioProvider.h b/bluetooth/audio/2.2/default/A2dpSoftwareAudioProvider.h
index 3d4f0cc..ac3aece 100644
--- a/bluetooth/audio/2.2/default/A2dpSoftwareAudioProvider.h
+++ b/bluetooth/audio/2.2/default/A2dpSoftwareAudioProvider.h
@@ -40,7 +40,7 @@
bool isValid(const V2_1::SessionType& sessionType) override;
bool isValid(const V2_0::SessionType& sessionType) override;
- Return<void> startSession(const sp<IBluetoothAudioPort>& hostIf,
+ Return<void> startSession(const sp<V2_0::IBluetoothAudioPort>& hostIf,
const V2_0::AudioConfiguration& audioConfig,
startSession_cb _hidl_cb) override;
diff --git a/bluetooth/audio/2.2/default/AudioPort_2_0_to_2_2_Wrapper.h b/bluetooth/audio/2.2/default/AudioPort_2_0_to_2_2_Wrapper.h
new file mode 100644
index 0000000..c5613fb
--- /dev/null
+++ b/bluetooth/audio/2.2/default/AudioPort_2_0_to_2_2_Wrapper.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2021 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.
+ */
+
+#pragma once
+
+#include <android/hardware/bluetooth/audio/2.2/types.h>
+
+namespace android {
+namespace hardware {
+namespace bluetooth {
+namespace audio {
+namespace V2_2 {
+namespace implementation {
+
+using ::android::sp;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::audio::common::V5_0::SinkMetadata;
+using ::android::hardware::audio::common::V5_0::SourceMetadata;
+using ::android::hardware::bluetooth::audio::V2_2::IBluetoothAudioPort;
+
+class AudioPort_2_0_to_2_2_Wrapper : public V2_2::IBluetoothAudioPort {
+ public:
+ AudioPort_2_0_to_2_2_Wrapper(const sp<V2_0::IBluetoothAudioPort>& port) {
+ this->port = port;
+ }
+
+ Return<void> startStream() override { return port->startStream(); }
+ Return<void> suspendStream() override { return port->suspendStream(); }
+ Return<void> stopStream() override { return port->stopStream(); }
+ Return<void> getPresentationPosition(
+ getPresentationPosition_cb _hidl_cb) override {
+ return port->getPresentationPosition(_hidl_cb);
+ }
+ Return<void> updateMetadata(const SourceMetadata& sourceMetadata) override {
+ return port->updateMetadata(sourceMetadata);
+ }
+ Return<void> updateSinkMetadata(const SinkMetadata&) override {
+ // DO NOTHING, 2.0 AudioPort doesn't support sink metadata updates
+ return Void();
+ }
+
+ sp<V2_0::IBluetoothAudioPort> port;
+};
+
+} // namespace implementation
+} // namespace V2_2
+} // namespace audio
+} // namespace bluetooth
+} // namespace hardware
+} // namespace android
\ No newline at end of file
diff --git a/bluetooth/audio/2.2/default/BluetoothAudioProvider.cpp b/bluetooth/audio/2.2/default/BluetoothAudioProvider.cpp
index 3655bc0..18ac292 100644
--- a/bluetooth/audio/2.2/default/BluetoothAudioProvider.cpp
+++ b/bluetooth/audio/2.2/default/BluetoothAudioProvider.cpp
@@ -20,8 +20,9 @@
#include <android-base/logging.h>
+#include "AudioPort_2_0_to_2_2_Wrapper.h"
#include "BluetoothAudioSessionReport_2_2.h"
-#include "BluetoothAudioSupportedCodecsDB_2_1.h"
+#include "BluetoothAudioSupportedCodecsDB_2_2.h"
namespace android {
namespace hardware {
@@ -51,7 +52,7 @@
audio_config_({}) {}
Return<void> BluetoothAudioProvider::startSession(
- const sp<IBluetoothAudioPort>& hostIf,
+ const sp<V2_0::IBluetoothAudioPort>& hostIf,
const V2_0::AudioConfiguration& audioConfig, startSession_cb _hidl_cb) {
AudioConfiguration audioConfig_2_2;
@@ -67,11 +68,13 @@
audioConfig_2_2.codecConfig(audioConfig.codecConfig());
}
- return startSession_2_2(hostIf, audioConfig_2_2, _hidl_cb);
+ sp<V2_2::IBluetoothAudioPort> hostIf_2_2 =
+ new AudioPort_2_0_to_2_2_Wrapper(hostIf);
+ return startSession_2_2(hostIf_2_2, audioConfig_2_2, _hidl_cb);
}
Return<void> BluetoothAudioProvider::startSession_2_1(
- const sp<IBluetoothAudioPort>& hostIf,
+ const sp<V2_0::IBluetoothAudioPort>& hostIf,
const V2_1::AudioConfiguration& audioConfig, startSession_cb _hidl_cb) {
AudioConfiguration audioConfig_2_2;
if (audioConfig.getDiscriminator() ==
@@ -92,11 +95,13 @@
audioConfig_2_2.codecConfig(audioConfig.codecConfig());
}
- return startSession_2_2(hostIf, audioConfig_2_2, _hidl_cb);
+ sp<V2_2::IBluetoothAudioPort> hostIf_2_2 =
+ new AudioPort_2_0_to_2_2_Wrapper(hostIf);
+ return startSession_2_2(hostIf_2_2, audioConfig_2_2, _hidl_cb);
}
Return<void> BluetoothAudioProvider::startSession_2_2(
- const sp<IBluetoothAudioPort>& hostIf,
+ const sp<V2_2::IBluetoothAudioPort>& hostIf,
const AudioConfiguration& audioConfig, startSession_cb _hidl_cb) {
if (hostIf == nullptr) {
_hidl_cb(BluetoothAudioStatus::FAILURE, DataMQ::Descriptor());
diff --git a/bluetooth/audio/2.2/default/BluetoothAudioProvider.h b/bluetooth/audio/2.2/default/BluetoothAudioProvider.h
index b7581ba..0f1f3c6 100644
--- a/bluetooth/audio/2.2/default/BluetoothAudioProvider.h
+++ b/bluetooth/audio/2.2/default/BluetoothAudioProvider.h
@@ -26,7 +26,7 @@
namespace implementation {
using ::android::sp;
-using ::android::hardware::bluetooth::audio::V2_0::IBluetoothAudioPort;
+using ::android::hardware::bluetooth::audio::V2_2::IBluetoothAudioPort;
using BluetoothAudioStatus =
::android::hardware::bluetooth::audio::V2_0::Status;
@@ -41,13 +41,13 @@
virtual bool isValid(const V2_1::SessionType& sessionType) = 0;
virtual bool isValid(const V2_0::SessionType& sessionType) = 0;
- Return<void> startSession(const sp<IBluetoothAudioPort>& hostIf,
+ Return<void> startSession(const sp<V2_0::IBluetoothAudioPort>& hostIf,
const V2_0::AudioConfiguration& audioConfig,
startSession_cb _hidl_cb) override;
- Return<void> startSession_2_1(const sp<IBluetoothAudioPort>& hostIf,
+ Return<void> startSession_2_1(const sp<V2_0::IBluetoothAudioPort>& hostIf,
const V2_1::AudioConfiguration& audioConfig,
startSession_cb _hidl_cb) override;
- Return<void> startSession_2_2(const sp<IBluetoothAudioPort>& hostIf,
+ Return<void> startSession_2_2(const sp<V2_2::IBluetoothAudioPort>& hostIf,
const AudioConfiguration& audioConfig,
startSession_cb _hidl_cb) override;
Return<void> streamStarted(BluetoothAudioStatus status) override;
@@ -59,7 +59,7 @@
V2_1::SessionType session_type_;
AudioConfiguration audio_config_;
- sp<V2_0::IBluetoothAudioPort> stack_iface_;
+ sp<V2_2::IBluetoothAudioPort> stack_iface_;
virtual Return<void> onSessionReady(startSession_cb _hidl_cb) = 0;
};
diff --git a/bluetooth/audio/2.2/default/BluetoothAudioProvidersFactory.cpp b/bluetooth/audio/2.2/default/BluetoothAudioProvidersFactory.cpp
index 510833d..2fe31d5 100644
--- a/bluetooth/audio/2.2/default/BluetoothAudioProvidersFactory.cpp
+++ b/bluetooth/audio/2.2/default/BluetoothAudioProvidersFactory.cpp
@@ -20,7 +20,7 @@
#include <android-base/logging.h>
-#include "BluetoothAudioSupportedCodecsDB_2_1.h"
+#include "BluetoothAudioSupportedCodecsDB_2_2.h"
namespace android {
namespace hardware {
@@ -221,6 +221,47 @@
return Void();
}
+Return<void> BluetoothAudioProvidersFactory::getProviderCapabilities_2_2(
+ const V2_1::SessionType sessionType,
+ getProviderCapabilities_2_2_cb _hidl_cb) {
+ hidl_vec<V2_2::AudioCapabilities> audio_capabilities =
+ hidl_vec<V2_2::AudioCapabilities>(0);
+ if (sessionType == V2_1::SessionType::A2DP_HARDWARE_OFFLOAD_DATAPATH) {
+ std::vector<CodecCapabilities> db_codec_capabilities =
+ android::bluetooth::audio::GetOffloadCodecCapabilities(sessionType);
+ if (db_codec_capabilities.size()) {
+ audio_capabilities.resize(db_codec_capabilities.size());
+ for (int i = 0; i < db_codec_capabilities.size(); ++i) {
+ audio_capabilities[i].codecCapabilities(db_codec_capabilities[i]);
+ }
+ }
+ } else if (sessionType == V2_1::SessionType::
+ LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH ||
+ sessionType == V2_1::SessionType::
+ LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH) {
+ std::vector<LeAudioCodecCapabilitiesPair> db_codec_capabilities =
+ android::bluetooth::audio::GetLeAudioOffloadCodecCapabilities(
+ sessionType);
+ if (db_codec_capabilities.size()) {
+ audio_capabilities.resize(db_codec_capabilities.size());
+ for (int i = 0; i < db_codec_capabilities.size(); ++i) {
+ audio_capabilities[i].leAudioCapabilities(db_codec_capabilities[i]);
+ }
+ }
+ } else if (sessionType != V2_1::SessionType::UNKNOWN) {
+ std::vector<V2_1::PcmParameters> db_pcm_capabilities =
+ android::bluetooth::audio::GetSoftwarePcmCapabilities_2_1();
+ if (db_pcm_capabilities.size() == 1) {
+ audio_capabilities.resize(1);
+ audio_capabilities[0].pcmCapabilities(db_pcm_capabilities[0]);
+ }
+ }
+ LOG(INFO) << __func__ << " - SessionType=" << toString(sessionType)
+ << " supports " << audio_capabilities.size() << " codecs";
+ _hidl_cb(audio_capabilities);
+ return Void();
+}
+
IBluetoothAudioProvidersFactory* HIDL_FETCH_IBluetoothAudioProvidersFactory(
const char* /* name */) {
return new BluetoothAudioProvidersFactory();
diff --git a/bluetooth/audio/2.2/default/BluetoothAudioProvidersFactory.h b/bluetooth/audio/2.2/default/BluetoothAudioProvidersFactory.h
index 658249b..4f549d9 100644
--- a/bluetooth/audio/2.2/default/BluetoothAudioProvidersFactory.h
+++ b/bluetooth/audio/2.2/default/BluetoothAudioProvidersFactory.h
@@ -53,6 +53,10 @@
const V2_1::SessionType sessionType,
getProviderCapabilities_2_1_cb _hidl_cb) override;
+ Return<void> getProviderCapabilities_2_2(
+ const V2_1::SessionType sessionType,
+ getProviderCapabilities_2_2_cb _hidl_cb) override;
+
private:
static A2dpSoftwareAudioProvider a2dp_software_provider_instance_;
static A2dpOffloadAudioProvider a2dp_offload_provider_instance_;
diff --git a/bluetooth/audio/2.2/default/HearingAidAudioProvider.cpp b/bluetooth/audio/2.2/default/HearingAidAudioProvider.cpp
index c79b910..25e49a1 100644
--- a/bluetooth/audio/2.2/default/HearingAidAudioProvider.cpp
+++ b/bluetooth/audio/2.2/default/HearingAidAudioProvider.cpp
@@ -21,7 +21,7 @@
#include <android-base/logging.h>
#include "BluetoothAudioSessionReport_2_2.h"
-#include "BluetoothAudioSupportedCodecsDB_2_1.h"
+#include "BluetoothAudioSupportedCodecsDB_2_2.h"
namespace android {
namespace hardware {
@@ -66,7 +66,7 @@
}
Return<void> HearingAidAudioProvider::startSession(
- const sp<IBluetoothAudioPort>& hostIf,
+ const sp<V2_0::IBluetoothAudioPort>& hostIf,
const AudioConfiguration& audioConfig, startSession_cb _hidl_cb) {
/**
* Initialize the audio platform if audioConfiguration is supported.
diff --git a/bluetooth/audio/2.2/default/HearingAidAudioProvider.h b/bluetooth/audio/2.2/default/HearingAidAudioProvider.h
index 426c443..63290b5 100644
--- a/bluetooth/audio/2.2/default/HearingAidAudioProvider.h
+++ b/bluetooth/audio/2.2/default/HearingAidAudioProvider.h
@@ -40,7 +40,7 @@
bool isValid(const V2_1::SessionType& sessionType) override;
bool isValid(const V2_0::SessionType& sessionType) override;
- Return<void> startSession(const sp<IBluetoothAudioPort>& hostIf,
+ Return<void> startSession(const sp<V2_0::IBluetoothAudioPort>& hostIf,
const V2_0::AudioConfiguration& audioConfig,
startSession_cb _hidl_cb) override;
diff --git a/bluetooth/audio/2.2/default/LeAudioAudioProvider.cpp b/bluetooth/audio/2.2/default/LeAudioAudioProvider.cpp
index af6ec99..a7a0023 100644
--- a/bluetooth/audio/2.2/default/LeAudioAudioProvider.cpp
+++ b/bluetooth/audio/2.2/default/LeAudioAudioProvider.cpp
@@ -20,8 +20,9 @@
#include <android-base/logging.h>
+#include "AudioPort_2_0_to_2_2_Wrapper.h"
#include "BluetoothAudioSessionReport_2_2.h"
-#include "BluetoothAudioSupportedCodecsDB_2_1.h"
+#include "BluetoothAudioSupportedCodecsDB_2_2.h"
namespace android {
namespace hardware {
@@ -83,11 +84,13 @@
.bitsPerSample = audioConfig.pcmConfig().bitsPerSample,
.dataIntervalUs = 0});
- return startSession_2_2(hostIf, audioConfig_2_2, _hidl_cb);
+ sp<V2_2::IBluetoothAudioPort> hostIf_2_2 =
+ new AudioPort_2_0_to_2_2_Wrapper(hostIf);
+ return startSession_2_2(hostIf_2_2, audioConfig_2_2, _hidl_cb);
}
Return<void> LeAudioAudioProvider::startSession_2_2(
- const sp<V2_0::IBluetoothAudioPort>& hostIf,
+ const sp<V2_2::IBluetoothAudioPort>& hostIf,
const AudioConfiguration& audioConfig, startSession_cb _hidl_cb) {
/**
* Initialize the audio platform if audioConfiguration is supported.
diff --git a/bluetooth/audio/2.2/default/LeAudioAudioProvider.h b/bluetooth/audio/2.2/default/LeAudioAudioProvider.h
index 40c26e0..3de1724 100644
--- a/bluetooth/audio/2.2/default/LeAudioAudioProvider.h
+++ b/bluetooth/audio/2.2/default/LeAudioAudioProvider.h
@@ -45,7 +45,7 @@
const V2_1::AudioConfiguration& audioConfig,
startSession_cb _hidl_cb) override;
- Return<void> startSession_2_2(const sp<V2_0::IBluetoothAudioPort>& hostIf,
+ Return<void> startSession_2_2(const sp<V2_2::IBluetoothAudioPort>& hostIf,
const AudioConfiguration& audioConfig,
startSession_cb _hidl_cb) override;
diff --git a/bluetooth/audio/2.2/default/LeAudioOffloadAudioProvider.cpp b/bluetooth/audio/2.2/default/LeAudioOffloadAudioProvider.cpp
index 7b70654..2b0c02f 100644
--- a/bluetooth/audio/2.2/default/LeAudioOffloadAudioProvider.cpp
+++ b/bluetooth/audio/2.2/default/LeAudioOffloadAudioProvider.cpp
@@ -20,8 +20,8 @@
#include <android-base/logging.h>
+#include "AudioPort_2_0_to_2_2_Wrapper.h"
#include "BluetoothAudioSessionReport_2_2.h"
-#include "BluetoothAudioSupportedCodecsDB_2_1.h"
#include "BluetoothAudioSupportedCodecsDB_2_2.h"
namespace android {
@@ -91,11 +91,13 @@
.peerDelay = 0,
.lc3Config = audioConfig.leAudioCodecConfig().lc3Config};
- return startSession_2_2(hostIf, audioConfig_2_2, _hidl_cb);
+ sp<V2_2::IBluetoothAudioPort> hostIf_2_2 =
+ new AudioPort_2_0_to_2_2_Wrapper(hostIf);
+ return startSession_2_2(hostIf_2_2, audioConfig_2_2, _hidl_cb);
}
Return<void> LeAudioOffloadAudioProvider::startSession_2_2(
- const sp<V2_0::IBluetoothAudioPort>& hostIf,
+ const sp<V2_2::IBluetoothAudioPort>& hostIf,
const AudioConfiguration& audioConfig, startSession_cb _hidl_cb) {
/**
* Initialize the audio platform if audioConfiguration is supported.
diff --git a/bluetooth/audio/2.2/default/LeAudioOffloadAudioProvider.h b/bluetooth/audio/2.2/default/LeAudioOffloadAudioProvider.h
index 5620295..fe58de5 100644
--- a/bluetooth/audio/2.2/default/LeAudioOffloadAudioProvider.h
+++ b/bluetooth/audio/2.2/default/LeAudioOffloadAudioProvider.h
@@ -38,7 +38,7 @@
const V2_1::AudioConfiguration& audioConfig,
startSession_cb _hidl_cb) override;
- Return<void> startSession_2_2(const sp<V2_0::IBluetoothAudioPort>& hostIf,
+ Return<void> startSession_2_2(const sp<V2_2::IBluetoothAudioPort>& hostIf,
const AudioConfiguration& audioConfig,
startSession_cb _hidl_cb) override;
diff --git a/bluetooth/audio/2.2/types.hal b/bluetooth/audio/2.2/types.hal
index d5f8a3f..8ec3660 100644
--- a/bluetooth/audio/2.2/types.hal
+++ b/bluetooth/audio/2.2/types.hal
@@ -19,6 +19,8 @@
import @2.1::Lc3Parameters;
import @2.1::PcmParameters;
import @2.0::CodecConfiguration;
+import @2.0::CodecCapabilities;
+import @2.1::CodecType;
enum LeAudioMode : uint8_t {
UNKNOWN = 0x00,
@@ -26,6 +28,12 @@
BROADCAST = 0x02,
};
+enum AudioLocation : uint8_t {
+ UNKNOWN = 0,
+ FRONT_LEFT = 1,
+ FRONT_RIGHT = 2,
+};
+
struct UnicastStreamMap {
/* The connection handle used for a unicast or a broadcast group. */
uint16_t streamHandle;
@@ -70,3 +78,37 @@
CodecConfiguration codecConfig;
LeAudioConfiguration leAudioConfig;
};
+
+/** Used to specify the capabilities of the different session types */
+safe_union AudioCapabilities {
+ PcmParameters pcmCapabilities;
+ CodecCapabilities codecCapabilities;
+ LeAudioCodecCapabilitiesPair leAudioCapabilities;
+};
+
+/**
+ * Used to specify th le audio capabilities pair of the Hardware offload encode and decode.
+ */
+struct LeAudioCodecCapabilitiesPair{
+ LeAudioMode mode;
+ LeAudioCodecCapability encodeCapability;
+ LeAudioCodecCapability decodeCapability;
+};
+
+/**
+ * Used to specify the le audio capabilities of the codecs supported by Hardware offload
+ * for encode or decode.
+ */
+struct LeAudioCodecCapability {
+ CodecType codecType;
+ AudioLocation supportedChannel;
+
+ // The number of connected device
+ uint8_t deviceCount;
+
+ // Supported channel count for each device
+ uint8_t channelCountPerDevice;
+
+ // Should use safe union when there is more than one codec
+ Lc3Parameters capabilities;
+};
diff --git a/bluetooth/audio/aidl/Android.bp b/bluetooth/audio/aidl/Android.bp
index 60da877..12eed55 100644
--- a/bluetooth/audio/aidl/Android.bp
+++ b/bluetooth/audio/aidl/Android.bp
@@ -12,6 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
aidl_interface {
name: "android.hardware.bluetooth.audio",
vendor_available: true,
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl
similarity index 85%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl
index cfafc50..7c0d825 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright 2021 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
+ * 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,
@@ -31,8 +31,11 @@
// 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.graphics.composer3;
+package android.hardware.bluetooth.audio;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum BluetoothAudioStatus {
+ UNKNOWN = 0,
+ SUCCESS = 1,
+ UNSUPPORTED_CODEC_CONFIGURATION = 2,
+ FAILURE = 3,
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl
index e389ef3..9a1557a 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl
@@ -38,5 +38,6 @@
void startStream();
void stopStream();
void suspendStream();
- void updateMetadata(in android.hardware.audio.common.SourceMetadata sourceMetadata);
+ void updateSourceMetadata(in android.hardware.audio.common.SourceMetadata sourceMetadata);
+ void updateSinkMetadata(in android.hardware.audio.common.SinkMetadata sinkMetadata);
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
index 84bcc0c..e5e79cb 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
@@ -35,7 +35,7 @@
@VintfStability
interface IBluetoothAudioProvider {
void endSession();
- android.hardware.common.fmq.MQDescriptor<int,android.hardware.common.fmq.UnsynchronizedWrite> startSession(in android.hardware.bluetooth.audio.IBluetoothAudioPort hostIf, in android.hardware.bluetooth.audio.AudioConfiguration audioConfig);
- void streamStarted(in boolean status);
- void streamSuspended(in boolean status);
+ android.hardware.common.fmq.MQDescriptor<byte,android.hardware.common.fmq.SynchronizedReadWrite> startSession(in android.hardware.bluetooth.audio.IBluetoothAudioPort hostIf, in android.hardware.bluetooth.audio.AudioConfiguration audioConfig);
+ void streamStarted(in android.hardware.bluetooth.audio.BluetoothAudioStatus status);
+ void streamSuspended(in android.hardware.bluetooth.audio.BluetoothAudioStatus status);
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl
index bc0d97b..693392f 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl
@@ -34,8 +34,8 @@
package android.hardware.bluetooth.audio;
@Backing(type="byte") @VintfStability
enum LdacQualityIndex {
- QUALITY_HIGH = 1,
- QUALITY_MID = 2,
- QUALITY_LOW = 4,
- QUALITY_ABR = 8,
+ HIGH = 1,
+ MID = 2,
+ LOW = 4,
+ ABR = 8,
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
index 9efafca..a7224ca 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
@@ -38,13 +38,13 @@
android.hardware.bluetooth.audio.CodecType codecType;
android.hardware.bluetooth.audio.AudioLocation supportedChannel;
int supportedChannelCount;
- android.hardware.bluetooth.audio.LeAudioCapabilities.LeaudioCodecCapabilities leaudioCodecCapabilities;
+ android.hardware.bluetooth.audio.LeAudioCapabilities.LeAudioCodecCapabilities leAudioCodecCapabilities;
@VintfStability
parcelable VendorCapabilities {
ParcelableHolder extension;
}
@VintfStability
- union LeaudioCodecCapabilities {
+ union LeAudioCodecCapabilities {
android.hardware.bluetooth.audio.Lc3Capabilities lc3Capabilities;
android.hardware.bluetooth.audio.LeAudioCapabilities.VendorCapabilities vendorCapabillities;
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl
index c6cb5cb..2bc1791 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl
@@ -35,10 +35,10 @@
@VintfStability
parcelable LeAudioConfiguration {
android.hardware.bluetooth.audio.LeAudioMode mode;
- android.hardware.bluetooth.audio.LeAudioConfiguration.LeAuioModeConfig modeConfig;
+ android.hardware.bluetooth.audio.LeAudioConfiguration.LeAudioModeConfig modeConfig;
android.hardware.bluetooth.audio.CodecType codecType;
@VintfStability
- union LeAuioModeConfig {
+ union LeAudioModeConfig {
android.hardware.bluetooth.audio.UnicastConfiguration unicastConfig;
android.hardware.bluetooth.audio.BroadcastConfiguration broadcastConfig;
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl
index 0c2f87d..6cfe5cd 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl
@@ -35,7 +35,7 @@
@VintfStability
parcelable PcmCapabilities {
int[] sampleRateHz;
- android.hardware.bluetooth.audio.ChannelMode[] channelMode;
+ android.hardware.bluetooth.audio.ChannelMode channelMode;
byte[] bitsPerSample;
int[] dataIntervalUs;
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl
index 810a9a1..7e997e8 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl
@@ -36,7 +36,7 @@
parcelable PresentationPosition {
long remoteDeviceAudioDelayNanos;
long transmittedOctets;
- android.hardware.bluetooth.audio.PresentationPosition.TimeSpec transmittedOctetsTimeStamp;
+ android.hardware.bluetooth.audio.PresentationPosition.TimeSpec transmittedOctetsTimestamp;
@VintfStability
parcelable TimeSpec {
long tvSec;
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl
index 900ab31..72d7fb2 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl
@@ -36,7 +36,7 @@
enum SessionType {
UNKNOWN = 0,
A2DP_SOFTWARE_ENCODING_DATAPATH = 1,
- A2DP_HARDWARE_OFFLOAD_DATAPATH = 2,
+ A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH = 2,
HEARING_AID_SOFTWARE_ENCODING_DATAPATH = 3,
LE_AUDIO_SOFTWARE_ENCODING_DATAPATH = 4,
LE_AUDIO_SOFTWARE_DECODING_DATAPATH = 5,
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl
similarity index 60%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl
index 0a93c9e..ec78445 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright 2021 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
+ * 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,
@@ -14,20 +14,14 @@
* limitations under the License.
*/
-package android.hardware.graphics.composer3;
+package android.hardware.bluetooth.audio;
-/**
- * Special index values (always negative) for command queue commands.
- */
@VintfStability
@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+enum BluetoothAudioStatus {
+ UNKNOWN = 0,
+ SUCCESS = 1,
+ UNSUPPORTED_CODEC_CONFIGURATION = 2,
+ // General failure
+ FAILURE = 3
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl
index 50e3197..827f57d 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioPort.aidl
@@ -16,6 +16,7 @@
package android.hardware.bluetooth.audio;
+import android.hardware.audio.common.SinkMetadata;
import android.hardware.audio.common.SourceMetadata;
import android.hardware.bluetooth.audio.PresentationPosition;
@@ -69,5 +70,12 @@
* @param sourceMetadata Description of the audio that is played by the
* clients.
*/
- void updateMetadata(in SourceMetadata sourceMetadata);
+ void updateSourceMetadata(in SourceMetadata sourceMetadata);
+
+ /**
+ * Called when the metadata of the stream's sink has been changed.
+ *
+ * @param sinkMetadata as passed from Audio Framework
+ */
+ void updateSinkMetadata(in SinkMetadata sinkMetadata);
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
index cebd808..a2c5ae9 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
@@ -17,9 +17,10 @@
package android.hardware.bluetooth.audio;
import android.hardware.bluetooth.audio.AudioConfiguration;
+import android.hardware.bluetooth.audio.BluetoothAudioStatus;
import android.hardware.bluetooth.audio.IBluetoothAudioPort;
import android.hardware.common.fmq.MQDescriptor;
-import android.hardware.common.fmq.UnsynchronizedWrite;
+import android.hardware.common.fmq.SynchronizedReadWrite;
/**
* HAL interface from the Bluetooth stack to the Audio HAL
@@ -55,7 +56,7 @@
* audioConfig.pcmConfig parameter. Invalid if streaming is offloaded
* from/to hardware or on failure
*/
- MQDescriptor<int, UnsynchronizedWrite> startSession(
+ MQDescriptor<byte, SynchronizedReadWrite> startSession(
in IBluetoothAudioPort hostIf, in AudioConfiguration audioConfig);
/**
@@ -63,12 +64,12 @@
*
* @param status true for SUCCESS or false for FAILURE
*/
- void streamStarted(in boolean status);
+ void streamStarted(in BluetoothAudioStatus status);
/**
* Callback for IBluetoothAudioPort.suspendStream()
*
* @param status true for SUCCESS or false for FAILURE
*/
- void streamSuspended(in boolean status);
+ void streamSuspended(in BluetoothAudioStatus status);
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl
index fc532f4..cb12583 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl
@@ -22,17 +22,17 @@
/**
* 990kbps
*/
- QUALITY_HIGH = 1,
+ HIGH = 1,
/**
* 660kbps
*/
- QUALITY_MID = 1 << 1,
+ MID = 1 << 1,
/**
* 330kbps
*/
- QUALITY_LOW = 1 << 2,
+ LOW = 1 << 2,
/**
* Adaptive Bit Rate mode
*/
- QUALITY_ABR = 1 << 3,
+ ABR = 1 << 3,
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
index ea05820..732427f 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
@@ -31,7 +31,7 @@
ParcelableHolder extension;
}
@VintfStability
- union LeaudioCodecCapabilities {
+ union LeAudioCodecCapabilities {
Lc3Capabilities lc3Capabilities;
VendorCapabilities vendorCapabillities;
}
@@ -43,5 +43,5 @@
*/
AudioLocation supportedChannel;
int supportedChannelCount;
- LeaudioCodecCapabilities leaudioCodecCapabilities;
+ LeAudioCodecCapabilities leAudioCodecCapabilities;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl
index a212c96..515794b 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl
@@ -24,7 +24,7 @@
@VintfStability
parcelable LeAudioConfiguration {
@VintfStability
- union LeAuioModeConfig {
+ union LeAudioModeConfig {
UnicastConfiguration unicastConfig;
BroadcastConfiguration broadcastConfig;
}
@@ -32,6 +32,6 @@
* The mode of the LE audio
*/
LeAudioMode mode;
- LeAuioModeConfig modeConfig;
+ LeAudioModeConfig modeConfig;
CodecType codecType;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl
index 776b777..f5d699e 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl
@@ -24,7 +24,7 @@
@VintfStability
parcelable PcmCapabilities {
int[] sampleRateHz;
- ChannelMode[] channelMode;
+ ChannelMode channelMode;
byte[] bitsPerSample;
/**
* Data interval for data transfer
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl
index 17e746f..f3b8aed 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl
@@ -44,9 +44,9 @@
*/
long transmittedOctets;
/*
- * transmittedOctetsTimeStamp the value of CLOCK_MONOTONIC
+ * transmittedOctetsTimestamp the value of CLOCK_MONOTONIC
* corresponding to transmittedOctets. If the software data path is
* unused (e.g., for Hardware Offload), the value is set to zero.
*/
- TimeSpec transmittedOctetsTimeStamp;
+ TimeSpec transmittedOctetsTimestamp;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl
index b588869..30faae3 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl
@@ -27,7 +27,7 @@
/**
* The encoding of AVDTP media is done by HW and there is control only
*/
- A2DP_HARDWARE_OFFLOAD_DATAPATH,
+ A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH,
/**
* Used when encoded by Bluetooth Stack and streaming to Hearing Aid
*/
diff --git a/bluetooth/audio/utils/Android.bp b/bluetooth/audio/utils/Android.bp
index 19d2d92..4f712bf 100644
--- a/bluetooth/audio/utils/Android.bp
+++ b/bluetooth/audio/utils/Android.bp
@@ -22,6 +22,7 @@
export_include_dirs: ["session/"],
header_libs: ["libhardware_headers"],
shared_libs: [
+ "android.hardware.audio.common@5.0",
"android.hardware.bluetooth.audio@2.0",
"android.hardware.bluetooth.audio@2.1",
"android.hardware.bluetooth.audio@2.2",
diff --git a/bluetooth/audio/utils/session/BluetoothAudioSessionControl_2_1.h b/bluetooth/audio/utils/session/BluetoothAudioSessionControl_2_1.h
index 95f7408..4d7be21 100644
--- a/bluetooth/audio/utils/session/BluetoothAudioSessionControl_2_1.h
+++ b/bluetooth/audio/utils/session/BluetoothAudioSessionControl_2_1.h
@@ -35,7 +35,7 @@
std::shared_ptr<BluetoothAudioSession_2_1> session_ptr =
BluetoothAudioSessionInstance_2_1::GetSessionInstance(session_type);
if (session_ptr != nullptr) {
- return session_ptr->IsSessionReady();
+ return session_ptr->GetAudioSession()->IsSessionReady();
}
return false;
}
diff --git a/bluetooth/audio/utils/session/BluetoothAudioSessionControl_2_2.h b/bluetooth/audio/utils/session/BluetoothAudioSessionControl_2_2.h
index e20914e..71ab464 100644
--- a/bluetooth/audio/utils/session/BluetoothAudioSessionControl_2_2.h
+++ b/bluetooth/audio/utils/session/BluetoothAudioSessionControl_2_2.h
@@ -76,6 +76,12 @@
} else if (session_type ==
SessionType_2_1::A2DP_HARDWARE_OFFLOAD_DATAPATH) {
return BluetoothAudioSession_2_2::kInvalidOffloadAudioConfiguration;
+ } else if (
+ session_type ==
+ SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH ||
+ session_type ==
+ SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH) {
+ return BluetoothAudioSession_2_2::kInvalidLeOffloadAudioConfiguration;
} else {
return BluetoothAudioSession_2_2::kInvalidSoftwareAudioConfiguration;
}
@@ -87,7 +93,7 @@
std::shared_ptr<BluetoothAudioSession_2_2> session_ptr =
BluetoothAudioSessionInstance_2_2::GetSessionInstance(session_type);
if (session_ptr != nullptr) {
- return session_ptr->GetAudioSession()->StartStream();
+ return session_ptr->StartStream();
}
return false;
}
@@ -96,7 +102,7 @@
std::shared_ptr<BluetoothAudioSession_2_2> session_ptr =
BluetoothAudioSessionInstance_2_2::GetSessionInstance(session_type);
if (session_ptr != nullptr) {
- return session_ptr->GetAudioSession()->SuspendStream();
+ return session_ptr->SuspendStream();
}
return false;
}
@@ -105,7 +111,7 @@
std::shared_ptr<BluetoothAudioSession_2_2> session_ptr =
BluetoothAudioSessionInstance_2_2::GetSessionInstance(session_type);
if (session_ptr != nullptr) {
- session_ptr->GetAudioSession()->StopStream();
+ session_ptr->StopStream();
}
}
@@ -132,6 +138,15 @@
}
}
+ static void UpdateSinkMetadata(const SessionType_2_1& session_type,
+ const struct sink_metadata* sink_metadata) {
+ std::shared_ptr<BluetoothAudioSession_2_2> session_ptr =
+ BluetoothAudioSessionInstance_2_2::GetSessionInstance(session_type);
+ if (session_ptr != nullptr) {
+ session_ptr->UpdateSinkMetadata(sink_metadata);
+ }
+ }
+
// The control API writes stream to FMQ
static size_t OutWritePcmData(const SessionType_2_1& session_type,
const void* buffer, size_t bytes) {
diff --git a/bluetooth/audio/utils/session/BluetoothAudioSessionReport_2_2.h b/bluetooth/audio/utils/session/BluetoothAudioSessionReport_2_2.h
index 194259a..79121cc 100644
--- a/bluetooth/audio/utils/session/BluetoothAudioSessionReport_2_2.h
+++ b/bluetooth/audio/utils/session/BluetoothAudioSessionReport_2_2.h
@@ -48,7 +48,7 @@
std::shared_ptr<BluetoothAudioSession_2_2> session_ptr =
BluetoothAudioSessionInstance_2_2::GetSessionInstance(session_type);
if (session_ptr != nullptr) {
- session_ptr->GetAudioSession()->OnSessionEnded();
+ session_ptr->OnSessionEnded();
}
}
// The API reports the Bluetooth stack has replied the result of startStream
diff --git a/bluetooth/audio/utils/session/BluetoothAudioSession_2_1.cpp b/bluetooth/audio/utils/session/BluetoothAudioSession_2_1.cpp
index c250ef1..bf1f9b5 100644
--- a/bluetooth/audio/utils/session/BluetoothAudioSession_2_1.cpp
+++ b/bluetooth/audio/utils/session/BluetoothAudioSession_2_1.cpp
@@ -46,6 +46,19 @@
return false;
}
}
+
+bool is_unsupported_2_1_session_type(
+ const ::android::hardware::bluetooth::audio::V2_1::SessionType&
+ session_type) {
+ if (session_type ==
+ SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH ||
+ session_type ==
+ SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH) {
+ return true;
+ } else {
+ return false;
+ }
+}
} // namespace
BluetoothAudioSession_2_1::BluetoothAudioSession_2_1(
@@ -53,23 +66,14 @@
session_type)
: audio_session(BluetoothAudioSessionInstance::GetSessionInstance(
static_cast<SessionType_2_0>(session_type))) {
- if (is_2_0_session_type(session_type)) {
+ if (is_2_0_session_type(session_type) ||
+ is_unsupported_2_1_session_type(session_type)) {
session_type_2_1_ = (SessionType_2_1::UNKNOWN);
} else {
session_type_2_1_ = (session_type);
}
}
-bool BluetoothAudioSession_2_1::IsSessionReady() {
- if (session_type_2_1_ !=
- SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH) {
- return audio_session->IsSessionReady();
- }
-
- std::lock_guard<std::recursive_mutex> guard(audio_session->mutex_);
- return audio_session->stack_iface_ != nullptr;
-}
-
std::shared_ptr<BluetoothAudioSession>
BluetoothAudioSession_2_1::GetAudioSession() {
return audio_session;
@@ -80,7 +84,7 @@
const ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration
BluetoothAudioSession_2_1::GetAudioConfig() {
std::lock_guard<std::recursive_mutex> guard(audio_session->mutex_);
- if (IsSessionReady()) {
+ if (audio_session->IsSessionReady()) {
// If session is unknown it means it should be 2.0 type
if (session_type_2_1_ != SessionType_2_1::UNKNOWN)
return audio_config_2_1_;
@@ -90,7 +94,7 @@
// pcmConfig only differs between 2.0 and 2.1 in AudioConfiguration
if (fromConf.getDiscriminator() ==
AudioConfiguration::hidl_discriminator::codecConfig) {
- toConf.codecConfig() = fromConf.codecConfig();
+ toConf.codecConfig(fromConf.codecConfig());
} else {
toConf.pcmConfig() = {
.sampleRate = static_cast<
@@ -122,9 +126,6 @@
SessionType_2_1::LE_AUDIO_SOFTWARE_DECODED_DATAPATH);
bool is_offload_a2dp_session =
(session_type_2_1_ == SessionType_2_1::A2DP_HARDWARE_OFFLOAD_DATAPATH);
- bool is_offload_le_audio_session =
- (session_type_2_1_ == SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH ||
- session_type_2_1_ == SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH);
auto audio_config_discriminator = audio_config.getDiscriminator();
bool is_software_audio_config =
(is_software_session &&
@@ -136,13 +137,7 @@
audio_config_discriminator ==
::android::hardware::bluetooth::audio::V2_1::AudioConfiguration::
hidl_discriminator::codecConfig);
- bool is_le_audio_offload_audio_config =
- (is_offload_le_audio_session &&
- audio_config_discriminator ==
- ::android::hardware::bluetooth::audio::V2_1::AudioConfiguration::
- hidl_discriminator::leAudioCodecConfig);
- if (!is_software_audio_config && !is_a2dp_offload_audio_config &&
- !is_le_audio_offload_audio_config) {
+ if (!is_software_audio_config && !is_a2dp_offload_audio_config) {
return false;
}
audio_config_2_1_ = audio_config;
diff --git a/bluetooth/audio/utils/session/BluetoothAudioSession_2_1.h b/bluetooth/audio/utils/session/BluetoothAudioSession_2_1.h
index db82c73..5a35153 100644
--- a/bluetooth/audio/utils/session/BluetoothAudioSession_2_1.h
+++ b/bluetooth/audio/utils/session/BluetoothAudioSession_2_1.h
@@ -50,10 +50,6 @@
const ::android::hardware::bluetooth::audio::V2_1::SessionType&
session_type);
- // The function helps to check if this session is ready or not
- // @return: true if the Bluetooth stack has started the specified session
- bool IsSessionReady();
-
std::shared_ptr<BluetoothAudioSession> GetAudioSession();
// The report function is used to report that the Bluetooth stack has started
diff --git a/bluetooth/audio/utils/session/BluetoothAudioSession_2_2.cpp b/bluetooth/audio/utils/session/BluetoothAudioSession_2_2.cpp
index 5a6b2e7..db1619b 100644
--- a/bluetooth/audio/utils/session/BluetoothAudioSession_2_2.cpp
+++ b/bluetooth/audio/utils/session/BluetoothAudioSession_2_2.cpp
@@ -20,10 +20,23 @@
#include <android-base/logging.h>
#include <android-base/stringprintf.h>
+#include <android/hardware/bluetooth/audio/2.2/IBluetoothAudioPort.h>
namespace android {
namespace bluetooth {
namespace audio {
+
+using ::android::hardware::audio::common::V5_0::AudioSource;
+using ::android::hardware::audio::common::V5_0::RecordTrackMetadata;
+using ::android::hardware::audio::common::V5_0::SinkMetadata;
+using ::android::hardware::bluetooth::audio::V2_0::BitsPerSample;
+using ::android::hardware::bluetooth::audio::V2_0::ChannelMode;
+using ::android::hardware::bluetooth::audio::V2_2::LeAudioConfiguration;
+using ::android::hardware::bluetooth::audio::V2_2::LeAudioMode;
+using PcmParameters_2_1 =
+ ::android::hardware::bluetooth::audio::V2_1::PcmParameters;
+using SampleRate_2_1 = ::android::hardware::bluetooth::audio::V2_1::SampleRate;
+
using SessionType_2_1 =
::android::hardware::bluetooth::audio::V2_1::SessionType;
using SessionType_2_0 =
@@ -32,10 +45,27 @@
using AudioConfiguration_2_1 =
::android::hardware::bluetooth::audio::V2_1::AudioConfiguration;
+static constexpr PcmParameters_2_1 kInvalidPcmParameters = {
+ .sampleRate = SampleRate_2_1::RATE_UNKNOWN,
+ .channelMode = ChannelMode::UNKNOWN,
+ .bitsPerSample = BitsPerSample::BITS_UNKNOWN,
+ .dataIntervalUs = 0,
+};
+
+static LeAudioConfiguration kInvalidLeAudioConfig = {
+ .mode = LeAudioMode::UNKNOWN,
+ .config = {},
+};
+
::android::hardware::bluetooth::audio::V2_2::AudioConfiguration
BluetoothAudioSession_2_2::invalidSoftwareAudioConfiguration = {};
::android::hardware::bluetooth::audio::V2_2::AudioConfiguration
BluetoothAudioSession_2_2::invalidOffloadAudioConfiguration = {};
+::android::hardware::bluetooth::audio::V2_2::AudioConfiguration
+ BluetoothAudioSession_2_2::invalidLeOffloadAudioConfiguration = {};
+
+using IBluetoothAudioPort_2_2 =
+ ::android::hardware::bluetooth::audio::V2_2::IBluetoothAudioPort;
namespace {
bool is_2_0_session_type(
@@ -63,11 +93,17 @@
} else {
session_type_2_1_ = (session_type);
}
+ invalidSoftwareAudioConfiguration.pcmConfig(kInvalidPcmParameters);
+ invalidOffloadAudioConfiguration.codecConfig(
+ audio_session->kInvalidCodecConfiguration);
+ invalidLeOffloadAudioConfiguration.leAudioConfig(kInvalidLeAudioConfig);
}
bool BluetoothAudioSession_2_2::IsSessionReady() {
if (session_type_2_1_ !=
- SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH) {
+ SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH &&
+ session_type_2_1_ !=
+ SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH) {
return audio_session->IsSessionReady();
}
@@ -84,15 +120,71 @@
return audio_session_2_1;
}
+void BluetoothAudioSession_2_2::UpdateSinkMetadata(
+ const struct sink_metadata* sink_metadata) {
+ std::lock_guard<std::recursive_mutex> guard(audio_session->mutex_);
+ if (!IsSessionReady()) {
+ LOG(DEBUG) << __func__ << " - SessionType=" << toString(session_type_2_1_)
+ << " has NO session";
+ return;
+ }
+
+ ssize_t track_count = sink_metadata->track_count;
+ LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_2_1_)
+ << ", " << track_count << " track(s)";
+ if (session_type_2_1_ == SessionType_2_1::A2DP_SOFTWARE_ENCODING_DATAPATH ||
+ session_type_2_1_ == SessionType_2_1::A2DP_HARDWARE_OFFLOAD_DATAPATH) {
+ return;
+ }
+
+ struct record_track_metadata* track = sink_metadata->tracks;
+ SinkMetadata sinkMetadata;
+ RecordTrackMetadata* halMetadata;
+
+ sinkMetadata.tracks.resize(track_count);
+ halMetadata = sinkMetadata.tracks.data();
+ while (track_count && track) {
+ halMetadata->source = static_cast<AudioSource>(track->source);
+ halMetadata->gain = track->gain;
+ // halMetadata->destination leave unspecified
+ LOG(INFO) << __func__
+ << " - SessionType=" << toString(GetAudioSession()->session_type_)
+ << ", source=" << track->source
+ << ", dest_device=" << track->dest_device
+ << ", gain=" << track->gain
+ << ", dest_device_address=" << track->dest_device_address;
+ --track_count;
+ ++track;
+ ++halMetadata;
+ }
+
+ /* This is called just for 2.2 sessions, so it's safe to do this casting*/
+ IBluetoothAudioPort_2_2* stack_iface_2_2_ =
+ static_cast<IBluetoothAudioPort_2_2*>(audio_session->stack_iface_.get());
+ auto hal_retval = stack_iface_2_2_->updateSinkMetadata(sinkMetadata);
+ if (!hal_retval.isOk()) {
+ LOG(WARNING) << __func__ << " - IBluetoothAudioPort SessionType="
+ << toString(session_type_2_1_) << " failed";
+ }
+}
+
// The control function is for the bluetooth_audio module to get the current
// AudioConfiguration
const ::android::hardware::bluetooth::audio::V2_2::AudioConfiguration
BluetoothAudioSession_2_2::GetAudioConfig() {
std::lock_guard<std::recursive_mutex> guard(audio_session->mutex_);
if (IsSessionReady()) {
+ auto audio_config_discriminator = audio_config_2_2_.getDiscriminator();
// If session is unknown it means it should be 2.0 type
if (session_type_2_1_ != SessionType_2_1::UNKNOWN) {
- if (audio_config_2_2_ != invalidSoftwareAudioConfiguration)
+ if ((audio_config_discriminator ==
+ ::android::hardware::bluetooth::audio::V2_2::AudioConfiguration::
+ hidl_discriminator::pcmConfig &&
+ audio_config_2_2_ != kInvalidSoftwareAudioConfiguration) ||
+ (audio_config_discriminator ==
+ ::android::hardware::bluetooth::audio::V2_2::AudioConfiguration::
+ hidl_discriminator::leAudioConfig &&
+ audio_config_2_2_ != kInvalidLeOffloadAudioConfiguration))
return audio_config_2_2_;
::android::hardware::bluetooth::audio::V2_2::AudioConfiguration toConf;
@@ -100,7 +192,7 @@
GetAudioSession_2_1()->GetAudioConfig();
if (fromConf.getDiscriminator() ==
AudioConfiguration_2_1::hidl_discriminator::pcmConfig) {
- toConf.pcmConfig() = fromConf.pcmConfig();
+ toConf.pcmConfig(fromConf.pcmConfig());
return toConf;
}
}
@@ -110,7 +202,7 @@
// pcmConfig only differs between 2.0 and 2.1 in AudioConfiguration
if (fromConf.getDiscriminator() ==
AudioConfiguration::hidl_discriminator::codecConfig) {
- toConf.codecConfig() = fromConf.codecConfig();
+ toConf.codecConfig(fromConf.codecConfig());
} else {
toConf.pcmConfig() = {
.sampleRate = static_cast<
@@ -122,13 +214,61 @@
}
return toConf;
} else if (session_type_2_1_ ==
- SessionType_2_1::A2DP_HARDWARE_OFFLOAD_DATAPATH) {
- return kInvalidOffloadAudioConfiguration;
+ SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH ||
+ session_type_2_1_ ==
+ SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH) {
+ return kInvalidLeOffloadAudioConfiguration;
} else {
return kInvalidSoftwareAudioConfiguration;
}
}
+// Those control functions are for the bluetooth_audio module to start, suspend,
+// stop stream, to check position, and to update metadata.
+bool BluetoothAudioSession_2_2::StartStream() {
+ std::lock_guard<std::recursive_mutex> guard(audio_session->mutex_);
+ if (!IsSessionReady()) {
+ LOG(DEBUG) << __func__ << " - SessionType=" << toString(session_type_2_1_)
+ << " has NO session";
+ return false;
+ }
+ auto hal_retval = audio_session->stack_iface_->startStream();
+ if (!hal_retval.isOk()) {
+ LOG(WARNING) << __func__ << " - IBluetoothAudioPort SessionType="
+ << toString(session_type_2_1_) << " failed";
+ return false;
+ }
+ return true;
+}
+
+bool BluetoothAudioSession_2_2::SuspendStream() {
+ std::lock_guard<std::recursive_mutex> guard(audio_session->mutex_);
+ if (!IsSessionReady()) {
+ LOG(DEBUG) << __func__ << " - SessionType=" << toString(session_type_2_1_)
+ << " has NO session";
+ return false;
+ }
+ auto hal_retval = audio_session->stack_iface_->suspendStream();
+ if (!hal_retval.isOk()) {
+ LOG(WARNING) << __func__ << " - IBluetoothAudioPort SessionType="
+ << toString(session_type_2_1_) << " failed";
+ return false;
+ }
+ return true;
+}
+
+void BluetoothAudioSession_2_2::StopStream() {
+ std::lock_guard<std::recursive_mutex> guard(audio_session->mutex_);
+ if (!IsSessionReady()) {
+ return;
+ }
+ auto hal_retval = audio_session->stack_iface_->stopStream();
+ if (!hal_retval.isOk()) {
+ LOG(WARNING) << __func__ << " - IBluetoothAudioPort SessionType="
+ << toString(session_type_2_1_) << " failed";
+ }
+}
+
bool BluetoothAudioSession_2_2::UpdateAudioConfig(
const ::android::hardware::bluetooth::audio::V2_2::AudioConfiguration&
audio_config) {
@@ -209,8 +349,11 @@
LOG(ERROR) << __func__ << " - SessionType=" << toString(session_type_2_1_)
<< " DataMQ Invalid";
audio_config_2_2_ =
- (session_type_2_1_ == SessionType_2_1::A2DP_HARDWARE_OFFLOAD_DATAPATH
- ? kInvalidOffloadAudioConfiguration
+ ((session_type_2_1_ ==
+ SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH ||
+ session_type_2_1_ ==
+ SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH)
+ ? kInvalidLeOffloadAudioConfiguration
: kInvalidSoftwareAudioConfiguration);
} else {
audio_session->stack_iface_ = stack_iface;
@@ -221,6 +364,32 @@
}
}
+// The report function is used to report that the Bluetooth stack has ended the
+// session, and will invoke session_changed_cb_ to notify registered
+// bluetooth_audio outputs
+void BluetoothAudioSession_2_2::OnSessionEnded() {
+ std::lock_guard<std::recursive_mutex> guard(audio_session->mutex_);
+ bool toggled = IsSessionReady();
+ LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_2_1_);
+ if (session_type_2_1_ == SessionType_2_1::UNKNOWN) {
+ audio_session->OnSessionEnded();
+ return;
+ }
+
+ audio_config_2_2_ =
+ ((session_type_2_1_ ==
+ SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH ||
+ session_type_2_1_ ==
+ SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH)
+ ? kInvalidLeOffloadAudioConfiguration
+ : kInvalidSoftwareAudioConfiguration);
+ audio_session->stack_iface_ = nullptr;
+ audio_session->UpdateDataPath(nullptr);
+ if (toggled) {
+ audio_session->ReportSessionStatus();
+ }
+}
+
std::unique_ptr<BluetoothAudioSessionInstance_2_2>
BluetoothAudioSessionInstance_2_2::instance_ptr =
std::unique_ptr<BluetoothAudioSessionInstance_2_2>(
diff --git a/bluetooth/audio/utils/session/BluetoothAudioSession_2_2.h b/bluetooth/audio/utils/session/BluetoothAudioSession_2_2.h
index 7213ede..6ac0188 100644
--- a/bluetooth/audio/utils/session/BluetoothAudioSession_2_2.h
+++ b/bluetooth/audio/utils/session/BluetoothAudioSession_2_2.h
@@ -47,6 +47,8 @@
invalidSoftwareAudioConfiguration;
static ::android::hardware::bluetooth::audio::V2_2::AudioConfiguration
invalidOffloadAudioConfiguration;
+ static ::android::hardware::bluetooth::audio::V2_2::AudioConfiguration
+ invalidLeOffloadAudioConfiguration;
public:
BluetoothAudioSession_2_2(
@@ -69,17 +71,33 @@
const ::android::hardware::bluetooth::audio::V2_2::AudioConfiguration&
audio_config);
+ // The report function is used to report that the Bluetooth stack has ended
+ // the session, and will invoke session_changed_cb_ to notify registered
+ // bluetooth_audio outputs
+ void OnSessionEnded();
+
+ // Those control functions are for the bluetooth_audio module to start,
+ // suspend, stop stream, to check position, and to update metadata.
+ bool StartStream();
+ bool SuspendStream();
+ void StopStream();
+
// The control function is for the bluetooth_audio module to get the current
// AudioConfiguration
const ::android::hardware::bluetooth::audio::V2_2::AudioConfiguration
GetAudioConfig();
+ void UpdateSinkMetadata(const struct sink_metadata* sink_metadata);
+
static constexpr ::android::hardware::bluetooth::audio::V2_2::
AudioConfiguration& kInvalidSoftwareAudioConfiguration =
invalidSoftwareAudioConfiguration;
static constexpr ::android::hardware::bluetooth::audio::V2_2::
AudioConfiguration& kInvalidOffloadAudioConfiguration =
invalidOffloadAudioConfiguration;
+ static constexpr ::android::hardware::bluetooth::audio::V2_2::
+ AudioConfiguration& kInvalidLeOffloadAudioConfiguration =
+ invalidLeOffloadAudioConfiguration;
};
class BluetoothAudioSessionInstance_2_2 {
diff --git a/bluetooth/audio/utils/session/BluetoothAudioSupportedCodecsDB_2_2.cpp b/bluetooth/audio/utils/session/BluetoothAudioSupportedCodecsDB_2_2.cpp
index 5becdaa..34cfd7e 100644
--- a/bluetooth/audio/utils/session/BluetoothAudioSupportedCodecsDB_2_2.cpp
+++ b/bluetooth/audio/utils/session/BluetoothAudioSupportedCodecsDB_2_2.cpp
@@ -24,9 +24,59 @@
namespace bluetooth {
namespace audio {
+using ::android::hardware::bluetooth::audio::V2_0::BitsPerSample;
+using ::android::hardware::bluetooth::audio::V2_1::CodecType;
+using ::android::hardware::bluetooth::audio::V2_1::Lc3FrameDuration;
+using ::android::hardware::bluetooth::audio::V2_1::Lc3Parameters;
+using ::android::hardware::bluetooth::audio::V2_1::SampleRate;
+using ::android::hardware::bluetooth::audio::V2_2::AudioLocation;
+using ::android::hardware::bluetooth::audio::V2_2::LeAudioCodecCapabilitiesPair;
+using ::android::hardware::bluetooth::audio::V2_2::LeAudioCodecCapability;
+using ::android::hardware::bluetooth::audio::V2_2::LeAudioMode;
using SessionType_2_1 =
::android::hardware::bluetooth::audio::V2_1::SessionType;
+// Stores the list of offload supported capability
+std::vector<LeAudioCodecCapabilitiesPair> kDefaultOffloadLeAudioCapabilities;
+
+static const LeAudioCodecCapability kInvalidLc3Capability = {
+ .codecType = CodecType::UNKNOWN};
+
+// Default Supported Codecs
+// LC3 16_1: sample rate: 16 kHz, frame duration: 7.5 ms, octets per frame: 30
+static const Lc3Parameters kLc3Capability_16_1 = {
+ .samplingFrequency = SampleRate::RATE_16000,
+ .frameDuration = Lc3FrameDuration::DURATION_7500US,
+ .octetsPerFrame = 30};
+
+// Default Supported Codecs
+// LC3 16_2: sample rate: 16 kHz, frame duration: 10 ms, octets per frame: 40
+static const Lc3Parameters kLc3Capability_16_2 = {
+ .samplingFrequency = SampleRate::RATE_16000,
+ .frameDuration = Lc3FrameDuration::DURATION_10000US,
+ .octetsPerFrame = 40};
+
+// Default Supported Codecs
+// LC3 48_4: sample rate: 48 kHz, frame duration: 10 ms, octets per frame: 120
+static const Lc3Parameters kLc3Capability_48_4 = {
+ .samplingFrequency = SampleRate::RATE_48000,
+ .frameDuration = Lc3FrameDuration::DURATION_10000US,
+ .octetsPerFrame = 120};
+
+static const std::vector<Lc3Parameters> supportedLc3CapabilityList = {
+ kLc3Capability_48_4, kLc3Capability_16_2, kLc3Capability_16_1};
+
+static AudioLocation stereoAudio = static_cast<AudioLocation>(
+ AudioLocation::FRONT_LEFT | AudioLocation::FRONT_RIGHT);
+static AudioLocation monoAudio = AudioLocation::UNKNOWN;
+
+// Stores the supported setting of audio location, connected device, and the
+// channel count for each device
+std::vector<std::tuple<AudioLocation, uint8_t, uint8_t>>
+ supportedDeviceSetting = {std::make_tuple(stereoAudio, 2, 1),
+ std::make_tuple(monoAudio, 1, 2),
+ std::make_tuple(monoAudio, 1, 1)};
+
bool IsOffloadLeAudioConfigurationValid(
const ::android::hardware::bluetooth::audio::V2_1::SessionType&
session_type,
@@ -44,6 +94,60 @@
return true;
}
+LeAudioCodecCapability composeLc3Capability(AudioLocation audioLocation,
+ uint8_t deviceCnt,
+ uint8_t channelCount,
+ Lc3Parameters capability) {
+ return LeAudioCodecCapability{.codecType = CodecType::LC3,
+ .supportedChannel = audioLocation,
+ .deviceCount = deviceCnt,
+ .channelCountPerDevice = channelCount,
+ .capabilities = capability};
+}
+
+std::vector<LeAudioCodecCapabilitiesPair> GetLeAudioOffloadCodecCapabilities(
+ const SessionType_2_1& session_type) {
+ if (session_type !=
+ SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH &&
+ session_type !=
+ SessionType_2_1::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH) {
+ return std::vector<LeAudioCodecCapabilitiesPair>(0);
+ }
+
+ if (kDefaultOffloadLeAudioCapabilities.empty()) {
+ for (auto [audioLocation, deviceCnt, channelCount] :
+ supportedDeviceSetting) {
+ for (auto capability : supportedLc3CapabilityList) {
+ LeAudioCodecCapability lc3Capability = composeLc3Capability(
+ audioLocation, deviceCnt, channelCount, capability);
+ LeAudioCodecCapability lc3MonoCapability =
+ composeLc3Capability(monoAudio, 1, 1, capability);
+
+ // Adds the capability for encode only
+ kDefaultOffloadLeAudioCapabilities.push_back(
+ {.mode = LeAudioMode::UNICAST,
+ .encodeCapability = lc3Capability,
+ .decodeCapability = kInvalidLc3Capability});
+
+ // Adds the capability for decode only
+ kDefaultOffloadLeAudioCapabilities.push_back(
+ {.mode = LeAudioMode::UNICAST,
+ .encodeCapability = kInvalidLc3Capability,
+ .decodeCapability = lc3Capability});
+
+ // Adds the capability for the case that encode and decode exist at the
+ // same time
+ kDefaultOffloadLeAudioCapabilities.push_back(
+ {.mode = LeAudioMode::UNICAST,
+ .encodeCapability = lc3Capability,
+ .decodeCapability = lc3MonoCapability});
+ }
+ }
+ }
+
+ return kDefaultOffloadLeAudioCapabilities;
+}
+
} // namespace audio
} // namespace bluetooth
} // namespace android
diff --git a/bluetooth/audio/utils/session/BluetoothAudioSupportedCodecsDB_2_2.h b/bluetooth/audio/utils/session/BluetoothAudioSupportedCodecsDB_2_2.h
index 59d22b7..89da6a3 100644
--- a/bluetooth/audio/utils/session/BluetoothAudioSupportedCodecsDB_2_2.h
+++ b/bluetooth/audio/utils/session/BluetoothAudioSupportedCodecsDB_2_2.h
@@ -19,6 +19,7 @@
#include <android/hardware/bluetooth/audio/2.2/types.h>
#include "BluetoothAudioSupportedCodecsDB.h"
+#include "BluetoothAudioSupportedCodecsDB_2_1.h"
namespace android {
namespace bluetooth {
@@ -29,6 +30,11 @@
session_type,
const ::android::hardware::bluetooth::audio::V2_2::LeAudioConfiguration&
le_audio_codec_config);
+
+std::vector<hardware::bluetooth::audio::V2_2::LeAudioCodecCapabilitiesPair>
+GetLeAudioOffloadCodecCapabilities(
+ const ::android::hardware::bluetooth::audio::V2_1::SessionType&
+ session_type);
} // namespace audio
} // namespace bluetooth
} // namespace android
diff --git a/camera/device/3.8/ICameraDevice.hal b/camera/device/3.8/ICameraDevice.hal
index 448f176..1101819 100644
--- a/camera/device/3.8/ICameraDevice.hal
+++ b/camera/device/3.8/ICameraDevice.hal
@@ -16,6 +16,7 @@
package android.hardware.camera.device@3.8;
+import android.hardware.camera.common@1.0::Status;
import @3.7::ICameraDevice;
/**
@@ -29,4 +30,81 @@
* @3.7::ICameraDeviceSession.
*/
interface ICameraDevice extends @3.7::ICameraDevice {
+ /**
+ * turnOnTorchWithStrengthLevel:
+ *
+ * Change the brightness level of the flash unit associated with this camera device
+ * and set it to value in torchStrength. This function also turns ON the torch
+ * with specified torchStrength if the torch is OFF.
+ *
+ * The torchStrength value must be within the valid range i.e. >=1 and
+ * <= FLASH_INFO_STRENGTH_MAXIMUM_LEVEL. Whenever the torch is turned OFF,
+ * the brightness level will reset to FLASH_INFO_STRENGTH_DEFAULT_LEVEL.
+ * When the client calls setTorchMode(ON) after turnOnTorchWithStrengthLevel(N),
+ * the flash unit will have brightness level equal to N. This level does not
+ * represent the real brightness units. It is linear in nature i.e. flashlight
+ * at level 10 is twice as bright as at level 5.
+ *
+ * @param torchStrength Brightness level to be set for the flashlight.
+ *
+ * @return status Status code for the operation, one of:
+ * OK:
+ * On a successful change to the torch strength level.
+ * INTERNAL_ERROR:
+ * The flash unit cannot be operated due to an unexpected internal
+ * error.
+ * CAMERA_IN_USE:
+ * This status code is returned when:
+ * - This camera device has been opened, so the torch cannot be
+ * controlled until it is closed.
+ * - Due to other camera devices being open, or due to other
+ * resource constraints, the torch cannot be controlled currently.
+ * ILLEGAL_ARGUMENT:
+ * If the torchStrength value is not within the range i.e. < 1 or
+ * > FLASH_INFO_STRENGTH_MAXIMUM_LEVEL.
+ * METHOD_NOT_SUPPORTED:
+ * This status code is returned when:
+ * - This camera device does not support direct operation of flashlight
+ * torch mode. The framework must open the camera device and turn
+ * the torch on through the device interface.
+ * - This camera device does not have a flash unit.
+ * - This camera device has flash unit but does not support torch
+ * strength control.
+ * CAMERA_DISCONNECTED:
+ * An external camera device has been disconnected, and is no longer
+ * available. This camera device interface is now stale, and a new
+ * instance must be acquired if the device is reconnected. All
+ * subsequent calls on this interface must return
+ * CAMERA_DISCONNECTED.
+ *
+ */
+ turnOnTorchWithStrengthLevel(int32_t torchStrength) generates (Status status);
+
+ /**
+ * getTorchStrengthLevel:
+ *
+ * Get current torch strength level.
+ * If the device supports torch strength control, when the torch is OFF the
+ * strength level will reset to default level, so the return
+ * value in this case will be equal to FLASH_INFO_STRENGTH_DEFAULT_LEVEL.
+ *
+ * @return status Status code for the operation, one of:
+ * OK:
+ * On success.
+ * INTERNAL_ERROR:
+ * An unexpected error occurred and the information is not
+ * available.
+ * METHOD_NOT_SUPPORTED:
+ * This status code is returned when:
+ * - This camera device does not support direct operation of flashlight
+ * torch mode. The framework must open the camera device and turn
+ * the torch on through the device interface.
+ * - This camera device does not have a flash unit.
+ * - This camera device has flash unit but does not support torch
+ * strength control.
+ *
+ * @return torchStrength Current torch strength level.
+ *
+ */
+ getTorchStrengthLevel() generates (Status status, int32_t torchStrength);
};
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
index 36b3d72..d39850d 100644
--- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
+++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
@@ -41,6 +41,7 @@
#include <android/hardware/camera/device/3.6/ICameraDevice.h>
#include <android/hardware/camera/device/3.6/ICameraDeviceSession.h>
#include <android/hardware/camera/device/3.7/ICameraDevice.h>
+#include <android/hardware/camera/device/3.8/ICameraDevice.h>
#include <android/hardware/camera/device/3.7/ICameraDeviceSession.h>
#include <android/hardware/camera/device/3.7/ICameraInjectionSession.h>
#include <android/hardware/camera/device/3.8/ICameraDeviceCallback.h>
@@ -911,6 +912,7 @@
uint32_t* outBufSize);
static Status isConstrainedModeAvailable(camera_metadata_t *staticMeta);
static Status isLogicalMultiCamera(const camera_metadata_t *staticMeta);
+ static bool isTorchStrengthControlSupported(const camera_metadata_t *staticMeta);
static Status isOfflineSessionSupported(const camera_metadata_t *staticMeta);
static Status getPhysicalCameraIds(const camera_metadata_t *staticMeta,
std::unordered_set<std::string> *physicalIds/*out*/);
@@ -2957,6 +2959,137 @@
}
}
+// Verify that the torch strength level can be set and retrieved successfully.
+TEST_P(CameraHidlTest, turnOnTorchWithStrengthLevel) {
+ hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+ bool torchControlSupported = false;
+ bool torchStrengthControlSupported = false;
+ Return<void> ret;
+
+ ret = mProvider->isSetTorchModeSupported([&](auto status, bool support) {
+ ALOGI("isSetTorchModeSupported returns status:%d supported:%d", (int)status, support);
+ ASSERT_EQ(Status::OK, status);
+ torchControlSupported = support;
+ });
+
+ sp<TorchProviderCb> cb = new TorchProviderCb(this);
+ Return<Status> returnStatus = mProvider->setCallback(cb);
+ ASSERT_TRUE(returnStatus.isOk());
+ ASSERT_EQ(Status::OK, returnStatus);
+
+ for (const auto& name : cameraDeviceNames) {
+ int deviceVersion = getCameraDeviceVersion(name, mProviderType);
+ int32_t defaultLevel;
+ switch (deviceVersion) {
+ case CAMERA_DEVICE_API_VERSION_3_8: {
+ ::android::sp<::android::hardware::camera::device::V3_8::ICameraDevice> device3_8;
+ ALOGI("%s: Testing camera device %s", __FUNCTION__, name.c_str());
+ ret = mProvider->getCameraDeviceInterface_V3_x(
+ name, [&](auto status, const auto& device) {
+ ASSERT_EQ(Status::OK, status);
+ ASSERT_NE(device, nullptr);
+ auto castResult = device::V3_8::ICameraDevice::castFrom(device);
+ ASSERT_TRUE(castResult.isOk());
+ device3_8 = castResult;
+ });
+ ASSERT_TRUE(ret.isOk());
+
+ ret = device3_8->getCameraCharacteristics([&] (auto s, const auto& chars) {
+ ASSERT_EQ(Status::OK, s);
+ const camera_metadata_t* staticMeta =
+ reinterpret_cast<const camera_metadata_t*>(chars.data());
+ ASSERT_NE(nullptr, staticMeta);
+ torchStrengthControlSupported = isTorchStrengthControlSupported(staticMeta);
+ camera_metadata_ro_entry entry;
+ int rc = find_camera_metadata_ro_entry(staticMeta,
+ ANDROID_FLASH_INFO_STRENGTH_DEFAULT_LEVEL, &entry);
+ if (torchStrengthControlSupported) {
+ ASSERT_EQ(rc, 0);
+ ASSERT_GT(entry.count, 0);
+ defaultLevel = *entry.data.i32;
+ ALOGI("Default level is:%d", defaultLevel);
+ }
+ });
+ ASSERT_TRUE(ret.isOk());
+ // If torchStrengthControl is supported, torchControlSupported should be true.
+ if (torchStrengthControlSupported) {
+ ASSERT_TRUE(torchControlSupported);
+ }
+ mTorchStatus = TorchModeStatus::NOT_AVAILABLE;
+ returnStatus = device3_8->turnOnTorchWithStrengthLevel(2);
+ ASSERT_TRUE(returnStatus.isOk());
+ // Method_not_supported check
+ if (!torchStrengthControlSupported) {
+ ALOGI("Torch strength control not supported.");
+ ASSERT_EQ(Status::METHOD_NOT_SUPPORTED, returnStatus);
+ } else {
+ ASSERT_EQ(Status::OK, returnStatus);
+ if (returnStatus == Status::OK) {
+ {
+ std::unique_lock<std::mutex> l(mTorchLock);
+ while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) {
+ auto timeout = std::chrono::system_clock::now() +
+ std::chrono::seconds(kTorchTimeoutSec);
+ ASSERT_NE(std::cv_status::timeout, mTorchCond.wait_until(l,
+ timeout));
+ }
+ ASSERT_EQ(TorchModeStatus::AVAILABLE_ON, mTorchStatus);
+ mTorchStatus = TorchModeStatus::NOT_AVAILABLE;
+ }
+ ALOGI("getTorchStrengthLevel: Testing");
+ ret = device3_8->getTorchStrengthLevel([&]
+ (auto status, const auto& strengthLevel) {
+ ASSERT_TRUE(ret.isOk());
+ ASSERT_EQ(Status::OK, status);
+ ALOGI("Torch strength level is : %d", strengthLevel);
+ ASSERT_EQ(strengthLevel, 2);
+ });
+ // Turn OFF the torch and verify torch strength level is reset to default level.
+ ALOGI("Testing torch strength level reset after turning the torch OFF.");
+ returnStatus = device3_8->setTorchMode(TorchMode::OFF);
+ ASSERT_TRUE(returnStatus.isOk());
+ ASSERT_EQ(Status::OK, returnStatus);
+ {
+ std::unique_lock<std::mutex> l(mTorchLock);
+ while (TorchModeStatus::NOT_AVAILABLE == mTorchStatus) {
+ auto timeout = std::chrono::system_clock::now() +
+ std::chrono::seconds(kTorchTimeoutSec);
+ ASSERT_NE(std::cv_status::timeout, mTorchCond.wait_until(l,
+ timeout));
+ }
+ ASSERT_EQ(TorchModeStatus::AVAILABLE_OFF, mTorchStatus);
+ }
+ ret = device3_8->getTorchStrengthLevel([&]
+ (auto status, const auto& strengthLevel) {
+ ASSERT_TRUE(ret.isOk());
+ ASSERT_EQ(Status::OK, status);
+ ALOGI("Torch strength level after turning OFF torch is : %d",
+ strengthLevel);
+ ASSERT_EQ(strengthLevel, defaultLevel);
+ });
+ }
+ }
+ }
+ break;
+ case CAMERA_DEVICE_API_VERSION_3_7:
+ case CAMERA_DEVICE_API_VERSION_3_6:
+ case CAMERA_DEVICE_API_VERSION_3_5:
+ case CAMERA_DEVICE_API_VERSION_3_4:
+ case CAMERA_DEVICE_API_VERSION_3_3:
+ case CAMERA_DEVICE_API_VERSION_3_2:
+ case CAMERA_DEVICE_API_VERSION_1_0: {
+ ALOGI("Torch strength control feature not supported.");
+ }
+ break;
+ default: {
+ ALOGI("Invalid device version.");
+ ADD_FAILURE();
+ }
+ break;
+ }
+ }
+}
+
//In case it is supported verify that torch can be enabled.
//Check for corresponding toch callbacks as well.
TEST_P(CameraHidlTest, setTorchMode) {
@@ -6814,6 +6947,22 @@
return ret;
}
+bool CameraHidlTest::isTorchStrengthControlSupported(const camera_metadata_t *staticMetadata) {
+ int32_t maxLevel = 0;
+ camera_metadata_ro_entry maxEntry;
+ int rc = find_camera_metadata_ro_entry(staticMetadata,
+ ANDROID_FLASH_INFO_STRENGTH_MAXIMUM_LEVEL, &maxEntry);
+ if (rc != 0) {
+ return false;
+ }
+ maxLevel = *maxEntry.data.i32;
+ if (maxLevel > 1) {
+ ALOGI("Torch strength control supported.");
+ return true;
+ }
+ return false;
+}
+
// Check if the camera device has logical multi-camera capability.
Status CameraHidlTest::isOfflineSessionSupported(const camera_metadata_t *staticMeta) {
Status ret = Status::METHOD_NOT_SUPPORTED;
diff --git a/compatibility_matrices/compatibility_matrix.3.xml b/compatibility_matrices/compatibility_matrix.3.xml
index a75ed25..468735d 100644
--- a/compatibility_matrices/compatibility_matrix.3.xml
+++ b/compatibility_matrices/compatibility_matrix.3.xml
@@ -207,7 +207,10 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <!-- Either the AIDL or the HIDL health HAL must exist on the device.
+ If the HIDL health HAL exists, it must be at least version 2.0.
+ See DeviceManifestTest.HealthHal -->
+ <hal format="hidl" optional="true">
<name>android.hardware.health</name>
<version>2.0</version>
<interface>
diff --git a/compatibility_matrices/compatibility_matrix.4.xml b/compatibility_matrices/compatibility_matrix.4.xml
index 3b8ee21..96f291f 100644
--- a/compatibility_matrices/compatibility_matrix.4.xml
+++ b/compatibility_matrices/compatibility_matrix.4.xml
@@ -213,7 +213,10 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <!-- Either the AIDL or the HIDL health HAL must exist on the device.
+ If the HIDL health HAL exists, it must be at least version 2.0.
+ See DeviceManifestTest.HealthHal -->
+ <hal format="hidl" optional="true">
<name>android.hardware.health</name>
<version>2.0</version>
<interface>
diff --git a/compatibility_matrices/compatibility_matrix.5.xml b/compatibility_matrices/compatibility_matrix.5.xml
index 0fb21a7..3642814 100644
--- a/compatibility_matrices/compatibility_matrix.5.xml
+++ b/compatibility_matrices/compatibility_matrix.5.xml
@@ -238,7 +238,10 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <!-- Either the AIDL or the HIDL health HAL must exist on the device.
+ If the HIDL health HAL exists, it must be at least version 2.1.
+ See DeviceManifestTest.HealthHal -->
+ <hal format="hidl" optional="true">
<name>android.hardware.health</name>
<version>2.1</version>
<interface>
diff --git a/compatibility_matrices/compatibility_matrix.6.xml b/compatibility_matrices/compatibility_matrix.6.xml
index aee2c51..9c42cb0 100644
--- a/compatibility_matrices/compatibility_matrix.6.xml
+++ b/compatibility_matrices/compatibility_matrix.6.xml
@@ -268,7 +268,10 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <!-- Either the AIDL or the HIDL health HAL must exist on the device.
+ If the HIDL health HAL exists, it must be at least version 2.1.
+ See DeviceManifestTest.HealthHal -->
+ <hal format="hidl" optional="true">
<name>android.hardware.health</name>
<version>2.1</version>
<interface>
diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml
index a781b35..c480c13 100644
--- a/compatibility_matrices/compatibility_matrix.current.xml
+++ b/compatibility_matrices/compatibility_matrix.current.xml
@@ -210,14 +210,6 @@
</interface>
</hal>
<hal format="hidl" optional="true">
- <name>android.hardware.contexthub</name>
- <version>1.2</version>
- <interface>
- <name>IContexthub</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl" optional="true">
<name>android.hardware.drm</name>
<version>1.3-4</version>
<interface>
@@ -260,6 +252,14 @@
<instance>default</instance>
</interface>
</hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.gnss.visibility_control</name>
+ <version>1</version>
+ <interface>
+ <name>IGnssVisibilityControl</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
<hal format="hidl" optional="false">
<name>android.hardware.graphics.allocator</name>
<!-- New, non-Go devices should use 4.0, tested in vts_treble_vintf_vendor_test -->
@@ -298,16 +298,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
- <name>android.hardware.health</name>
- <version>2.1</version>
- <interface>
- <name>IHealth</name>
- <instance>default</instance>
- </interface>
- </hal>
- <!-- TODO(b/177269435): require health AIDL HAL and deprecate HIDL HAL -->
- <hal format="aidl" optional="true">
+ <hal format="aidl" optional="false">
<name>android.hardware.health</name>
<version>1</version>
<interface>
@@ -332,6 +323,13 @@
</interface>
</hal>
<hal format="aidl" optional="true">
+ <name>android.hardware.net.nlinterceptor</name>
+ <interface>
+ <name>IInterceptor</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
<name>android.hardware.oemlock</name>
<version>1</version>
<interface>
@@ -339,9 +337,9 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="true">
+ <hal format="aidl" optional="true">
<name>android.hardware.ir</name>
- <version>1.0</version>
+ <version>1</version>
<interface>
<name>IConsumerIr</name>
<instance>default</instance>
@@ -373,9 +371,17 @@
</interface>
</hal>
<hal format="aidl" optional="true">
- <name>android.hardware.security.keymint</name>
+ <name>android.hardware.security.dice</name>
<version>1</version>
<interface>
+ <name>IDiceDevice</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.security.keymint</name>
+ <version>1-2</version>
+ <interface>
<name>IKeyMintDevice</name>
<instance>default</instance>
<instance>strongbox</instance>
@@ -383,6 +389,7 @@
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.security.keymint</name>
+ <version>1-2</version>
<interface>
<name>IRemotelyProvisionedComponent</name>
<instance>default</instance>
@@ -459,7 +466,7 @@
</hal>
<hal format="aidl" optional="false">
<name>android.hardware.power</name>
- <version>1-2</version>
+ <version>1-3</version>
<interface>
<name>IPower</name>
<instance>default</instance>
@@ -788,4 +795,11 @@
<instance>default</instance>
</interface>
</hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.wifi.supplicant</name>
+ <interface>
+ <name>ISupplicant</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
</compatibility-matrix>
diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappInfo.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappInfo.aidl
index ea7825a..7175d7f 100644
--- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappInfo.aidl
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappInfo.aidl
@@ -38,4 +38,5 @@
int nanoappVersion;
boolean enabled;
String[] permissions;
+ android.hardware.contexthub.NanoappRpcService[] rpcServices;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappRpcService.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappRpcService.aidl
index cfafc50..a6a1644 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/NanoappRpcService.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,9 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.contexthub;
+@VintfStability
+parcelable NanoappRpcService {
+ long id;
+ int version;
}
diff --git a/contexthub/aidl/android/hardware/contexthub/NanoappInfo.aidl b/contexthub/aidl/android/hardware/contexthub/NanoappInfo.aidl
index 9991dc8..77ac026 100644
--- a/contexthub/aidl/android/hardware/contexthub/NanoappInfo.aidl
+++ b/contexthub/aidl/android/hardware/contexthub/NanoappInfo.aidl
@@ -16,6 +16,8 @@
package android.hardware.contexthub;
+import android.hardware.contexthub.NanoappRpcService;
+
@VintfStability
parcelable NanoappInfo {
/** The unique identifier of the nanoapp. */
@@ -39,4 +41,9 @@
* this list.
*/
String[] permissions;
+
+ /**
+ * The list of RPC services supported by this nanoapp.
+ */
+ NanoappRpcService[] rpcServices;
}
diff --git a/contexthub/aidl/android/hardware/contexthub/NanoappRpcService.aidl b/contexthub/aidl/android/hardware/contexthub/NanoappRpcService.aidl
new file mode 100644
index 0000000..6dc5e95
--- /dev/null
+++ b/contexthub/aidl/android/hardware/contexthub/NanoappRpcService.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2021 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.contexthub;
+
+/**
+ * An RPC service exposed by a nanoapp.
+ *
+ * The implementation of the RPC interface is not defined by the HAL, and is written
+ * at the messaging endpoint layers (Android app and/or CHRE nanoapp). NanoappRpcService
+ * contains the informational metadata to be consumed by the RPC interface layer.
+ */
+@VintfStability
+parcelable NanoappRpcService {
+ /**
+ * The unique 64-bit ID of an RPC service exposed by a nanoapp. Note that
+ * the uniqueness is only required within the nanoapp's domain (i.e. the
+ * combination of the nanoapp ID and service id must be unique).
+ */
+ long id;
+
+ /**
+ * The software version of this service, which follows the semantic
+ * versioning scheme (see semver.org). It follows the format
+ * major.minor.patch, where major and minor versions take up one byte
+ * each, and the patch version takes up the final 2 bytes.
+ */
+ int version;
+}
diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
index 1b2dc29..392e23c 100644
--- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
+++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
@@ -41,6 +41,7 @@
using ::android::hardware::contexthub::IContextHubCallbackDefault;
using ::android::hardware::contexthub::NanoappBinary;
using ::android::hardware::contexthub::NanoappInfo;
+using ::android::hardware::contexthub::NanoappRpcService;
using ::android::hardware::contexthub::Setting;
using ::android::hardware::contexthub::vts_utils::kNonExistentAppId;
using ::android::hardware::contexthub::vts_utils::waitForCallback;
@@ -151,6 +152,14 @@
for (const NanoappInfo& appInfo : appInfoList) {
EXPECT_NE(appInfo.nanoappId, UINT64_C(0));
EXPECT_NE(appInfo.nanoappId, kNonExistentAppId);
+
+ // Verify services are unique.
+ std::set<uint64_t> existingServiceIds;
+ for (const NanoappRpcService& rpcService : appInfo.rpcServices) {
+ EXPECT_NE(rpcService.id, UINT64_C(0));
+ EXPECT_EQ(existingServiceIds.count(rpcService.id), 0);
+ existingServiceIds.insert(rpcService.id);
+ }
}
}
diff --git a/dumpstate/aidl/default/main.cpp b/dumpstate/aidl/default/main.cpp
index 2451752..5bc85b4 100644
--- a/dumpstate/aidl/default/main.cpp
+++ b/dumpstate/aidl/default/main.cpp
@@ -29,7 +29,7 @@
const std::string instance = std::string() + Dumpstate::descriptor + "/default";
binder_status_t status =
AServiceManager_registerLazyService(dumpstate->asBinder().get(), instance.c_str());
- CHECK(status == STATUS_OK);
+ CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // Unreachable
diff --git a/gnss/aidl/Android.bp b/gnss/aidl/Android.bp
index b197eae..12dd0ac 100644
--- a/gnss/aidl/Android.bp
+++ b/gnss/aidl/Android.bp
@@ -24,9 +24,27 @@
}
aidl_interface {
+ name: "android.hardware.gnss.visibility_control",
+ vendor_available: true,
+ srcs: ["android/hardware/gnss/visibility_control/*.aidl"],
+ stability: "vintf",
+ backend: {
+ java: {
+ platform_apis: true,
+ },
+ ndk: {
+ vndk: {
+ enabled: true,
+ },
+ },
+ },
+}
+
+aidl_interface {
name: "android.hardware.gnss",
vendor_available: true,
srcs: ["android/hardware/gnss/*.aidl"],
+ imports: ["android.hardware.gnss.visibility_control"],
stability: "vintf",
backend: {
java: {
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl
similarity index 81%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
copy to gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl
index 41a1afe..7ef08d2 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,10 +31,9 @@
// 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.graphics.composer3;
+package android.hardware.gnss.visibility_control;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+interface IGnssVisibilityControl {
+ void enableNfwLocationAccess(in String[] proxyApps);
+ void setCallback(in android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback callback);
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl
new file mode 100644
index 0000000..37e1886
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss.visibility_control/current/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2021 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.gnss.visibility_control;
+@VintfStability
+interface IGnssVisibilityControlCallback {
+ void nfwNotifyCb(in android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.NfwNotification notification);
+ boolean isInEmergencySession();
+ @Backing(type="int") @VintfStability
+ enum NfwProtocolStack {
+ CTRL_PLANE = 0,
+ SUPL = 1,
+ IMS = 10,
+ SIM = 11,
+ OTHER_PROTOCOL_STACK = 100,
+ }
+ @Backing(type="int") @VintfStability
+ enum NfwRequestor {
+ CARRIER = 0,
+ OEM = 10,
+ MODEM_CHIPSET_VENDOR = 11,
+ GNSS_CHIPSET_VENDOR = 12,
+ OTHER_CHIPSET_VENDOR = 13,
+ AUTOMOBILE_CLIENT = 20,
+ OTHER_REQUESTOR = 100,
+ }
+ @Backing(type="int") @VintfStability
+ enum NfwResponseType {
+ REJECTED = 0,
+ ACCEPTED_NO_LOCATION_PROVIDED = 1,
+ ACCEPTED_LOCATION_PROVIDED = 2,
+ }
+ @VintfStability
+ parcelable NfwNotification {
+ String proxyAppPackageName;
+ android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.NfwProtocolStack protocolStack;
+ String otherProtocolStackName;
+ android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.NfwRequestor requestor;
+ String requestorId;
+ android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback.NfwResponseType responseType;
+ boolean inEmergencyMode;
+ boolean isCachedLocation;
+ }
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl
index ea98030..3477380 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl
@@ -44,6 +44,8 @@
@nullable android.hardware.gnss.IGnssGeofence getExtensionGnssGeofence();
@nullable android.hardware.gnss.IGnssNavigationMessageInterface getExtensionGnssNavigationMessage();
android.hardware.gnss.IAGnss getExtensionAGnss();
+ android.hardware.gnss.IGnssDebug getExtensionGnssDebug();
+ android.hardware.gnss.visibility_control.IGnssVisibilityControl getExtensionGnssVisibilityControl();
const int ERROR_INVALID_ARGUMENT = 1;
const int ERROR_ALREADY_INIT = 2;
const int ERROR_GENERIC = 3;
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl
new file mode 100644
index 0000000..27d9887
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssDebug.aidl
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2021 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.gnss;
+@VintfStability
+interface IGnssDebug {
+ android.hardware.gnss.IGnssDebug.DebugData getDebugData();
+ @Backing(type="int") @VintfStability
+ enum SatelliteEphemerisType {
+ EPHEMERIS = 0,
+ ALMANAC_ONLY = 1,
+ NOT_AVAILABLE = 2,
+ }
+ @Backing(type="int") @VintfStability
+ enum SatelliteEphemerisSource {
+ DEMODULATED = 0,
+ SUPL_PROVIDED = 1,
+ OTHER_SERVER_PROVIDED = 2,
+ OTHER = 3,
+ }
+ @Backing(type="int") @VintfStability
+ enum SatelliteEphemerisHealth {
+ GOOD = 0,
+ BAD = 1,
+ UNKNOWN = 2,
+ }
+ @VintfStability
+ parcelable TimeDebug {
+ long timeEstimateMs;
+ float timeUncertaintyNs;
+ float frequencyUncertaintyNsPerSec;
+ }
+ @VintfStability
+ parcelable PositionDebug {
+ boolean valid;
+ double latitudeDegrees;
+ double longitudeDegrees;
+ float altitudeMeters;
+ float speedMetersPerSec;
+ float bearingDegrees;
+ double horizontalAccuracyMeters;
+ double verticalAccuracyMeters;
+ double speedAccuracyMetersPerSecond;
+ double bearingAccuracyDegrees;
+ float ageSeconds;
+ }
+ @VintfStability
+ parcelable SatelliteData {
+ int svid;
+ android.hardware.gnss.GnssConstellationType constellation;
+ android.hardware.gnss.IGnssDebug.SatelliteEphemerisType ephemerisType;
+ android.hardware.gnss.IGnssDebug.SatelliteEphemerisSource ephemerisSource;
+ android.hardware.gnss.IGnssDebug.SatelliteEphemerisHealth ephemerisHealth;
+ float ephemerisAgeSeconds;
+ boolean serverPredictionIsAvailable;
+ float serverPredictionAgeSeconds;
+ }
+ @VintfStability
+ parcelable DebugData {
+ android.hardware.gnss.IGnssDebug.PositionDebug position;
+ android.hardware.gnss.IGnssDebug.TimeDebug time;
+ List<android.hardware.gnss.IGnssDebug.SatelliteData> satelliteDataArray;
+ }
+}
diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl
index 91403ca..1351f59 100644
--- a/gnss/aidl/android/hardware/gnss/IGnss.aidl
+++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl
@@ -20,11 +20,13 @@
import android.hardware.gnss.IGnssBatching;
import android.hardware.gnss.IGnssCallback;
import android.hardware.gnss.IGnssConfiguration;
+import android.hardware.gnss.IGnssDebug;
import android.hardware.gnss.IGnssGeofence;
import android.hardware.gnss.IGnssMeasurementInterface;
import android.hardware.gnss.IGnssNavigationMessageInterface;
import android.hardware.gnss.IGnssPowerIndication;
import android.hardware.gnss.IGnssPsds;
+import android.hardware.gnss.visibility_control.IGnssVisibilityControl;
/**
* Represents the standard GNSS (Global Navigation Satellite System) interface.
@@ -134,4 +136,20 @@
* @return The IAGnss interface.
*/
IAGnss getExtensionAGnss();
+
+ /**
+ * This method returns the IGnssDebug interface.
+ *
+ * This method must return non-null.
+ *
+ * @return Handle to the IGnssDebug interface.
+ */
+ IGnssDebug getExtensionGnssDebug();
+
+ /**
+ * This method returns the IGnssVisibilityControl.
+ *
+ * @return Handle to the IGnssVisibilityControl.
+ */
+ IGnssVisibilityControl getExtensionGnssVisibilityControl();
}
diff --git a/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl b/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl
new file mode 100644
index 0000000..475a4a3
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/IGnssDebug.aidl
@@ -0,0 +1,208 @@
+/*
+ * Copyright (C) 2021 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.gnss;
+
+import android.hardware.gnss.GnssConstellationType;
+
+/**
+ * Extended interface for GNSS Debug support
+ *
+ * This information is used for debugging purpose, e.g., shown in a bugreport to
+ * describe the chipset states including time, position, and satellite data.
+ */
+@VintfStability
+interface IGnssDebug {
+ /** Satellite's ephemeris type */
+ @VintfStability
+ @Backing(type="int")
+ enum SatelliteEphemerisType {
+ EPHEMERIS = 0,
+ ALMANAC_ONLY = 1,
+ NOT_AVAILABLE = 2,
+ }
+
+ /** Satellite's ephemeris source */
+ @VintfStability
+ @Backing(type="int")
+ enum SatelliteEphemerisSource {
+ DEMODULATED = 0,
+ SUPL_PROVIDED = 1,
+ OTHER_SERVER_PROVIDED = 2,
+ OTHER = 3,
+ }
+
+ /** Satellite's ephemeris health */
+ @VintfStability
+ @Backing(type="int")
+ enum SatelliteEphemerisHealth {
+ GOOD = 0,
+ BAD = 1,
+ UNKNOWN = 2,
+ }
+
+ /**
+ * Provides the current best known UTC time estimate.
+ * If no fresh information is available, e.g. after a delete all,
+ * then whatever the effective defaults are on the device must be
+ * provided (e.g. Jan. 1, 2017, with an uncertainty of 5 years) expressed
+ * in the specified units.
+ */
+ @VintfStability
+ parcelable TimeDebug {
+ /** UTC time estimate in milliseconds. */
+ long timeEstimateMs;
+
+ /** 68% time error estimate in nanoseconds. */
+ float timeUncertaintyNs;
+
+ /**
+ * 68% error estimate in local clock drift,
+ * in nanoseconds per second (also known as parts per billion - ppb.)
+ */
+ float frequencyUncertaintyNsPerSec;
+ }
+
+ @VintfStability
+ parcelable PositionDebug {
+ /**
+ * Validity of the data in this struct. False only if no
+ * latitude/longitude information is known.
+ */
+ boolean valid;
+
+ /** Latitude expressed in degrees */
+ double latitudeDegrees;
+
+ /** Longitude expressed in degrees */
+ double longitudeDegrees;
+
+ /** Altitude above ellipsoid expressed in meters */
+ float altitudeMeters;
+
+ /** Represents horizontal speed in meters per second. */
+ float speedMetersPerSec;
+
+ /** Represents heading in degrees. */
+ float bearingDegrees;
+
+ /**
+ * Estimated horizontal accuracy of position expressed in meters,
+ * radial, 68% confidence.
+ */
+ double horizontalAccuracyMeters;
+
+ /**
+ * Estimated vertical accuracy of position expressed in meters, with
+ * 68% confidence.
+ */
+ double verticalAccuracyMeters;
+
+ /**
+ * Estimated speed accuracy in meters per second with 68% confidence.
+ */
+ double speedAccuracyMetersPerSecond;
+
+ /**
+ * Estimated bearing accuracy degrees with 68% confidence.
+ */
+ double bearingAccuracyDegrees;
+
+ /**
+ * Time duration before this report that this position information was
+ * valid. This can, for example, be a previous injected location with
+ * an age potentially thousands of seconds old, or
+ * extrapolated to the current time (with appropriately increased
+ * accuracy estimates), with a (near) zero age.
+ */
+ float ageSeconds;
+ }
+
+ @VintfStability
+ parcelable SatelliteData {
+ /** Satellite vehicle ID number */
+ int svid;
+
+ /** Defines the constellation type of the given SV. */
+ GnssConstellationType constellation;
+
+ /**
+ * Defines the standard broadcast ephemeris or almanac availability for
+ * the satellite. To report status of predicted orbit and clock
+ * information, see the serverPrediction fields below.
+ */
+ SatelliteEphemerisType ephemerisType;
+
+ /** Defines the ephemeris source of the satellite. */
+ SatelliteEphemerisSource ephemerisSource;
+
+ /**
+ * Defines whether the satellite is known healthy
+ * (safe for use in location calculation.)
+ */
+ SatelliteEphemerisHealth ephemerisHealth;
+
+ /**
+ * Time duration from this report (current time), minus the
+ * effective time of the ephemeris source (e.g. TOE, TOA.)
+ * Set to 0 when ephemerisType is NOT_AVAILABLE.
+ */
+ float ephemerisAgeSeconds;
+
+ /**
+ * True if a server has provided a predicted orbit and clock model for
+ * this satellite.
+ */
+ boolean serverPredictionIsAvailable;
+
+ /**
+ * Time duration from this report (current time) minus the time of the
+ * start of the server predicted information. For example, a 1 day
+ * old prediction would be reported as 86400 seconds here.
+ */
+ float serverPredictionAgeSeconds;
+ }
+
+ /**
+ * Provides a set of debug information that is filled by the GNSS chipset
+ * when the method getDebugData() is invoked.
+ */
+ @VintfStability
+ parcelable DebugData {
+ /** Current best known position. */
+ PositionDebug position;
+
+ /** Current best know time estimate */
+ TimeDebug time;
+
+ /**
+ * Provides a list of the available satellite data, for all
+ * satellites and constellations the device can track,
+ * including GnssConstellationType UNKNOWN.
+ */
+ List<SatelliteData> satelliteDataArray;
+ }
+
+ /**
+ * This methods requests position, time and satellite ephemeris debug information
+ * from the HAL.
+ *
+ * @return ret debugData information from GNSS Hal that contains the current best
+ * known position, best known time estimate and a complete list of
+ * constellations that the device can track.
+ */
+ DebugData getDebugData();
+}
diff --git a/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl b/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl
new file mode 100644
index 0000000..93c3f2c
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControl.aidl
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2021 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.gnss.visibility_control;
+
+import android.hardware.gnss.visibility_control.IGnssVisibilityControlCallback;
+
+/**
+ * Represents the GNSS location reporting permissions and notification interface.
+ *
+ * This interface is used to tell the GNSS HAL implementation whether the framework user has
+ * granted permission to the GNSS HAL implementation to provide GNSS location information for
+ * non-framework (NFW), non-user initiated emergency use cases, and to notify the framework user
+ * of these GNSS location information deliveries.
+ *
+ * For user initiated emergency cases (and for the configured extended emergency session duration),
+ * the GNSS HAL implementation must serve the emergency location supporting network initiated
+ * location requests immediately irrespective of this permission settings.
+ *
+ * There is no separate need for the GNSS HAL implementation to monitor the global device location
+ * on/off setting. Permission to use GNSS for non-framework use cases is expressly controlled
+ * by the method enableNfwLocationAccess(). The framework monitors the location permission settings
+ * of the configured proxy applications(s), and device location settings, and calls the method
+ * enableNfwLocationAccess() whenever the user control proxy applications have, or do not have,
+ * location permission. The proxy applications are used to provide user visibility and control of
+ * location access by the non-framework on/off device entities they are representing.
+ *
+ * For device user visibility, the GNSS HAL implementation must call the method
+ * IGnssVisibilityControlCallback.nfwNotifyCb() whenever location request is rejected or
+ * location information is provided to non-framework entities (on or off device). This includes
+ * the network initiated location requests for user-initiated emergency use cases as well.
+ *
+ * The HAL implementations that support this interface must not report GNSS location, measurement,
+ * status, or other information that can be used to derive user location to any entity when not
+ * expressly authorized by this HAL. This includes all endpoints for location information
+ * off the device, including carriers, vendors, OEM and others directly or indirectly.
+ */
+@VintfStability
+interface IGnssVisibilityControl {
+ /**
+ * Enables/disables non-framework entity location access permission in the GNSS HAL.
+ *
+ * The framework will call this method to update GNSS HAL implementation every time the
+ * framework user, through the given proxy application(s) and/or device location settings,
+ * explicitly grants/revokes the location access permission for non-framework, non-user
+ * initiated emergency use cases.
+ *
+ * Whenever the user location information is delivered to non-framework entities, the HAL
+ * implementation must call the method IGnssVisibilityControlCallback.nfwNotifyCb() to notify
+ * the framework for user visibility.
+ *
+ * @param proxyApps Full list of package names of proxy Android applications representing
+ * the non-framework location access entities (on/off the device) for which the framework
+ * user has granted non-framework location access permission. The GNSS HAL implementation
+ * must provide location information only to non-framework entities represented by these
+ * proxy applications.
+ *
+ * The package name of the proxy Android application follows the standard Java language
+ * package naming format. For example, com.example.myapp.
+ */
+ void enableNfwLocationAccess(in String[] proxyApps);
+
+ /**
+ * Registers the callback for HAL implementation to use.
+ *
+ * @param callback Handle to IGnssVisibilityControlCallback interface.
+ */
+ void setCallback(in IGnssVisibilityControlCallback callback);
+}
diff --git a/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl b/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl
new file mode 100644
index 0000000..051fbe6
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/visibility_control/IGnssVisibilityControlCallback.aidl
@@ -0,0 +1,176 @@
+/*
+ * Copyright (C) 2021 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.gnss.visibility_control;
+
+/**
+ * GNSS location reporting permissions and notification callback interface.
+ */
+@VintfStability
+interface IGnssVisibilityControlCallback {
+ /**
+ * Protocol stack that is requesting the non-framework location information.
+ */
+ @VintfStability
+ @Backing(type="int")
+ enum NfwProtocolStack {
+ /** Cellular control plane requests */
+ CTRL_PLANE = 0,
+
+ /** All types of SUPL requests */
+ SUPL = 1,
+
+ /** All types of requests from IMS */
+ IMS = 10,
+
+ /** All types of requests from SIM */
+ SIM = 11,
+
+ /** Requests from other protocol stacks */
+ OTHER_PROTOCOL_STACK = 100
+ }
+
+ /**
+ * Entity that is requesting/receiving the location information.
+ */
+ @VintfStability
+ @Backing(type="int")
+ enum NfwRequestor {
+ /** Wireless service provider */
+ CARRIER = 0,
+
+ /** Device manufacturer */
+ OEM = 10,
+
+ /** Modem chipset vendor */
+ MODEM_CHIPSET_VENDOR = 11,
+
+ /** GNSS chipset vendor */
+ GNSS_CHIPSET_VENDOR = 12,
+
+ /** Other chipset vendor */
+ OTHER_CHIPSET_VENDOR = 13,
+
+ /** Automobile client */
+ AUTOMOBILE_CLIENT = 20,
+
+ /** Other sources */
+ OTHER_REQUESTOR = 100
+ }
+
+ /**
+ * GNSS response type for non-framework location requests.
+ */
+ @VintfStability
+ @Backing(type="int")
+ enum NfwResponseType {
+ /** Request rejected because framework has not given permission for this use case */
+ REJECTED = 0,
+
+ /** Request accepted but could not provide location because of a failure */
+ ACCEPTED_NO_LOCATION_PROVIDED = 1,
+
+ /** Request accepted and location provided */
+ ACCEPTED_LOCATION_PROVIDED = 2,
+ }
+
+ /**
+ * Represents a non-framework location information request/response notification.
+ */
+ @VintfStability
+ parcelable NfwNotification {
+ /**
+ * Package name of the Android proxy application representing the non-framework
+ * entity that requested location. Set to empty string if unknown.
+ *
+ * For user-initiated emergency use cases, this field must be set to empty string
+ * and the inEmergencyMode field must be set to true.
+ */
+ String proxyAppPackageName;
+
+ /** Protocol stack that initiated the non-framework location request. */
+ NfwProtocolStack protocolStack;
+
+ /**
+ * Name of the protocol stack if protocolStack field is set to OTHER_PROTOCOL_STACK.
+ * Otherwise, set to empty string.
+ *
+ * This field is opaque to the framework and used for logging purposes.
+ */
+ String otherProtocolStackName;
+
+ /** Source initiating/receiving the location information. */
+ NfwRequestor requestor;
+
+ /**
+ * Identity of the endpoint receiving the location information. For example, carrier
+ * name, OEM name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc.
+ *
+ * This field is opaque to the framework and used for logging purposes.
+ */
+ String requestorId;
+
+ /** Indicates whether location information was provided for this request. */
+ NfwResponseType responseType;
+
+ /** Is the device in user initiated emergency session. */
+ boolean inEmergencyMode;
+
+ /** Is cached location provided */
+ boolean isCachedLocation;
+ }
+
+ /**
+ * Callback to report a non-framework delivered location.
+ *
+ * The GNSS HAL implementation must call this method to notify the framework whenever
+ * a non-framework location request is made to the GNSS HAL.
+ *
+ * Non-framework entities like low power sensor hubs that request location from GNSS and
+ * only pass location information through Android framework controls are exempt from this
+ * power-spending reporting. However, low power sensor hubs or other chipsets which may send
+ * the location information to anywhere other than Android framework (which provides user
+ * visibility and control), must report location information use through this API whenever
+ * location information (or events driven by that location such as "home" location detection)
+ * leaves the domain of that low power chipset.
+ *
+ * To avoid overly spamming the framework, high speed location reporting of the exact same
+ * type may be throttled to report location at a lower rate than the actual report rate, as
+ * long as the location is reported with a latency of no more than the larger of 5 seconds,
+ * or the next the Android processor awake time. For example, if an Automotive client is
+ * getting location information from the GNSS location system at 20Hz, this method may be
+ * called at 1Hz. As another example, if a low power processor is getting location from the
+ * GNSS chipset, and the Android processor is asleep, the notification to the Android HAL may
+ * be delayed until the next wake of the Android processor.
+ *
+ * @param notification Non-framework delivered location request/response description.
+ */
+ void nfwNotifyCb(in NfwNotification notification);
+
+ /**
+ * Tells if the device is currently in an emergency session.
+ *
+ * Emergency session is defined as the device being actively in a user initiated emergency
+ * call or in post emergency call extension time period.
+ *
+ * If the GNSS HAL implementation cannot determine if the device is in emergency session
+ * mode, it must call this method to confirm that the device is in emergency session before
+ * serving network initiated emergency SUPL and Control Plane location requests.
+ *
+ * @return success True if the framework determines that the device is in emergency session.
+ */
+ boolean isInEmergencySession();
+}
diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp
index 1236714..29c26d1 100644
--- a/gnss/aidl/default/Android.bp
+++ b/gnss/aidl/default/Android.bp
@@ -52,12 +52,14 @@
"android.hardware.gnss.measurement_corrections@1.1",
"android.hardware.gnss.measurement_corrections@1.0",
"android.hardware.gnss.visibility_control@1.0",
+ "android.hardware.gnss.visibility_control-V1-ndk",
"android.hardware.gnss-V2-ndk",
],
srcs: [
"AGnss.cpp",
"Gnss.cpp",
"GnssBatching.cpp",
+ "GnssDebug.cpp",
"GnssGeofence.cpp",
"GnssHidlHal.cpp",
"GnssNavigationMessageInterface.cpp",
@@ -65,6 +67,7 @@
"GnssPsds.cpp",
"GnssConfiguration.cpp",
"GnssMeasurementInterface.cpp",
+ "GnssVisibilityControl.cpp",
"service.cpp",
],
static_libs: [
diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp
index 0e3cdd3..afb7b95 100644
--- a/gnss/aidl/default/Gnss.cpp
+++ b/gnss/aidl/default/Gnss.cpp
@@ -21,10 +21,12 @@
#include "AGnss.h"
#include "GnssBatching.h"
#include "GnssConfiguration.h"
+#include "GnssDebug.h"
#include "GnssGeofence.h"
#include "GnssMeasurementInterface.h"
#include "GnssNavigationMessageInterface.h"
#include "GnssPsds.h"
+#include "GnssVisibilityControl.h"
namespace aidl::android::hardware::gnss {
@@ -120,4 +122,19 @@
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus Gnss::getExtensionGnssDebug(std::shared_ptr<IGnssDebug>* iGnssDebug) {
+ ALOGD("Gnss::getExtensionGnssDebug");
+
+ *iGnssDebug = SharedRefBase::make<GnssDebug>();
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Gnss::getExtensionGnssVisibilityControl(
+ std::shared_ptr<visibility_control::IGnssVisibilityControl>* iGnssVisibilityControl) {
+ ALOGD("Gnss::getExtensionGnssVisibilityControl");
+
+ *iGnssVisibilityControl = SharedRefBase::make<visibility_control::GnssVisibilityControl>();
+ return ndk::ScopedAStatus::ok();
+}
+
} // namespace aidl::android::hardware::gnss
diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h
index 4feb781..67fef94 100644
--- a/gnss/aidl/default/Gnss.h
+++ b/gnss/aidl/default/Gnss.h
@@ -20,9 +20,11 @@
#include <aidl/android/hardware/gnss/BnGnss.h>
#include <aidl/android/hardware/gnss/BnGnssBatching.h>
#include <aidl/android/hardware/gnss/BnGnssConfiguration.h>
+#include <aidl/android/hardware/gnss/BnGnssDebug.h>
#include <aidl/android/hardware/gnss/BnGnssMeasurementInterface.h>
#include <aidl/android/hardware/gnss/BnGnssPowerIndication.h>
#include <aidl/android/hardware/gnss/BnGnssPsds.h>
+#include <aidl/android/hardware/gnss/visibility_control/BnGnssVisibilityControl.h>
#include "GnssConfiguration.h"
#include "GnssPowerIndication.h"
@@ -46,6 +48,10 @@
ndk::ScopedAStatus getExtensionGnssNavigationMessage(
std::shared_ptr<IGnssNavigationMessageInterface>* iGnssNavigationMessage) override;
ndk::ScopedAStatus getExtensionAGnss(std::shared_ptr<IAGnss>* iAGnss) override;
+ ndk::ScopedAStatus getExtensionGnssDebug(std::shared_ptr<IGnssDebug>* iGnssDebug) override;
+ ndk::ScopedAStatus getExtensionGnssVisibilityControl(
+ std::shared_ptr<android::hardware::gnss::visibility_control::IGnssVisibilityControl>*
+ iGnssVisibilityControl) override;
std::shared_ptr<GnssConfiguration> mGnssConfiguration;
std::shared_ptr<GnssPowerIndication> mGnssPowerIndication;
diff --git a/gnss/aidl/default/GnssDebug.cpp b/gnss/aidl/default/GnssDebug.cpp
new file mode 100644
index 0000000..f40c0bc
--- /dev/null
+++ b/gnss/aidl/default/GnssDebug.cpp
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#define LOG_TAG "GnssDebugAidl"
+
+#include "GnssDebug.h"
+#include <log/log.h>
+#include "MockLocation.h"
+
+namespace aidl::android::hardware::gnss {
+
+ndk::ScopedAStatus GnssDebug::getDebugData(DebugData* debugData) {
+ ALOGD("GnssDebug::getDebugData");
+
+ PositionDebug positionDebug = {.valid = true,
+ .latitudeDegrees = 37.4219999,
+ .longitudeDegrees = -122.0840575,
+ .altitudeMeters = 1.60062531,
+ .speedMetersPerSec = 0,
+ .bearingDegrees = 0,
+ .horizontalAccuracyMeters = 5,
+ .verticalAccuracyMeters = 5,
+ .speedAccuracyMetersPerSecond = 1,
+ .bearingAccuracyDegrees = 90,
+ .ageSeconds = 0.99};
+ TimeDebug timeDebug = {.timeEstimateMs = 1519930775453L,
+ .timeUncertaintyNs = 1000,
+ .frequencyUncertaintyNsPerSec = 5.0e4};
+ std::vector<SatelliteData> satelliteDataArrayDebug = {};
+ debugData->position = positionDebug;
+ debugData->time = timeDebug;
+ debugData->satelliteDataArray = satelliteDataArrayDebug;
+
+ return ndk::ScopedAStatus::ok();
+}
+
+} // namespace aidl::android::hardware::gnss
diff --git a/gnss/aidl/default/GnssDebug.h b/gnss/aidl/default/GnssDebug.h
new file mode 100644
index 0000000..001d47c
--- /dev/null
+++ b/gnss/aidl/default/GnssDebug.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/gnss/BnGnssDebug.h>
+
+namespace aidl::android::hardware::gnss {
+
+struct GnssDebug : public BnGnssDebug {
+ public:
+ ndk::ScopedAStatus getDebugData(DebugData* debugData) override;
+};
+
+} // namespace aidl::android::hardware::gnss
diff --git a/gnss/aidl/default/GnssVisibilityControl.cpp b/gnss/aidl/default/GnssVisibilityControl.cpp
new file mode 100644
index 0000000..208d73c
--- /dev/null
+++ b/gnss/aidl/default/GnssVisibilityControl.cpp
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#define LOG_TAG "GnssVisibilityControl"
+
+#include "GnssVisibilityControl.h"
+#include <log/log.h>
+
+namespace aidl::android::hardware::gnss::visibility_control {
+
+std::shared_ptr<IGnssVisibilityControlCallback> GnssVisibilityControl::sCallback = nullptr;
+
+ndk::ScopedAStatus GnssVisibilityControl::enableNfwLocationAccess(
+ const std::vector<std::string>& proxyApps) {
+ std::string os;
+ bool first = true;
+ for (const auto& proxyApp : proxyApps) {
+ if (first) {
+ first = false;
+ } else {
+ os += " ";
+ }
+ os += proxyApp;
+ }
+
+ ALOGD("GnssVisibilityControl::enableNfwLocationAccess proxyApps: %s", os.c_str());
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus GnssVisibilityControl::setCallback(
+ const std::shared_ptr<IGnssVisibilityControlCallback>& callback) {
+ ALOGD("GnssVisibilityControl::setCallback");
+ std::unique_lock<std::mutex> lock(mMutex);
+ sCallback = callback;
+ return ndk::ScopedAStatus::ok();
+}
+
+} // namespace aidl::android::hardware::gnss::visibility_control
diff --git a/gnss/aidl/default/GnssVisibilityControl.h b/gnss/aidl/default/GnssVisibilityControl.h
new file mode 100644
index 0000000..5b36442
--- /dev/null
+++ b/gnss/aidl/default/GnssVisibilityControl.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/gnss/visibility_control/BnGnssVisibilityControl.h>
+
+namespace aidl::android::hardware::gnss::visibility_control {
+
+struct GnssVisibilityControl : public BnGnssVisibilityControl {
+ public:
+ ndk::ScopedAStatus enableNfwLocationAccess(const std::vector<std::string>& hostname) override;
+ ndk::ScopedAStatus setCallback(
+ const std::shared_ptr<IGnssVisibilityControlCallback>& callback) override;
+
+ private:
+ // Synchronization lock for sCallback
+ mutable std::mutex mMutex;
+ // Guarded by mMutex
+ static std::shared_ptr<IGnssVisibilityControlCallback> sCallback;
+};
+
+} // namespace aidl::android::hardware::gnss::visibility_control
diff --git a/gnss/aidl/default/service.cpp b/gnss/aidl/default/service.cpp
index 09f1ad2..bbe34f1 100644
--- a/gnss/aidl/default/service.cpp
+++ b/gnss/aidl/default/service.cpp
@@ -42,7 +42,7 @@
const std::string instance = std::string() + Gnss::descriptor + "/default";
binder_status_t status =
AServiceManager_addService(gnssAidl->asBinder().get(), instance.c_str());
- CHECK(status == STATUS_OK);
+ CHECK_EQ(status, STATUS_OK);
sp<IGnss> gnss = new GnssHidlHal(gnssAidl);
configureRpcThreadpool(1, true /* will join */);
diff --git a/gnss/aidl/vts/Android.bp b/gnss/aidl/vts/Android.bp
index 041d579..d532fad 100644
--- a/gnss/aidl/vts/Android.bp
+++ b/gnss/aidl/vts/Android.bp
@@ -37,6 +37,7 @@
"GnssMeasurementCallbackAidl.cpp",
"GnssNavigationMessageCallback.cpp",
"GnssPowerIndicationCallback.cpp",
+ "GnssVisibilityControlCallback.cpp",
"VtsHalGnssTargetTest.cpp",
],
shared_libs: [
@@ -49,6 +50,7 @@
static_libs: [
"android.hardware.gnss-V2-cpp",
"android.hardware.gnss@common-vts-lib",
+ "android.hardware.gnss.visibility_control-V1-cpp",
],
test_suites: [
"general-tests",
diff --git a/gnss/aidl/vts/GnssVisibilityControlCallback.cpp b/gnss/aidl/vts/GnssVisibilityControlCallback.cpp
new file mode 100644
index 0000000..aa27af1
--- /dev/null
+++ b/gnss/aidl/vts/GnssVisibilityControlCallback.cpp
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "GnssVisibilityControlCallback.h"
+#include <log/log.h>
+
+android::binder::Status GnssVisibilityControlCallback::nfwNotifyCb(const NfwNotification&) {
+ // To implement
+ return android::binder::Status::ok();
+}
+
+android::binder::Status GnssVisibilityControlCallback::isInEmergencySession(bool*) {
+ // To implement
+ return android::binder::Status::ok();
+}
diff --git a/gnss/aidl/vts/GnssVisibilityControlCallback.h b/gnss/aidl/vts/GnssVisibilityControlCallback.h
new file mode 100644
index 0000000..fbacde7
--- /dev/null
+++ b/gnss/aidl/vts/GnssVisibilityControlCallback.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#pragma once
+
+#include <android/hardware/gnss/visibility_control/BnGnssVisibilityControlCallback.h>
+
+class GnssVisibilityControlCallback
+ : public android::hardware::gnss::visibility_control::BnGnssVisibilityControlCallback {
+ public:
+ GnssVisibilityControlCallback(){};
+ ~GnssVisibilityControlCallback(){};
+ android::binder::Status nfwNotifyCb(
+ const android::hardware::gnss::visibility_control::IGnssVisibilityControlCallback::
+ NfwNotification& notification) override;
+ android::binder::Status isInEmergencySession(bool* _aidl_return) override;
+};
diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp
index 970d1cb..90b643c 100644
--- a/gnss/aidl/vts/gnss_hal_test_cases.cpp
+++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp
@@ -19,16 +19,20 @@
#include <android/hardware/gnss/IAGnss.h>
#include <android/hardware/gnss/IGnss.h>
#include <android/hardware/gnss/IGnssBatching.h>
+#include <android/hardware/gnss/IGnssDebug.h>
#include <android/hardware/gnss/IGnssMeasurementCallback.h>
#include <android/hardware/gnss/IGnssMeasurementInterface.h>
#include <android/hardware/gnss/IGnssPowerIndication.h>
#include <android/hardware/gnss/IGnssPsds.h>
+#include <android/hardware/gnss/visibility_control/IGnssVisibilityControl.h>
+#include <cutils/properties.h>
#include "AGnssCallbackAidl.h"
#include "GnssBatchingCallback.h"
#include "GnssGeofenceCallback.h"
#include "GnssMeasurementCallbackAidl.h"
#include "GnssNavigationMessageCallback.h"
#include "GnssPowerIndicationCallback.h"
+#include "GnssVisibilityControlCallback.h"
#include "gnss_hal_test.h"
using android::sp;
@@ -43,6 +47,7 @@
using android::hardware::gnss::IGnssBatching;
using android::hardware::gnss::IGnssBatchingCallback;
using android::hardware::gnss::IGnssConfiguration;
+using android::hardware::gnss::IGnssDebug;
using android::hardware::gnss::IGnssGeofence;
using android::hardware::gnss::IGnssGeofenceCallback;
using android::hardware::gnss::IGnssMeasurementCallback;
@@ -52,9 +57,16 @@
using android::hardware::gnss::IGnssPsds;
using android::hardware::gnss::PsdsType;
using android::hardware::gnss::SatellitePvt;
+using android::hardware::gnss::visibility_control::IGnssVisibilityControl;
using GnssConstellationTypeAidl = android::hardware::gnss::GnssConstellationType;
+static bool IsAutomotiveDevice() {
+ char buffer[PROPERTY_VALUE_MAX] = {0};
+ property_get("ro.hardware.type", buffer, "");
+ return strncmp(buffer, "automotive", PROPERTY_VALUE_MAX) == 0;
+}
+
/*
* SetupTeardownCreateCleanup:
* Requests the gnss HAL then calls cleanup
@@ -804,6 +816,9 @@
* 3. Sets SUPL server host/port.
*/
TEST_P(GnssHalTest, TestAGnssExtension) {
+ if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ return;
+ }
sp<IAGnss> iAGnss;
auto status = aidl_gnss_hal_->getExtensionAGnss(&iAGnss);
ASSERT_TRUE(status.isOk());
@@ -817,3 +832,74 @@
status = iAGnss->setServer(AGnssType::SUPL, String16("supl.google.com"), 7275);
ASSERT_TRUE(status.isOk());
}
+
+/*
+ * GnssDebugValuesSanityTest:
+ * Ensures that GnssDebug values make sense.
+ */
+TEST_P(GnssHalTest, GnssDebugValuesSanityTest) {
+ if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ return;
+ }
+ sp<IGnssDebug> iGnssDebug;
+ auto status = aidl_gnss_hal_->getExtensionGnssDebug(&iGnssDebug);
+ ASSERT_TRUE(status.isOk());
+
+ if (!IsAutomotiveDevice() && gnss_cb_->info_cbq_.calledCount() > 0) {
+ ASSERT_TRUE(iGnssDebug != nullptr);
+
+ IGnssDebug::DebugData data;
+ auto status = iGnssDebug->getDebugData(&data);
+ ASSERT_TRUE(status.isOk());
+
+ if (data.position.valid) {
+ ASSERT_TRUE(data.position.latitudeDegrees >= -90 &&
+ data.position.latitudeDegrees <= 90);
+ ASSERT_TRUE(data.position.longitudeDegrees >= -180 &&
+ data.position.longitudeDegrees <= 180);
+ ASSERT_TRUE(data.position.altitudeMeters >= -1000 && // Dead Sea: -414m
+ data.position.altitudeMeters <= 20000); // Mount Everest: 8850m
+ ASSERT_TRUE(data.position.speedMetersPerSec >= 0 &&
+ data.position.speedMetersPerSec <= 600);
+ ASSERT_TRUE(data.position.bearingDegrees >= -360 &&
+ data.position.bearingDegrees <= 360);
+ ASSERT_TRUE(data.position.horizontalAccuracyMeters > 0 &&
+ data.position.horizontalAccuracyMeters <= 20000000);
+ ASSERT_TRUE(data.position.verticalAccuracyMeters > 0 &&
+ data.position.verticalAccuracyMeters <= 20000);
+ ASSERT_TRUE(data.position.speedAccuracyMetersPerSecond > 0 &&
+ data.position.speedAccuracyMetersPerSecond <= 500);
+ ASSERT_TRUE(data.position.bearingAccuracyDegrees > 0 &&
+ data.position.bearingAccuracyDegrees <= 180);
+ ASSERT_TRUE(data.position.ageSeconds >= 0);
+ }
+ ASSERT_TRUE(data.time.timeEstimateMs >= 1483228800000); // Jan 01 2017 00:00:00 GMT.
+ ASSERT_TRUE(data.time.timeUncertaintyNs > 0);
+ ASSERT_TRUE(data.time.frequencyUncertaintyNsPerSec > 0 &&
+ data.time.frequencyUncertaintyNsPerSec <= 2.0e5); // 200 ppm
+ }
+}
+
+/*
+ * TestAGnssExtension:
+ * TestGnssVisibilityControlExtension:
+ * 1. Gets the IGnssVisibilityControl extension.
+ * 2. Sets GnssVisibilityControlCallback
+ * 3. Sets proxy apps
+ */
+TEST_P(GnssHalTest, TestGnssVisibilityControlExtension) {
+ if (aidl_gnss_hal_->getInterfaceVersion() == 1) {
+ return;
+ }
+ sp<IGnssVisibilityControl> iGnssVisibilityControl;
+ auto status = aidl_gnss_hal_->getExtensionGnssVisibilityControl(&iGnssVisibilityControl);
+ ASSERT_TRUE(status.isOk());
+ ASSERT_TRUE(iGnssVisibilityControl != nullptr);
+ auto gnssVisibilityControlCallback = sp<GnssVisibilityControlCallback>::make();
+ status = iGnssVisibilityControl->setCallback(gnssVisibilityControlCallback);
+ ASSERT_TRUE(status.isOk());
+
+ std::vector<String16> proxyApps{String16("com.example.ims"), String16("com.example.mdt")};
+ status = iGnssVisibilityControl->enableNfwLocationAccess(proxyApps);
+ ASSERT_TRUE(status.isOk());
+}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Point.aidl
similarity index 92%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Point.aidl
index cfafc50..3722803 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Point.aidl
@@ -31,8 +31,9 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.graphics.common;
+@VintfStability
+parcelable Point {
+ int x;
+ int y;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/graphics/common/aidl/android/hardware/graphics/common/Point.aidl
similarity index 70%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to graphics/common/aidl/android/hardware/graphics/common/Point.aidl
index 0a93c9e..b3ede44 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/Point.aidl
@@ -14,20 +14,14 @@
* limitations under the License.
*/
-package android.hardware.graphics.composer3;
+package android.hardware.graphics.common;
/**
- * Special index values (always negative) for command queue commands.
+ * General purpose definition of a point.
*/
+
@VintfStability
-@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+parcelable Point {
+ int x;
+ int y;
}
diff --git a/graphics/composer/2.1/utils/vts/GraphicsComposerCallback.cpp b/graphics/composer/2.1/utils/vts/GraphicsComposerCallback.cpp
index 1ead138..ccbc5b1 100644
--- a/graphics/composer/2.1/utils/vts/GraphicsComposerCallback.cpp
+++ b/graphics/composer/2.1/utils/vts/GraphicsComposerCallback.cpp
@@ -30,7 +30,7 @@
std::vector<Display> GraphicsComposerCallback::getDisplays() const {
std::lock_guard<std::mutex> lock(mMutex);
- return std::vector<Display>(mDisplays.begin(), mDisplays.end());
+ return mDisplays;
}
int GraphicsComposerCallback::getInvalidHotplugCount() const {
@@ -51,12 +51,17 @@
Return<void> GraphicsComposerCallback::onHotplug(Display display, Connection connection) {
std::lock_guard<std::mutex> lock(mMutex);
+ auto it = std::find(mDisplays.begin(), mDisplays.end(), display);
if (connection == Connection::CONNECTED) {
- if (!mDisplays.insert(display).second) {
+ if (it == mDisplays.end()) {
+ mDisplays.push_back(display);
+ } else {
mInvalidHotplugCount++;
}
} else if (connection == Connection::DISCONNECTED) {
- if (!mDisplays.erase(display)) {
+ if (it != mDisplays.end()) {
+ mDisplays.erase(it);
+ } else {
mInvalidHotplugCount++;
}
}
@@ -67,7 +72,8 @@
Return<void> GraphicsComposerCallback::onRefresh(Display display) {
std::lock_guard<std::mutex> lock(mMutex);
- if (mDisplays.count(display) == 0) {
+ auto it = std::find(mDisplays.begin(), mDisplays.end(), display);
+ if (it == mDisplays.end()) {
mInvalidRefreshCount++;
}
@@ -77,7 +83,8 @@
Return<void> GraphicsComposerCallback::onVsync(Display display, int64_t) {
std::lock_guard<std::mutex> lock(mMutex);
- if (!mVsyncAllowed || mDisplays.count(display) == 0) {
+ auto it = std::find(mDisplays.begin(), mDisplays.end(), display);
+ if (!mVsyncAllowed || it == mDisplays.end()) {
mInvalidVsyncCount++;
}
diff --git a/graphics/composer/2.1/utils/vts/include/composer-vts/2.1/GraphicsComposerCallback.h b/graphics/composer/2.1/utils/vts/include/composer-vts/2.1/GraphicsComposerCallback.h
index e3c348f..da64052 100644
--- a/graphics/composer/2.1/utils/vts/include/composer-vts/2.1/GraphicsComposerCallback.h
+++ b/graphics/composer/2.1/utils/vts/include/composer-vts/2.1/GraphicsComposerCallback.h
@@ -19,7 +19,7 @@
#include <android/hardware/graphics/composer/2.1/IComposerCallback.h>
#include <mutex>
-#include <unordered_set>
+#include <vector>
namespace android {
namespace hardware {
@@ -48,7 +48,7 @@
mutable std::mutex mMutex;
// the set of all currently connected displays
- std::unordered_set<Display> mDisplays;
+ std::vector<Display> mDisplays;
// true only when vsync is enabled
bool mVsyncAllowed = true;
diff --git a/graphics/composer/2.4/utils/vts/GraphicsComposerCallback.cpp b/graphics/composer/2.4/utils/vts/GraphicsComposerCallback.cpp
index c9366a8..51e1ab7 100644
--- a/graphics/composer/2.4/utils/vts/GraphicsComposerCallback.cpp
+++ b/graphics/composer/2.4/utils/vts/GraphicsComposerCallback.cpp
@@ -25,7 +25,7 @@
std::vector<Display> GraphicsComposerCallback::getDisplays() const {
std::lock_guard<std::mutex> lock(mMutex);
- return std::vector<Display>(mDisplays.begin(), mDisplays.end());
+ return mDisplays;
}
int32_t GraphicsComposerCallback::getInvalidHotplugCount() const {
@@ -71,12 +71,17 @@
Return<void> GraphicsComposerCallback::onHotplug(Display display, Connection connection) {
std::lock_guard<std::mutex> lock(mMutex);
+ auto it = std::find(mDisplays.begin(), mDisplays.end(), display);
if (connection == Connection::CONNECTED) {
- if (!mDisplays.insert(display).second) {
+ if (it == mDisplays.end()) {
+ mDisplays.push_back(display);
+ } else {
mInvalidHotplugCount++;
}
} else if (connection == Connection::DISCONNECTED) {
- if (!mDisplays.erase(display)) {
+ if (it != mDisplays.end()) {
+ mDisplays.erase(it);
+ } else {
mInvalidHotplugCount++;
}
}
@@ -87,7 +92,8 @@
Return<void> GraphicsComposerCallback::onRefresh(Display display) {
std::lock_guard<std::mutex> lock(mMutex);
- if (mDisplays.count(display) == 0) {
+ auto it = std::find(mDisplays.begin(), mDisplays.end(), display);
+ if (it == mDisplays.end()) {
mInvalidRefreshCount++;
}
@@ -106,7 +112,8 @@
Return<void> GraphicsComposerCallback::onVsync_2_4(Display display, int64_t, VsyncPeriodNanos) {
std::lock_guard<std::mutex> lock(mMutex);
- if (!mVsyncAllowed || mDisplays.count(display) == 0) {
+ auto it = std::find(mDisplays.begin(), mDisplays.end(), display);
+ if (!mVsyncAllowed || it == mDisplays.end()) {
mInvalidVsync_2_4Count++;
}
@@ -117,7 +124,8 @@
Display display, const VsyncPeriodChangeTimeline& updatedTimeline) {
std::lock_guard<std::mutex> lock(mMutex);
- if (mDisplays.count(display) == 0) {
+ auto it = std::find(mDisplays.begin(), mDisplays.end(), display);
+ if (it == mDisplays.end()) {
mInvalidVsyncPeriodChangeCount++;
}
@@ -134,4 +142,4 @@
return Void();
}
-} // namespace android::hardware::graphics::composer::V2_4::vts
\ No newline at end of file
+} // namespace android::hardware::graphics::composer::V2_4::vts
diff --git a/graphics/composer/2.4/utils/vts/include/composer-vts/2.4/GraphicsComposerCallback.h b/graphics/composer/2.4/utils/vts/include/composer-vts/2.4/GraphicsComposerCallback.h
index f4e23ae..c03070b 100644
--- a/graphics/composer/2.4/utils/vts/include/composer-vts/2.4/GraphicsComposerCallback.h
+++ b/graphics/composer/2.4/utils/vts/include/composer-vts/2.4/GraphicsComposerCallback.h
@@ -18,7 +18,7 @@
#include <android/hardware/graphics/composer/2.4/IComposerCallback.h>
#include <mutex>
-#include <unordered_set>
+#include <vector>
namespace android::hardware::graphics::composer::V2_4::vts {
@@ -56,7 +56,7 @@
mutable std::mutex mMutex;
// the set of all currently connected displays
- std::unordered_set<Display> mDisplays;
+ std::vector<Display> mDisplays;
// true only when vsync is enabled
bool mVsyncAllowed = true;
diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp
index e33c653..2532a7a 100644
--- a/graphics/composer/aidl/Android.bp
+++ b/graphics/composer/aidl/Android.bp
@@ -31,12 +31,13 @@
enabled: true,
support_system_process: true,
},
- srcs: ["android/hardware/graphics/composer3/*.aidl"],
+ srcs: [
+ "android/hardware/graphics/composer3/*.aidl",
+ ],
stability: "vintf",
imports: [
"android.hardware.graphics.common-V3",
"android.hardware.common-V2",
- "android.hardware.common.fmq-V1",
],
backend: {
cpp: {
@@ -54,25 +55,12 @@
},
}
-cc_library {
- name: "android.hardware.graphics.composer3-translate-ndk",
- vendor_available: true,
- srcs: ["android/hardware/graphics/composer3/translate-ndk.cpp"],
- shared_libs: [
- "libbinder_ndk",
- "libhidlbase",
- "android.hardware.graphics.composer3-V1-ndk",
- "android.hardware.graphics.composer@2.1",
- "android.hardware.graphics.composer@2.4",
- ],
- export_include_dirs: ["include"],
-}
-
cc_library_headers {
name: "android.hardware.graphics.composer3-command-buffer",
vendor_available: true,
shared_libs: [
"android.hardware.graphics.composer3-V1-ndk",
+ "android.hardware.common-V2-ndk",
"libbase",
"libfmq",
"libsync",
@@ -86,3 +74,16 @@
],
export_include_dirs: ["include"],
}
+
+cc_test {
+ name: "android.hardware.graphics.composer3-hidl2aidl-asserts",
+ vendor_available: true,
+ srcs: ["android/hardware/graphics/composer3/Hidl2AidlAsserts.cpp"],
+ shared_libs: [
+ "libbinder_ndk",
+ "libhidlbase",
+ "android.hardware.graphics.composer3-V1-ndk",
+ "android.hardware.graphics.composer@2.1",
+ "android.hardware.graphics.composer@2.4",
+ ],
+}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Buffer.aidl
similarity index 92%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Buffer.aidl
index cfafc50..a33ad23 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Buffer.aidl
@@ -32,7 +32,9 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+@VintfStability
+parcelable Buffer {
+ int slot;
+ @nullable android.hardware.common.NativeHandle handle;
+ @nullable ParcelFileDescriptor fence;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl
similarity index 93%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl
index 41a1afe..7e47ba8 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl
@@ -33,8 +33,7 @@
package android.hardware.graphics.composer3;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+parcelable ChangedCompositionLayer {
+ long layer;
+ android.hardware.graphics.composer3.Composition composition;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl
similarity index 93%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl
index 41a1afe..9a5ca97 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl
@@ -33,8 +33,7 @@
package android.hardware.graphics.composer3;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+parcelable ChangedCompositionTypes {
+ long display;
+ android.hardware.graphics.composer3.ChangedCompositionLayer[] layers;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTarget.aidl
similarity index 90%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTarget.aidl
index 41a1afe..7632707 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTarget.aidl
@@ -33,8 +33,8 @@
package android.hardware.graphics.composer3;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+parcelable ClientTarget {
+ android.hardware.graphics.composer3.Buffer buffer;
+ android.hardware.graphics.common.Dataspace dataspace;
+ android.hardware.graphics.common.Rect[] damage;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl
similarity index 91%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl
index 41a1afe..f0fb22e 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl
@@ -33,8 +33,8 @@
package android.hardware.graphics.composer3;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+parcelable ClientTargetPropertyWithNits {
+ long display;
+ android.hardware.graphics.composer3.ClientTargetProperty clientTargetProperty;
+ float whitePointNits;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl
similarity index 95%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl
index cfafc50..480a85c 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+@VintfStability
+parcelable ClockMonotonicTimestamp {
+ long timestampNanos;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl
deleted file mode 100644
index e19105d..0000000
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Command.aidl
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * Copyright (c) 2021, 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum Command {
- LENGTH_MASK = 65535,
- OPCODE_SHIFT = 16,
- OPCODE_MASK = -65536,
- SELECT_DISPLAY = 0,
- SELECT_LAYER = 65536,
- SET_ERROR = 16777216,
- SET_CHANGED_COMPOSITION_TYPES = 16842752,
- SET_DISPLAY_REQUESTS = 16908288,
- SET_PRESENT_FENCE = 16973824,
- SET_RELEASE_FENCES = 17039360,
- SET_COLOR_TRANSFORM = 33554432,
- SET_CLIENT_TARGET = 33619968,
- SET_OUTPUT_BUFFER = 33685504,
- VALIDATE_DISPLAY = 33751040,
- ACCEPT_DISPLAY_CHANGES = 33816576,
- PRESENT_DISPLAY = 33882112,
- PRESENT_OR_VALIDATE_DISPLAY = 33947648,
- SET_LAYER_CURSOR_POSITION = 50331648,
- SET_LAYER_BUFFER = 50397184,
- SET_LAYER_SURFACE_DAMAGE = 50462720,
- SET_LAYER_BLEND_MODE = 67108864,
- SET_LAYER_COLOR = 67174400,
- SET_LAYER_COMPOSITION_TYPE = 67239936,
- SET_LAYER_DATASPACE = 67305472,
- SET_LAYER_DISPLAY_FRAME = 67371008,
- SET_LAYER_PLANE_ALPHA = 67436544,
- SET_LAYER_SIDEBAND_STREAM = 67502080,
- SET_LAYER_SOURCE_CROP = 67567616,
- SET_LAYER_TRANSFORM = 67633152,
- SET_LAYER_VISIBLE_REGION = 67698688,
- SET_LAYER_Z_ORDER = 67764224,
- SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT = 67829760,
- SET_LAYER_PER_FRAME_METADATA = 50528256,
- SET_LAYER_FLOAT_COLOR = 67895296,
- SET_LAYER_COLOR_TRANSFORM = 67960832,
- SET_LAYER_PER_FRAME_METADATA_BLOBS = 50593792,
- SET_CLIENT_TARGET_PROPERTY = 17104896,
- SET_LAYER_GENERIC_METADATA = 68026368,
- SET_LAYER_WHITE_POINT_NITS = 50659328,
-}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandError.aidl
similarity index 95%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandError.aidl
index cfafc50..103bfdc 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandError.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+@VintfStability
+parcelable CommandError {
+ int commandIndex;
+ int errorCode;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl
similarity index 76%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl
index 41a1afe..ebbb31e 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl
@@ -33,8 +33,12 @@
package android.hardware.graphics.composer3;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+union CommandResultPayload {
+ android.hardware.graphics.composer3.CommandError error;
+ android.hardware.graphics.composer3.ChangedCompositionTypes changedCompositionTypes;
+ android.hardware.graphics.composer3.DisplayRequest displayRequest;
+ android.hardware.graphics.composer3.PresentFence presentFence;
+ android.hardware.graphics.composer3.ReleaseFences releaseFences;
+ android.hardware.graphics.composer3.PresentOrValidate presentOrValidateResult;
+ android.hardware.graphics.composer3.ClientTargetPropertyWithNits clientTargetProperty;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Composition.aidl
index e327e87..d2d8f04 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Composition.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Composition.aidl
@@ -40,4 +40,5 @@
SOLID_COLOR = 3,
CURSOR = 4,
SIDEBAND = 5,
+ DISPLAY_DECORATION = 6,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.aidl
index 0bcd870..9f5342e 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.aidl
@@ -40,4 +40,5 @@
BRIGHTNESS = 3,
PROTECTED_CONTENTS = 4,
AUTO_LOW_LATENCY_MODE = 5,
+ SUSPEND = 6,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl
similarity index 77%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl
index 41a1afe..3382633 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl
@@ -33,8 +33,15 @@
package android.hardware.graphics.composer3;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+parcelable DisplayCommand {
+ long display;
+ android.hardware.graphics.composer3.LayerCommand[] layers;
+ @nullable float[] colorTransformMatrix;
+ @nullable android.hardware.graphics.composer3.ClientTarget clientTarget;
+ @nullable android.hardware.graphics.composer3.Buffer virtualDisplayOutputBuffer;
+ @nullable android.hardware.graphics.composer3.ClockMonotonicTimestamp expectedPresentTime;
+ boolean validateDisplay;
+ boolean acceptDisplayChanges;
+ boolean presentDisplay;
+ boolean presentOrValidateDisplay;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl
index 26e7d97..13462ce 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl
@@ -32,8 +32,17 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum DisplayRequest {
- FLIP_CLIENT_TARGET = 1,
- WRITE_CLIENT_TARGET_TO_OUTPUT = 2,
+@VintfStability
+parcelable DisplayRequest {
+ long display;
+ int mask;
+ android.hardware.graphics.composer3.DisplayRequest.LayerRequest[] layerRequests;
+ const int FLIP_CLIENT_TARGET = 1;
+ const int WRITE_CLIENT_TARGET_TO_OUTPUT = 2;
+ @VintfStability
+ parcelable LayerRequest {
+ long layer;
+ int mask;
+ const int CLEAR_CLIENT_TARGET = 1;
+ }
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/HandleIndex.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/HandleIndex.aidl
deleted file mode 100644
index b87870d..0000000
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/HandleIndex.aidl
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Copyright (c) 2021, 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum HandleIndex {
- EMPTY = -1,
- CACHED = -2,
-}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
index d7cab2b..2d17e0f 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -38,12 +38,11 @@
android.hardware.graphics.composer3.VirtualDisplay createVirtualDisplay(int width, int height, android.hardware.graphics.common.PixelFormat formatHint, int outputBufferSlotCount);
void destroyLayer(long display, long layer);
void destroyVirtualDisplay(long display);
- android.hardware.graphics.composer3.ExecuteCommandsStatus executeCommands(int inLength, in android.hardware.common.NativeHandle[] inHandles);
+ android.hardware.graphics.composer3.CommandResultPayload[] executeCommands(in android.hardware.graphics.composer3.DisplayCommand[] commands);
int getActiveConfig(long display);
android.hardware.graphics.composer3.ColorMode[] getColorModes(long display);
float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace);
int getDisplayAttribute(long display, int config, android.hardware.graphics.composer3.DisplayAttribute attribute);
- boolean getDisplayBrightnessSupport(long display);
android.hardware.graphics.composer3.DisplayCapability[] getDisplayCapabilities(long display);
int[] getDisplayConfigs(long display);
android.hardware.graphics.composer3.DisplayConnectionType getDisplayConnectionType(long display);
@@ -52,14 +51,11 @@
int getDisplayVsyncPeriod(long display);
android.hardware.graphics.composer3.DisplayContentSample getDisplayedContentSample(long display, long maxFrames, long timestamp);
android.hardware.graphics.composer3.DisplayContentSamplingAttributes getDisplayedContentSamplingAttributes(long display);
- boolean getDozeSupport(long display);
android.hardware.graphics.composer3.HdrCapabilities getHdrCapabilities(long display);
- android.hardware.graphics.composer3.LayerGenericMetadataKey[] getLayerGenericMetadataKeys();
int getMaxVirtualDisplayCount();
- android.hardware.common.fmq.MQDescriptor<int,android.hardware.common.fmq.SynchronizedReadWrite> getOutputCommandQueue();
android.hardware.graphics.composer3.PerFrameMetadataKey[] getPerFrameMetadataKeys(long display);
android.hardware.graphics.composer3.ReadbackBufferAttributes getReadbackBufferAttributes(long display);
- ParcelFileDescriptor getReadbackBufferFence(long display);
+ @nullable ParcelFileDescriptor getReadbackBufferFence(long display);
android.hardware.graphics.composer3.RenderIntent[] getRenderIntents(long display, android.hardware.graphics.composer3.ColorMode mode);
android.hardware.graphics.composer3.ContentType[] getSupportedContentTypes(long display);
void registerCallback(in android.hardware.graphics.composer3.IComposerCallback callback);
@@ -71,9 +67,8 @@
void setContentType(long display, android.hardware.graphics.composer3.ContentType type);
void setDisplayBrightness(long display, float brightness);
void setDisplayedContentSamplingEnabled(long display, boolean enable, android.hardware.graphics.composer3.FormatColorComponent componentMask, long maxFrames);
- void setInputCommandQueue(in android.hardware.common.fmq.MQDescriptor<int,android.hardware.common.fmq.SynchronizedReadWrite> descriptor);
void setPowerMode(long display, android.hardware.graphics.composer3.PowerMode mode);
- void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer, in ParcelFileDescriptor releaseFence);
+ void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer, in @nullable ParcelFileDescriptor releaseFence);
void setVsyncEnabled(long display, boolean enabled);
const int EX_BAD_CONFIG = 1;
const int EX_BAD_DISPLAY = 2;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl
new file mode 100644
index 0000000..ab77880
--- /dev/null
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2021, 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.graphics.composer3;
+@VintfStability
+parcelable LayerCommand {
+ long layer;
+ @nullable android.hardware.graphics.common.Point cursorPosition;
+ @nullable android.hardware.graphics.composer3.Buffer buffer;
+ @nullable android.hardware.graphics.common.Rect[] damage;
+ @nullable android.hardware.graphics.composer3.ParcelableBlendMode blendMode;
+ @nullable android.hardware.graphics.composer3.Color color;
+ @nullable android.hardware.graphics.composer3.FloatColor floatColor;
+ @nullable android.hardware.graphics.composer3.ParcelableComposition composition;
+ @nullable android.hardware.graphics.composer3.ParcelableDataspace dataspace;
+ @nullable android.hardware.graphics.common.Rect displayFrame;
+ @nullable android.hardware.graphics.composer3.PlaneAlpha planeAlpha;
+ @nullable android.hardware.common.NativeHandle sidebandStream;
+ @nullable android.hardware.graphics.common.FRect sourceCrop;
+ @nullable android.hardware.graphics.composer3.ParcelableTransform transform;
+ @nullable android.hardware.graphics.common.Rect[] visibleRegion;
+ @nullable android.hardware.graphics.composer3.ZOrder z;
+ @nullable float[] colorTransform;
+ @nullable android.hardware.graphics.composer3.WhitePointNits whitePointNits;
+ @nullable android.hardware.graphics.composer3.PerFrameMetadata[] perFrameMetadata;
+ @nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob;
+}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableBlendMode.aidl
similarity index 94%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableBlendMode.aidl
index cfafc50..f1fee5f 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableBlendMode.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+@VintfStability
+parcelable ParcelableBlendMode {
+ android.hardware.graphics.common.BlendMode blendMode;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableComposition.aidl
similarity index 94%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableComposition.aidl
index 73385d4..98fbb66 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableComposition.aidl
@@ -33,7 +33,6 @@
package android.hardware.graphics.composer3;
@VintfStability
-parcelable LayerGenericMetadataKey {
- String name;
- boolean mandatory;
+parcelable ParcelableComposition {
+ android.hardware.graphics.composer3.Composition composition;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableDataspace.aidl
similarity index 94%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableDataspace.aidl
index cfafc50..76ecf85 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableDataspace.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+@VintfStability
+parcelable ParcelableDataspace {
+ android.hardware.graphics.common.Dataspace dataspace;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableTransform.aidl
similarity index 94%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableTransform.aidl
index cfafc50..b673656 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableTransform.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+@VintfStability
+parcelable ParcelableTransform {
+ android.hardware.graphics.common.Transform transform;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PlaneAlpha.aidl
similarity index 95%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PlaneAlpha.aidl
index cfafc50..c48c2a8 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PlaneAlpha.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+@VintfStability
+parcelable PlaneAlpha {
+ float alpha;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentFence.aidl
similarity index 95%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentFence.aidl
index 73385d4..3bb09cd 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentFence.aidl
@@ -33,7 +33,7 @@
package android.hardware.graphics.composer3;
@VintfStability
-parcelable LayerGenericMetadataKey {
- String name;
- boolean mandatory;
+parcelable PresentFence {
+ long display;
+ ParcelFileDescriptor fence;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl
similarity index 89%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl
index cfafc50..e6ddeba 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl
@@ -32,7 +32,13 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+@VintfStability
+parcelable PresentOrValidate {
+ long display;
+ android.hardware.graphics.composer3.PresentOrValidate.Result result;
+ @VintfStability
+ enum Result {
+ Validated = 0,
+ Presented = 1,
+ }
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ReleaseFences.aidl
similarity index 89%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ReleaseFences.aidl
index 41a1afe..d623661 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ReleaseFences.aidl
@@ -33,8 +33,12 @@
package android.hardware.graphics.composer3;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+parcelable ReleaseFences {
+ long display;
+ android.hardware.graphics.composer3.ReleaseFences.Layer[] layers;
+ @VintfStability
+ parcelable Layer {
+ long layer;
+ ParcelFileDescriptor fence;
+ }
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl
similarity index 95%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl
index cfafc50..c3925d2 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+@VintfStability
+parcelable WhitePointNits {
+ float nits;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ZOrder.aidl
similarity index 95%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ZOrder.aidl
index cfafc50..ea96ea3 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ZOrder.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+@VintfStability
+parcelable ZOrder {
+ int z;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Buffer.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Buffer.aidl
new file mode 100644
index 0000000..415a9b6
--- /dev/null
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Buffer.aidl
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2021, 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.graphics.composer3;
+
+import android.hardware.common.NativeHandle;
+
+@VintfStability
+parcelable Buffer {
+ /**
+ * Buffer slot in the range [0, bufferSlotCount) where bufferSlotCount is
+ * the parameter used when the layer was created.
+ * @see IComposer.createLayer.
+ * The slot is used as a buffer caching mechanism. When the Buffer.handle
+ * is null, the implementation uses the previous buffer associated with this
+ * slot.
+ */
+ int slot;
+
+ /**
+ * Buffer Handle. Can be null if this is the same buffer that was sent
+ * previously on this slot.
+ */
+ @nullable NativeHandle handle;
+
+ /**
+ * Buffer fence that represents when it is safe to access the buffer.
+ * A null fence indicates that the buffer can be accessed immediately.
+ */
+ @nullable ParcelFileDescriptor fence;
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl
similarity index 73%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl
index 0a93c9e..fb25163 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl
@@ -16,18 +16,18 @@
package android.hardware.graphics.composer3;
-/**
- * Special index values (always negative) for command queue commands.
- */
+import android.hardware.graphics.composer3.Composition;
+
@VintfStability
-@Backing(type="int")
-enum HandleIndex {
+parcelable ChangedCompositionLayer {
/**
- * No handle
+ * The layer which this commands refers to.
+ * @see IComposer.createLayer
*/
- EMPTY = -1,
+ long layer;
+
/**
- * Use cached handle
+ * The new composition type.
*/
- CACHED = -2,
+ Composition composition;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl
similarity index 66%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl
index c6fd063..ddd45b7 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl
@@ -16,23 +16,19 @@
package android.hardware.graphics.composer3;
-/**
- * Blend modes, settable per layer.
- */
+import android.hardware.graphics.composer3.ChangedCompositionLayer;
+import android.hardware.graphics.composer3.Composition;
+
@VintfStability
-@Backing(type="int")
-enum BlendMode {
- INVALID = 0,
+parcelable ChangedCompositionTypes {
/**
- * colorOut = colorSrc
+ * The display which this commands refers to.
+ * @see IComposer.createDisplay
*/
- NONE = 1,
+ long display;
+
/**
- * colorOut = colorSrc + colorDst * (1 - alphaSrc)
+ * Indicates which layers has composition changes
*/
- PREMULTIPLIED = 2,
- /**
- * colorOut = colorSrc * alphaSrc + colorDst * (1 - alphaSrc)
- */
- COVERAGE = 3,
+ ChangedCompositionLayer[] layers;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTarget.aidl
similarity index 65%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl
copy to graphics/composer/aidl/android/hardware/graphics/composer3/ClientTarget.aidl
index c6fd063..56488d5 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTarget.aidl
@@ -16,23 +16,24 @@
package android.hardware.graphics.composer3;
-/**
- * Blend modes, settable per layer.
- */
+import android.hardware.graphics.common.Dataspace;
+import android.hardware.graphics.common.Rect;
+import android.hardware.graphics.composer3.Buffer;
+
@VintfStability
-@Backing(type="int")
-enum BlendMode {
- INVALID = 0,
+parcelable ClientTarget {
/**
- * colorOut = colorSrc
+ * Client target Buffer
*/
- NONE = 1,
+ Buffer buffer;
+
/**
- * colorOut = colorSrc + colorDst * (1 - alphaSrc)
+ * The dataspace of the buffer, as described in LayerCommand.dataspace.
*/
- PREMULTIPLIED = 2,
+ Dataspace dataspace;
+
/**
- * colorOut = colorSrc * alphaSrc + colorDst * (1 - alphaSrc)
+ * The surface damage regions.
*/
- COVERAGE = 3,
+ Rect[] damage;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl
similarity index 64%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl
copy to graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl
index c6fd063..5037651 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl
@@ -16,23 +16,23 @@
package android.hardware.graphics.composer3;
-/**
- * Blend modes, settable per layer.
- */
+import android.hardware.graphics.composer3.ClientTargetProperty;
+
@VintfStability
-@Backing(type="int")
-enum BlendMode {
- INVALID = 0,
+parcelable ClientTargetPropertyWithNits {
/**
- * colorOut = colorSrc
+ * The display which this commands refers to.
+ * @see IComposer.createDisplay
*/
- NONE = 1,
+ long display;
+
/**
- * colorOut = colorSrc + colorDst * (1 - alphaSrc)
+ * The Client target property.
*/
- PREMULTIPLIED = 2,
+ ClientTargetProperty clientTargetProperty;
+
/**
- * colorOut = colorSrc * alphaSrc + colorDst * (1 - alphaSrc)
+ * The white points nits as described in CommandResultPayload.clientTargetProperty
*/
- COVERAGE = 3,
+ float whitePointNits;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl
similarity index 75%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to graphics/composer/aidl/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl
index 0a93c9e..0cfd1c4 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl
@@ -17,17 +17,9 @@
package android.hardware.graphics.composer3;
/**
- * Special index values (always negative) for command queue commands.
+ * Represents a nanoseconds timestamp in CLOCK_MONOTONIC.
*/
@VintfStability
-@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+parcelable ClockMonotonicTimestamp {
+ long timestampNanos;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl
deleted file mode 100644
index 95c07ac..0000000
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/Command.aidl
+++ /dev/null
@@ -1,763 +0,0 @@
-/**
- * Copyright (c) 2021, 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.graphics.composer3;
-
-import android.hardware.graphics.composer3.Command;
-
-/**
- * The command interface allows composer3 to reduce binder overhead by sending
- * atomic command stream in a command message queue. These commands are usually
- * sent on a per frame basic and contains the information that describes how the
- * display is composited. @see IComposerClient.executeCommands.
- */
-@VintfStability
-@Backing(type="int")
-enum Command {
- LENGTH_MASK = 0xffff,
- OPCODE_SHIFT = 16,
- OPCODE_MASK = 0xffff << OPCODE_SHIFT,
-
- // special commands
-
- /**
- * SELECT_DISPLAY has this pseudo prototype
- *
- * selectDisplay(long display);
- *
- * Selects the current display implied by all other commands.
- *
- * @param display is the newly selected display.
- */
- SELECT_DISPLAY = 0x000 << OPCODE_SHIFT,
-
- /**
- * SELECT_LAYER has this pseudo prototype
- *
- * selectLayer(long layer);
- *
- * Selects the current layer implied by all implicit layer commands.
- *
- * @param layer is the newly selected layer.
- */
- SELECT_LAYER = 0x001 << OPCODE_SHIFT,
-
- // value commands (for return values)
-
- /**
- * SET_ERROR has this pseudo prototype
- *
- * setError(uint32_t location, int error);
- *
- * Indicates an error generated by a command.
- *
- * @param location is the offset of the command in the input command
- * message queue.
- * @param error is the error generated by the command.
- */
- SET_ERROR = 0x100 << OPCODE_SHIFT,
-
- /**
- * SET_CHANGED_COMPOSITION_TYPES has this pseudo prototype
- *
- * setChangedCompositionTypes(long[] layers,
- * Composition[] types);
- *
- * Sets the layers for which the device requires a different composition
- * type than had been set prior to the last call to VALIDATE_DISPLAY. The
- * client must either update its state with these types and call
- * ACCEPT_DISPLAY_CHANGES, or must set new types and attempt to validate
- * the display again.
- *
- * @param layers is an array of layer handles.
- * @param types is an array of composition types, each corresponding to
- * an element of layers.
- */
- SET_CHANGED_COMPOSITION_TYPES = 0x101 << OPCODE_SHIFT,
-
- /**
- * SET_DISPLAY_REQUESTS has this pseudo prototype
- *
- * setDisplayRequests(int displayRequestMask,
- * long[] layers,
- * int[] layerRequestMasks);
- *
- * Sets the display requests and the layer requests required for the last
- * validated configuration.
- *
- * Display requests provide information about how the client must handle
- * the client target. Layer requests provide information about how the
- * client must handle an individual layer.
- *
- * @param displayRequestMask is the display requests for the current
- * validated state.
- * @param layers is an array of layers which all have at least one
- * request.
- * @param layerRequestMasks is the requests corresponding to each element
- * of layers.
- */
- SET_DISPLAY_REQUESTS = 0x102 << OPCODE_SHIFT,
-
- /**
- * SET_PRESENT_FENCE has this pseudo prototype
- *
- * setPresentFence(int presentFenceIndex);
- *
- * Sets the present fence as a result of PRESENT_DISPLAY. For physical
- * displays, this fence must be signaled at the vsync when the result
- * of composition of this frame starts to appear (for video-mode panels)
- * or starts to transfer to panel memory (for command-mode panels). For
- * virtual displays, this fence must be signaled when writes to the output
- * buffer have completed and it is safe to read from it.
- *
- * @param presentFenceIndex is an index into outHandles array.
- */
- SET_PRESENT_FENCE = 0x103 << OPCODE_SHIFT,
-
- /**
- * SET_RELEASE_FENCES has this pseudo prototype
- *
- * setReleaseFences(long[] layers,
- * int[] releaseFenceIndices);
- *
- * Sets the release fences for device layers on this display which will
- * receive new buffer contents this frame.
- *
- * A release fence is a file descriptor referring to a sync fence object
- * which must be signaled after the device has finished reading from the
- * buffer presented in the prior frame. This indicates that it is safe to
- * start writing to the buffer again. If a given layer's fence is not
- * returned from this function, it must be assumed that the buffer
- * presented on the previous frame is ready to be written.
- *
- * The fences returned by this function must be unique for each layer
- * (even if they point to the same underlying sync object).
- *
- * @param layers is an array of layer handles.
- * @param releaseFenceIndices are indices into outHandles array, each
- * corresponding to an element of layers.
- */
- SET_RELEASE_FENCES = 0x104 << OPCODE_SHIFT,
-
- // display commands
-
- /**
- * SET_COLOR_TRANSFORM has this pseudo prototype
- *
- * setColorTransform(float[16] matrix,
- * ColorTransform hint);
- *
- * Sets a color transform which will be applied after composition.
- *
- * If hint is not ColorTransform::ARBITRARY, then the device may use the
- * hint to apply the desired color transform instead of using the color
- * matrix directly.
- *
- * If the device is not capable of either using the hint or the matrix to
- * apply the desired color transform, it must force all layers to client
- * composition during VALIDATE_DISPLAY.
- *
- * If IComposer::Capability::SKIP_CLIENT_COLOR_TRANSFORM is present, then
- * the client must never apply the color transform during client
- * composition, even if all layers are being composed by the client.
- *
- * The matrix provided is an affine color transformation of the following
- * form:
- *
- * |r.r r.g r.b 0|
- * |g.r g.g g.b 0|
- * |b.r b.g b.b 0|
- * |Tr Tg Tb 1|
- *
- * This matrix must be provided in row-major form:
- *
- * {r.r, r.g, r.b, 0, g.r, ...}.
- *
- * Given a matrix of this form and an input color [R_in, G_in, B_in], the
- * output color [R_out, G_out, B_out] will be:
- *
- * R_out = R_in * r.r + G_in * g.r + B_in * b.r + Tr
- * G_out = R_in * r.g + G_in * g.g + B_in * b.g + Tg
- * B_out = R_in * r.b + G_in * g.b + B_in * b.b + Tb
- *
- * @param matrix is a 4x4 transform matrix (16 floats) as described above.
- * @param hint is a hint value which may be used instead of the given
- * matrix unless it is ColorTransform::ARBITRARY.
- */
- SET_COLOR_TRANSFORM = 0x200 << OPCODE_SHIFT,
-
- /**
- * SET_CLIENT_TARGET has this pseudo prototype
- *
- * setClientTarget(int targetSlot,
- * int targetIndex,
- * int acquireFenceIndex,
- * android.hardware.graphics.common.Dataspace dataspace,
- * Rect[] damage);
- *
- * Sets the buffer handle which will receive the output of client
- * composition. Layers marked as Composition::CLIENT must be composited
- * into this buffer prior to the call to PRESENT_DISPLAY, and layers not
- * marked as Composition::CLIENT must be composited with this buffer by
- * the device.
- *
- * The buffer handle provided may be empty if no layers are being
- * composited by the client. This must not result in an error (unless an
- * invalid display handle is also provided).
- *
- * Also provides a file descriptor referring to an acquire sync fence
- * object, which must be signaled when it is safe to read from the client
- * target buffer. If it is already safe to read from this buffer, an
- * empty handle may be passed instead.
- *
- * For more about dataspaces, see SET_LAYER_DATASPACE.
- *
- * The damage parameter describes a surface damage region as defined in
- * the description of SET_LAYER_SURFACE_DAMAGE.
- *
- * Will be called before PRESENT_DISPLAY if any of the layers are marked
- * as Composition::CLIENT. If no layers are so marked, then it is not
- * necessary to call this function. It is not necessary to call
- * validateDisplay after changing the target through this function.
- *
- * @param targetSlot is the client target buffer slot to use.
- * @param targetIndex is an index into inHandles for the new target
- * buffer.
- * @param acquireFenceIndex is an index into inHandles for a sync fence
- * file descriptor as described above.
- * @param dataspace is the dataspace of the buffer, as described in
- * setLayerDataspace.
- * @param damage is the surface damage region.
- *
- */
- SET_CLIENT_TARGET = 0x201 << OPCODE_SHIFT,
-
- /**
- * SET_OUTPUT_BUFFER has this pseudo prototype
- *
- * setOutputBuffer(int bufferSlot,
- * int bufferIndex,
- * int releaseFenceIndex);
- *
- * Sets the output buffer for a virtual display. That is, the buffer to
- * which the composition result will be written.
- *
- * Also provides a file descriptor referring to a release sync fence
- * object, which must be signaled when it is safe to write to the output
- * buffer. If it is already safe to write to the output buffer, an empty
- * handle may be passed instead.
- *
- * Must be called at least once before PRESENT_DISPLAY, but does not have
- * any interaction with layer state or display validation.
- *
- * @param bufferSlot is the new output buffer.
- * @param bufferIndex is the new output buffer.
- * @param releaseFenceIndex is a sync fence file descriptor as described
- * above.
- */
- SET_OUTPUT_BUFFER = 0x202 << OPCODE_SHIFT,
-
- /**
- * VALIDATE_DISPLAY has this pseudo prototype
- *
- * validateDisplay();
- *
- * Instructs the device to inspect all of the layer state and determine if
- * there are any composition type changes necessary before presenting the
- * display. Permitted changes are described in the definition of
- * Composition above.
- */
- VALIDATE_DISPLAY = 0x203 << OPCODE_SHIFT,
-
- /**
- * ACCEPT_DISPLAY_CHANGES has this pseudo prototype
- *
- * acceptDisplayChanges();
- *
- * Accepts the changes required by the device from the previous
- * validateDisplay call (which may be queried using
- * getChangedCompositionTypes) and revalidates the display. This function
- * is equivalent to requesting the changed types from
- * getChangedCompositionTypes, setting those types on the corresponding
- * layers, and then calling validateDisplay again.
- *
- * After this call it must be valid to present this display. Calling this
- * after validateDisplay returns 0 changes must succeed with NONE, but
- * must have no other effect.
- */
- ACCEPT_DISPLAY_CHANGES = 0x204 << OPCODE_SHIFT,
-
- /**
- * PRESENT_DISPLAY has this pseudo prototype
- *
- * presentDisplay();
- *
- * Presents the current display contents on the screen (or in the case of
- * virtual displays, into the output buffer).
- *
- * Prior to calling this function, the display must be successfully
- * validated with validateDisplay. Note that setLayerBuffer and
- * setLayerSurfaceDamage specifically do not count as layer state, so if
- * there are no other changes to the layer state (or to the buffer's
- * properties as described in setLayerBuffer), then it is safe to call
- * this function without first validating the display.
- */
- PRESENT_DISPLAY = 0x205 << OPCODE_SHIFT,
-
- /**
- * PRESENT_OR_VALIDATE_DISPLAY has this pseudo prototype
- *
- * presentOrValidateDisplay();
- *
- * Presents the current display contents on the screen (or in the case of
- * virtual displays, into the output buffer) if validate can be skipped,
- * or perform a VALIDATE_DISPLAY action instead.
- */
- PRESENT_OR_VALIDATE_DISPLAY = 0x206 << OPCODE_SHIFT,
-
- // layer commands (VALIDATE_DISPLAY not required)
-
- /**
- * SET_LAYER_CURSOR_POSITION has this pseudo prototype
- *
- * setLayerCursorPosition(int x, int y);
- *
- * Asynchronously sets the position of a cursor layer.
- *
- * Prior to validateDisplay, a layer may be marked as Composition::CURSOR.
- * If validation succeeds (i.e., the device does not request a composition
- * change for that layer), then once a buffer has been set for the layer
- * and it has been presented, its position may be set by this function at
- * any time between presentDisplay and any subsequent validateDisplay
- * calls for this display.
- *
- * Once validateDisplay is called, this function must not be called again
- * until the validate/present sequence is completed.
- *
- * May be called from any thread so long as it is not interleaved with the
- * validate/present sequence as described above.
- *
- * @param layer is the layer to which the position is set.
- * @param x is the new x coordinate (in pixels from the left of the
- * screen).
- * @param y is the new y coordinate (in pixels from the top of the
- * screen).
- */
- SET_LAYER_CURSOR_POSITION = 0x300 << OPCODE_SHIFT,
-
- /**
- * SET_LAYER_BUFFER has this pseudo prototype
- *
- * setLayerBuffer(int bufferSlot,
- * int bufferIndex,
- * int acquireFenceIndex);
- *
- * Sets the buffer handle to be displayed for this layer. If the buffer
- * properties set at allocation time (width, height, format, and usage)
- * have not changed since the previous frame, it is not necessary to call
- * validateDisplay before calling presentDisplay unless new state needs to
- * be validated in the interim.
- *
- * Also provides a file descriptor referring to an acquire sync fence
- * object, which must be signaled when it is safe to read from the given
- * buffer. If it is already safe to read from the buffer, an empty handle
- * may be passed instead.
- *
- * This function must return NONE and have no other effect if called for a
- * layer with a composition type of Composition::SOLID_COLOR (because it
- * has no buffer) or Composition::SIDEBAND or Composition::CLIENT (because
- * synchronization and buffer updates for these layers are handled
- * elsewhere).
- *
- * @param layer is the layer to which the buffer is set.
- * @param bufferSlot is the buffer slot to use.
- * @param bufferIndex is the buffer handle to set.
- * @param acquireFenceIndex is a sync fence file descriptor as described above.
- */
- SET_LAYER_BUFFER = 0x301 << OPCODE_SHIFT,
-
- /*
- * SET_LAYER_SURFACE_DAMAGE has this pseudo prototype
- *
- * setLayerSurfaceDamage(Rect[] damage);
- *
- * Provides the region of the source buffer which has been modified since
- * the last frame. This region does not need to be validated before
- * calling presentDisplay.
- *
- * Once set through this function, the damage region remains the same
- * until a subsequent call to this function.
- *
- * If damage is non-empty, then it may be assumed that any portion of the
- * source buffer not covered by one of the rects has not been modified
- * this frame. If damage is empty, then the whole source buffer must be
- * treated as if it has been modified.
- *
- * If the layer's contents are not modified relative to the prior frame,
- * damage must contain exactly one empty rect([0, 0, 0, 0]).
- *
- * The damage rects are relative to the pre-transformed buffer, and their
- * origin is the top-left corner. They must not exceed the dimensions of
- * the latched buffer.
- *
- * @param layer is the layer to which the damage region is set.
- * @param damage is the new surface damage region.
- */
- SET_LAYER_SURFACE_DAMAGE = 0x302 << OPCODE_SHIFT,
-
- // layer state commands (VALIDATE_DISPLAY required)
-
- /**
- * SET_LAYER_BLEND_MODE has this pseudo prototype
- *
- * setLayerBlendMode(android.hardware.graphics.common.BlendMode mode)
- *
- * Sets the blend mode of the given layer.
- *
- * @param mode is the new blend mode.
- */
- SET_LAYER_BLEND_MODE = 0x400 << OPCODE_SHIFT,
-
- /**
- * SET_LAYER_COLOR has this pseudo prototype
- *
- * setLayerColor(Color color);
- *
- * Sets the color of the given layer. If the composition type of the layer
- * is not Composition::SOLID_COLOR, this call must succeed and have no
- * other effect.
- *
- * @param color is the new color.
- */
- SET_LAYER_COLOR = 0x401 << OPCODE_SHIFT,
-
- /**
- * SET_LAYER_COMPOSITION_TYPE has this pseudo prototype
- *
- * setLayerCompositionType(Composition type);
- *
- * Sets the desired composition type of the given layer. During
- * validateDisplay, the device may request changes to the composition
- * types of any of the layers as described in the definition of
- * Composition above.
- *
- * @param type is the new composition type.
- */
- SET_LAYER_COMPOSITION_TYPE = 0x402 << OPCODE_SHIFT,
-
- /**
- * SET_LAYER_DATASPACE has this pseudo prototype
- *
- * setLayerDataspace(android.hardware.graphics.common.Dataspace dataspace);
- *
- * Sets the dataspace of the layer.
- *
- * The dataspace provides more information about how to interpret the buffer
- * or solid color, such as the encoding standard and color transform.
- *
- * See the values of Dataspace for more information.
- *
- * @param dataspace is the new dataspace.
- */
- SET_LAYER_DATASPACE = 0x403 << OPCODE_SHIFT,
-
- /**
- * SET_LAYER_DISPLAY_FRAME has this pseudo prototype
- *
- * setLayerDisplayFrame(Rect frame);
- *
- * Sets the display frame (the portion of the display covered by a layer)
- * of the given layer. This frame must not exceed the display dimensions.
- *
- * @param frame is the new display frame.
- */
- SET_LAYER_DISPLAY_FRAME = 0x404 << OPCODE_SHIFT,
-
- /**
- * SET_LAYER_PLANE_ALPHA has this pseudo prototype
- *
- * setLayerPlaneAlpha(float alpha);
- *
- * Sets an alpha value (a floating point value in the range [0.0, 1.0])
- * which will be applied to the whole layer. It can be conceptualized as a
- * preprocessing step which applies the following function:
- * if (blendMode == BlendMode::PREMULTIPLIED)
- * out.rgb = in.rgb * planeAlpha
- * out.a = in.a * planeAlpha
- *
- * If the device does not support this operation on a layer which is
- * marked Composition::DEVICE, it must request a composition type change
- * to Composition::CLIENT upon the next validateDisplay call.
- *
- * @param alpha is the plane alpha value to apply.
- */
- SET_LAYER_PLANE_ALPHA = 0x405 << OPCODE_SHIFT,
-
- /**
- * SET_LAYER_SIDEBAND_STREAM has this pseudo prototype
- *
- * setLayerSidebandStream(int streamIndex)
- *
- * Sets the sideband stream for this layer. If the composition type of the
- * given layer is not Composition::SIDEBAND, this call must succeed and
- * have no other effect.
- *
- * @param streamIndex is the new sideband stream.
- */
- SET_LAYER_SIDEBAND_STREAM = 0x406 << OPCODE_SHIFT,
-
- /**
- * SET_LAYER_SOURCE_CROP has this pseudo prototype
- *
- * setLayerSourceCrop(FRect crop);
- *
- * Sets the source crop (the portion of the source buffer which will fill
- * the display frame) of the given layer. This crop rectangle must not
- * exceed the dimensions of the latched buffer.
- *
- * If the device is not capable of supporting a true float source crop
- * (i.e., it will truncate or round the floats to integers), it must set
- * this layer to Composition::CLIENT when crop is non-integral for the
- * most accurate rendering.
- *
- * If the device cannot support float source crops, but still wants to
- * handle the layer, it must use the following code (or similar) to
- * convert to an integer crop:
- * intCrop.left = (int) ceilf(crop.left);
- * intCrop.top = (int) ceilf(crop.top);
- * intCrop.right = (int) floorf(crop.right);
- * intCrop.bottom = (int) floorf(crop.bottom);
- *
- * @param crop is the new source crop.
- */
- SET_LAYER_SOURCE_CROP = 0x407 << OPCODE_SHIFT,
-
- /**
- * SET_LAYER_TRANSFORM has this pseudo prototype
- *
- * Sets the transform (rotation/flip) of the given layer.
- *
- * setLayerTransform(Transform transform);
- *
- * @param transform is the new transform.
- */
- SET_LAYER_TRANSFORM = 0x408 << OPCODE_SHIFT,
-
- /**
- * SET_LAYER_VISIBLE_REGION has this pseudo prototype
- *
- * setLayerVisibleRegion(Rect[] visible);
- *
- * Specifies the portion of the layer that is visible, including portions
- * under translucent areas of other layers. The region is in screen space,
- * and must not exceed the dimensions of the screen.
- *
- * @param visible is the new visible region, in screen space.
- */
- SET_LAYER_VISIBLE_REGION = 0x409 << OPCODE_SHIFT,
-
- /**
- * SET_LAYER_Z_ORDER has this pseudo prototype
- *
- * setLayerZOrder(int z);
- *
- * Sets the desired Z order (height) of the given layer. A layer with a
- * greater Z value occludes a layer with a lesser Z value.
- *
- * @param z is the new Z order.
- */
- SET_LAYER_Z_ORDER = 0x40a << OPCODE_SHIFT,
-
- /**
- * SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT has this pseudo prototype
- *
- * setPresentOrValidateDisplayResult(int state);
- *
- * Sets the state of PRESENT_OR_VALIDATE_DISPLAY command.
- * @param state is the state of present or validate
- * 1 - Present Succeeded
- * 0 - Validate succeeded
- */
- SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT = 0x40b << OPCODE_SHIFT,
-
- /**
- * SET_LAYER_PER_FRAME_METADATA has this pseudo prototype
- *
- * setLayerPerFrameMetadata(long display, long layer,
- * PerFrameMetadata[] data);
- *
- * Sets the PerFrameMetadata for the display. This metadata must be used
- * by the implementation to better tone map content to that display.
- *
- * This is a method that may be called every frame. Thus it's
- * implemented using buffered transport.
- * SET_LAYER_PER_FRAME_METADATA is the command used by the buffered transport
- * mechanism.
- */
- SET_LAYER_PER_FRAME_METADATA = 0x303 << OPCODE_SHIFT,
-
- /**
- * SET_LAYER_FLOAT_COLOR has this pseudo prototype
- *
- * setLayerColor(FloatColor color);
- *
- * Sets the color of the given layer. If the composition type of the layer
- * is not Composition::SOLID_COLOR, this call must succeed and have no
- * other effect.
- *
- * @param color is the new color using float type.
- */
- SET_LAYER_FLOAT_COLOR = 0x40c << OPCODE_SHIFT,
-
- /**
- * SET_LAYER_COLOR_TRANSFORM has this pseudo prototype
- *
- * setLayerColorTransform(float[16] matrix);
- *
- * This command has the following binary layout in bytes:
- *
- * 0 - 16 * 4: matrix
- *
- * Sets a matrix for color transform which will be applied on this layer
- * before composition.
- *
- * If the device is not capable of apply the matrix on this layer, it must force
- * this layer to client composition during VALIDATE_DISPLAY.
- *
- * The matrix provided is an affine color transformation of the following
- * form:
- *
- * |r.r r.g r.b 0|
- * |g.r g.g g.b 0|
- * |b.r b.g b.b 0|
- * |Tr Tg Tb 1|
- *
- * This matrix must be provided in row-major form:
- *
- * {r.r, r.g, r.b, 0, g.r, ...}.
- *
- * Given a matrix of this form and an input color [R_in, G_in, B_in],
- * the input color must first be converted to linear space
- * [R_linear, G_linear, B_linear], then the output linear color
- * [R_out_linear, G_out_linear, B_out_linear] will be:
- *
- * R_out_linear = R_linear * r.r + G_linear * g.r + B_linear * b.r + Tr
- * G_out_linear = R_linear * r.g + G_linear * g.g + B_linear * b.g + Tg
- * B_out_linear = R_linear * r.b + G_linear * g.b + B_linear * b.b + Tb
- *
- * [R_out_linear, G_out_linear, B_out_linear] must then be converted to
- * gamma space: [R_out, G_out, B_out] before blending.
- *
- * @param matrix is a 4x4 transform matrix (16 floats) as described above.
- */
-
- SET_LAYER_COLOR_TRANSFORM = 0x40d << OPCODE_SHIFT,
- /*
- * SET_LAYER_PER_FRAME_METADATA_BLOBS has this pseudo prototype
- *
- * setLayerPerFrameMetadataBlobs(long display, long layer,
- * PerFrameMetadataBlob[] metadata);
- *
- * This command sends metadata that may be used for tone-mapping the
- * associated layer. The metadata structure follows a {key, blob}
- * format (see the PerFrameMetadataBlob struct). All keys must be
- * returned by a prior call to getPerFrameMetadataKeys and must
- * be part of the list of keys associated with blob-type metadata
- * (see PerFrameMetadataKey).
- *
- * This method may be called every frame.
- */
- SET_LAYER_PER_FRAME_METADATA_BLOBS = 0x304 << OPCODE_SHIFT,
-
- /**
- * SET_CLIENT_TARGET_PROPERTY has this pseudo prototype
- *
- * This command has the following binary layout in bytes:
- *
- * 0 - 3: clientTargetProperty.pixelFormat
- * 4 - 7: clientTargetProperty.dataspace
- * 8 - 11: whitePointNits
- *
- * The white point parameter describes the intended white point of the client target buffer.
- * When client composition blends both HDR and SDR content, the client must composite to the
- * brightness space as specified by the hardware composer. This is so that adjusting the real
- * display brightness may be applied atomically with compensating the client target output. For
- * instance, client-compositing a list of SDR layers requires dimming the brightness space of
- * the SDR buffers when an HDR layer is simultaneously device-composited.
- *
- * setClientTargetProperty(ClientTargetProperty clientTargetProperty, float whitePointNits);
- */
- SET_CLIENT_TARGET_PROPERTY = 0x105 << OPCODE_SHIFT,
-
- /**
- * SET_LAYER_GENERIC_METADATA has this pseudo prototype
- *
- * setLayerGenericMetadata(string key, bool mandatory, byte[] value);
- *
- * Sets a piece of generic metadata for the given layer. If this
- * function is called twice with the same key but different values, the
- * newer value must override the older one. Calling this function with a
- * 0-length value must reset that key's metadata as if it had not been
- * set.
- *
- * A given piece of metadata may either be mandatory or a hint
- * (non-mandatory) as indicated by the second parameter. Mandatory
- * metadata may affect the composition result, which is to say that it
- * may cause a visible change in the final image. By contrast, hints may
- * only affect the composition strategy, such as which layers are
- * composited by the client, but must not cause a visible change in the
- * final image. The value of the mandatory flag shall match the value
- * returned from getLayerGenericMetadataKeys for the given key.
- *
- * Only keys which have been returned from getLayerGenericMetadataKeys()
- * shall be accepted. Any other keys must result in an UNSUPPORTED error.
- *
- * The value passed into this function shall be the binary
- * representation of a HIDL type corresponding to the given key. For
- * example, a key of 'com.example.V1_3.Foo' shall be paired with a
- * value of type com.example@1.3::Foo, which would be defined in a
- * vendor HAL extension.
- *
- * This function will be encoded in the command buffer in this order:
- * 1) The key length, stored as a uint32_t
- * 2) The key itself, padded to a uint32_t boundary if necessary
- * 3) The mandatory flag, stored as a uint32_t
- * 4) The value length in bytes, stored as a uint32_t
- * 5) The value itself, padded to a uint32_t boundary if necessary
- *
- * @param key indicates which metadata value should be set on this layer
- * @param mandatory indicates whether this particular key represents
- * mandatory metadata or a hint (non-mandatory metadata), as
- * described above
- * @param value is a binary representation of a HIDL struct
- * corresponding to the key as described above
- */
- SET_LAYER_GENERIC_METADATA = 0x40e << OPCODE_SHIFT,
-
- /**
- * SET_LAYER_WHITE_POINT_NITS has this pseudo prototype
- *
- * setLayerWhitePointNits(float sdrWhitePointNits);
- *
- * Sets the desired white point for the layer. This is intended to be used when presenting
- * an SDR layer alongside HDR content. The HDR content will be presented at the display
- * brightness in nits, and accordingly SDR content shall be dimmed to the desired white point
- * provided.
- *
- * @param whitePointNits is the white point in nits.
- */
- SET_LAYER_WHITE_POINT_NITS = 0x305 << OPCODE_SHIFT,
-}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandError.aidl
similarity index 78%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/CommandError.aidl
index 0a93c9e..ea48600 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandError.aidl
@@ -16,18 +16,14 @@
package android.hardware.graphics.composer3;
-/**
- * Special index values (always negative) for command queue commands.
- */
@VintfStability
-@Backing(type="int")
-enum HandleIndex {
+parcelable CommandError {
/**
- * No handle
+ * The index in the command payload array.
*/
- EMPTY = -1,
+ int commandIndex;
/**
- * Use cached handle
+ * The error generated by the command. Can be one of the IComposerClient.EX_*
*/
- CACHED = -2,
+ int errorCode;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl
new file mode 100644
index 0000000..f2de68e
--- /dev/null
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl
@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2021, 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.graphics.composer3;
+
+import android.hardware.graphics.composer3.ChangedCompositionTypes;
+import android.hardware.graphics.composer3.ClientTargetPropertyWithNits;
+import android.hardware.graphics.composer3.CommandError;
+import android.hardware.graphics.composer3.DisplayRequest;
+import android.hardware.graphics.composer3.PresentFence;
+import android.hardware.graphics.composer3.PresentOrValidate;
+import android.hardware.graphics.composer3.ReleaseFences;
+
+@VintfStability
+union CommandResultPayload {
+ /**
+ * Indicates an error generated by a command.
+ */
+ CommandError error;
+
+ /**
+ * Sets the layers for which the device requires a different composition
+ * type than had been set prior to the last call to VALIDATE_DISPLAY. The
+ * client must either update its state with these types and call
+ * ACCEPT_DISPLAY_CHANGES, or must set new types and attempt to validate
+ * the display again.
+ */
+ ChangedCompositionTypes changedCompositionTypes;
+
+ /**
+ * Sets the display requests and the layer requests required for the last
+ * validated configuration.
+ *
+ * Display requests provide information about how the client must handle
+ * the client target. Layer requests provide information about how the
+ * client must handle an individual layer.
+ */
+ DisplayRequest displayRequest;
+
+ /**
+ * Sets the present fence as a result of PRESENT_DISPLAY. For physical
+ * displays, this fence must be signaled at the vsync when the result
+ * of composition of this frame starts to appear (for video-mode panels)
+ * or starts to transfer to panel memory (for command-mode panels). For
+ * virtual displays, this fence must be signaled when writes to the output
+ * buffer have completed and it is safe to read from it.
+ */
+ PresentFence presentFence;
+
+ /**
+ * Sets the release fences for device layers on this display which will
+ * receive new buffer contents this frame.
+ *
+ * A release fence is a file descriptor referring to a sync fence object
+ * which must be signaled after the device has finished reading from the
+ * buffer presented in the prior frame. This indicates that it is safe to
+ * start writing to the buffer again. If a given layer's fence is not
+ * returned from this function, it must be assumed that the buffer
+ * presented on the previous frame is ready to be written.
+ *
+ * The fences returned by this function must be unique for each layer
+ * (even if they point to the same underlying sync object).
+ *
+ */
+ ReleaseFences releaseFences;
+
+ /**
+ * Sets the state of PRESENT_OR_VALIDATE_DISPLAY command.
+ */
+ PresentOrValidate presentOrValidateResult;
+
+ /**
+ * The white point parameter describes the intended white point of the client target buffer.
+ * When client composition blends both HDR and SDR content, the client must composite to the
+ * brightness space as specified by the hardware composer. This is so that adjusting the real
+ * display brightness may be applied atomically with compensating the client target output. For
+ * instance, client-compositing a list of SDR layers requires dimming the brightness space of
+ * the SDR buffers when an HDR layer is simultaneously device-composited.
+ */
+ ClientTargetPropertyWithNits clientTargetProperty;
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl
index ea22af2..803de06 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl
@@ -66,11 +66,25 @@
/**
* The device must handle the composition of this layer, as well as
* its buffer updates and content synchronization. Only supported on
- * devices which provide Capability::SIDEBAND_STREAM.
+ * devices which provide Capability.SIDEBAND_STREAM.
*
* Upon validateDisplay, the device may request a change from this
* type to either DEVICE or CLIENT, but it is unlikely that content
* will display correctly in these cases.
*/
SIDEBAND = 5,
+ /**
+ * A display decoration layer contains a buffer which is used to provide
+ * anti-aliasing on the cutout region/rounded corners on the top and
+ * bottom of a display.
+ *
+ * Pixels in the buffer with an alpha of 0 (transparent) will show the
+ * content underneath, and pixels with a max alpha value will be rendered in
+ * black. An alpha in between will show the underlying content blended with
+ * black.
+ *
+ * Upon validateDisplay, the device may request a change from this type
+ * to either DEVICE or CLIENT.
+ */
+ DISPLAY_DECORATION = 6,
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl
index 54f09c1..eacf106 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl
@@ -41,14 +41,15 @@
*/
SKIP_CLIENT_COLOR_TRANSFORM = 1,
/**
- * Indicates that the display supports PowerMode::DOZE and
- * PowerMode::DOZE_SUSPEND. DOZE_SUSPEND may not provide any benefit
+ * Indicates that the display supports PowerMode.DOZE and
+ * potentially PowerMode.DOZE_SUSPEND if DisplayCapability.SUSPEND is also
+ * supported. DOZE_SUSPEND may not provide any benefit
* over DOZE (see the definition of PowerMode for more information),
* but if both DOZE and DOZE_SUSPEND are no different from
- * PowerMode::ON, the device must not claim support.
+ * PowerMode.ON, the device must not claim support.
* Must be returned by getDisplayCapabilities when getDozeSupport
- * indicates the display supports PowerMode::DOZE and
- * PowerMode::DOZE_SUSPEND.
+ * indicates the display supports PowerMode.DOZE and
+ * PowerMode.DOZE_SUSPEND.
*/
DOZE = 2,
/**
@@ -66,4 +67,12 @@
* support a low latency mode, such as HDMI 2.1 Auto Low Latency Mode.
*/
AUTO_LOW_LATENCY_MODE = 5,
+ /**
+ * Indicates that the display supports PowerMode.ON_SUSPEND.
+ * If PowerMode.ON_SUSPEND is no different from PowerMode.ON, the device must not
+ * claim support.
+ * If the display supports DisplayCapability.DOZE and DisplayCapability.SUSPEND, then
+ * PowerMode.ON_SUSPEND and PowerMode.DOZE_SUSPEND must be supported.
+ */
+ SUSPEND = 6,
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl
new file mode 100644
index 0000000..18461ad
--- /dev/null
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl
@@ -0,0 +1,162 @@
+/**
+ * Copyright (c) 2021, 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.graphics.composer3;
+
+import android.hardware.graphics.composer3.Buffer;
+import android.hardware.graphics.composer3.ClientTarget;
+import android.hardware.graphics.composer3.ClockMonotonicTimestamp;
+import android.hardware.graphics.composer3.LayerCommand;
+
+@VintfStability
+parcelable DisplayCommand {
+ /**
+ * The display which this commands refers to.
+ * @see IComposer.createDisplay
+ */
+ long display;
+
+ /**
+ * Sets layer commands for this display.
+ * @see LayerCommand.
+ */
+ LayerCommand[] layers;
+
+ /**
+ * Sets a color transform which will be applied after composition.
+ *
+ * If the device is not capable of either using the matrix to
+ * apply the desired color transform, it must force all layers to client
+ * composition during VALIDATE_DISPLAY.
+ *
+ * If Capability.SKIP_CLIENT_COLOR_TRANSFORM is present, then
+ * the client must never apply the color transform during client
+ * composition, even if all layers are being composed by the client.
+ *
+ * The matrix provided is an affine color transformation of the following
+ * form:
+ *
+ * |r.r r.g r.b 0|
+ * |g.r g.g g.b 0|
+ * |b.r b.g b.b 0|
+ * |Tr Tg Tb 1|
+ *
+ * This matrix must be provided in row-major form:
+ *
+ * {r.r, r.g, r.b, 0, g.r, ...}.
+ *
+ * Given a matrix of this form and an input color [R_in, G_in, B_in], the
+ * output color [R_out, G_out, B_out] will be:
+ *
+ * R_out = R_in * r.r + G_in * g.r + B_in * b.r + Tr
+ * G_out = R_in * r.g + G_in * g.g + B_in * b.g + Tg
+ * B_out = R_in * r.b + G_in * g.b + B_in * b.b + Tb
+ *
+ */
+ @nullable float[] colorTransformMatrix;
+
+ /**
+ * Sets the buffer handle which will receive the output of client
+ * composition. Layers marked as Composition.CLIENT must be composited
+ * into this buffer prior to the call to PRESENT_DISPLAY, and layers not
+ * marked as Composition.CLIENT must be composited with this buffer by
+ * the device.
+ *
+ * The buffer handle provided may be empty if no layers are being
+ * composited by the client. This must not result in an error (unless an
+ * invalid display handle is also provided).
+ *
+ * Also provides a file descriptor referring to an acquire sync fence
+ * object, which must be signaled when it is safe to read from the client
+ * target buffer. If it is already safe to read from this buffer, an
+ * empty handle may be passed instead.
+ *
+ * For more about dataspaces, see SET_LAYER_DATASPACE.
+ *
+ * The damage parameter describes a surface damage region as defined in
+ * the description of SET_LAYER_SURFACE_DAMAGE.
+ *
+ * Will be called before PRESENT_DISPLAY if any of the layers are marked
+ * as Composition.CLIENT. If no layers are so marked, then it is not
+ * necessary to call this function. It is not necessary to call
+ * validateDisplay after changing the target through this function.
+ */
+ @nullable ClientTarget clientTarget;
+
+ /**
+ * Sets the output buffer for a virtual display. That is, the buffer to
+ * which the composition result will be written.
+ *
+ * Also provides a file descriptor referring to a release sync fence
+ * object, which must be signaled when it is safe to write to the output
+ * buffer. If it is already safe to write to the output buffer, an empty
+ * handle may be passed instead.
+ *
+ * Must be called at least once before PRESENT_DISPLAY, but does not have
+ * any interaction with layer state or display validation.
+ */
+ @nullable Buffer virtualDisplayOutputBuffer;
+
+ /**
+ * Sets the expected present time to present the current content on screen.
+ * The implementation should try to present the display as close as possible
+ * to the given expectedPresentTime. If expectedPresentTime is 0, the
+ * implementation should present the display as soon as possible.
+ */
+ @nullable ClockMonotonicTimestamp expectedPresentTime;
+
+ /**
+ * Instructs the device to inspect all of the layer state and determine if
+ * there are any composition type changes necessary before presenting the
+ * display. Permitted changes are described in the definition of
+ * Composition above.
+ */
+ boolean validateDisplay;
+
+ /**
+ * Accepts the changes required by the device from the previous
+ * validateDisplay call (which may be queried using
+ * getChangedCompositionTypes) and revalidates the display. This function
+ * is equivalent to requesting the changed types from
+ * getChangedCompositionTypes, setting those types on the corresponding
+ * layers, and then calling validateDisplay again.
+ *
+ * After this call it must be valid to present this display. Calling this
+ * after validateDisplay returns 0 changes must succeed with NONE, but
+ * must have no other effect.
+ */
+ boolean acceptDisplayChanges;
+
+ /**
+ * Presents the current display contents on the screen (or in the case of
+ * virtual displays, into the output buffer).
+ *
+ * Prior to calling this function, the display must be successfully
+ * validated with validateDisplay. Note that setLayerBuffer and
+ * setLayerSurfaceDamage specifically do not count as layer state, so if
+ * there are no other changes to the layer state (or to the buffer's
+ * properties as described in setLayerBuffer), then it is safe to call
+ * this function without first validating the display.
+ */
+ boolean presentDisplay;
+
+ /**
+ * Presents the current display contents on the screen (or in the case of
+ * virtual displays, into the output buffer) if validate can be skipped,
+ * or perform a VALIDATE_DISPLAY action instead.
+ */
+ boolean presentOrValidateDisplay;
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl
index 4b3d31a..27fe1e6 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl
@@ -16,22 +16,57 @@
package android.hardware.graphics.composer3;
-/**
- * Display requests returned by getDisplayRequests.
- */
@VintfStability
-@Backing(type="int")
-enum DisplayRequest {
+parcelable DisplayRequest {
/**
* Instructs the client to provide a new client target buffer, even if
* no layers are marked for client composition.
*/
- FLIP_CLIENT_TARGET = 1 << 0,
+ const int FLIP_CLIENT_TARGET = 1 << 0;
+
/**
* Instructs the client to write the result of client composition
* directly into the virtual display output buffer. If any of the
- * layers are not marked as Composition::CLIENT or the given display
+ * layers are not marked as Composition.CLIENT or the given display
* is not a virtual display, this request has no effect.
*/
- WRITE_CLIENT_TARGET_TO_OUTPUT = 1 << 1,
+ const int WRITE_CLIENT_TARGET_TO_OUTPUT = 1 << 1;
+
+ /**
+ * The display which this commands refers to.
+ * @see IComposer.createDisplay
+ */
+ long display;
+
+ /**
+ * The display requests for the current validated state. This must be a
+ * bitwise-or of the constants in `DisplayRequest`.
+ */
+ int mask;
+
+ @VintfStability
+ parcelable LayerRequest {
+ /**
+ * The client must clear its target with transparent pixels where
+ * this layer would be. The client may ignore this request if the
+ * layer must be blended.
+ */
+ const int CLEAR_CLIENT_TARGET = 1 << 0;
+
+ /**
+ * The layer which this commands refers to.
+ * @see IComposer.createLayer
+ */
+ long layer;
+ /**
+ * The layer requests for the current validated state. This must be a
+ * bitwise-or of the constants in `LayerRequest`.
+ */
+ int mask;
+ }
+
+ /**
+ * The layer requests for the current validated state.
+ */
+ LayerRequest[] layerRequests;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
deleted file mode 100644
index f67c3ce..0000000
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Copyright (c) 2021, 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.graphics.composer3;
-
-/**
- * Output parameters for IComposerClient.executeCommands
- */
-@VintfStability
-parcelable ExecuteCommandsStatus {
- /**
- * Indicates whether the output command message queue has changed.
- */
- boolean queueChanged;
- /**
- * Indicates whether the output command message queue has changed.
- */
- int length;
- /**
- * An array of handles referenced by the output commands.
- */
- android.hardware.common.NativeHandle[] handles;
-}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Hidl2AidlAsserts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/Hidl2AidlAsserts.cpp
new file mode 100644
index 0000000..d34b405
--- /dev/null
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Hidl2AidlAsserts.cpp
@@ -0,0 +1,354 @@
+/**
+ * Copyright (c) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl/android/hardware/graphics/common/BlendMode.h"
+#include "aidl/android/hardware/graphics/common/FRect.h"
+#include "aidl/android/hardware/graphics/common/Rect.h"
+#include "aidl/android/hardware/graphics/composer3/Capability.h"
+#include "aidl/android/hardware/graphics/composer3/ClientTargetProperty.h"
+#include "aidl/android/hardware/graphics/composer3/Color.h"
+#include "aidl/android/hardware/graphics/composer3/Composition.h"
+#include "aidl/android/hardware/graphics/composer3/ContentType.h"
+#include "aidl/android/hardware/graphics/composer3/DisplayAttribute.h"
+#include "aidl/android/hardware/graphics/composer3/DisplayCapability.h"
+#include "aidl/android/hardware/graphics/composer3/DisplayConnectionType.h"
+#include "aidl/android/hardware/graphics/composer3/FloatColor.h"
+#include "aidl/android/hardware/graphics/composer3/FormatColorComponent.h"
+#include "aidl/android/hardware/graphics/composer3/IComposer.h"
+#include "aidl/android/hardware/graphics/composer3/PerFrameMetadata.h"
+#include "aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h"
+#include "aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.h"
+#include "aidl/android/hardware/graphics/composer3/PowerMode.h"
+#include "aidl/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.h"
+#include "aidl/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.h"
+#include "android/hardware/graphics/composer/2.1/IComposer.h"
+#include "android/hardware/graphics/composer/2.1/IComposerCallback.h"
+#include "android/hardware/graphics/composer/2.1/IComposerClient.h"
+#include "android/hardware/graphics/composer/2.2/IComposerClient.h"
+#include "android/hardware/graphics/composer/2.3/IComposerClient.h"
+#include "android/hardware/graphics/composer/2.4/IComposerClient.h"
+#include "android/hardware/graphics/composer/2.4/types.h"
+
+namespace android::h2a {
+
+static_assert(
+ aidl::android::hardware::graphics::composer3::IComposer::EX_NO_RESOURCES ==
+ static_cast<int32_t>(::android::hardware::graphics::composer::V2_4::Error::NO_RESOURCES));
+
+static_assert(
+ aidl::android::hardware::graphics::composer3::IComposerClient::EX_BAD_CONFIG ==
+ static_cast<int32_t>(::android::hardware::graphics::composer::V2_4::Error::BAD_CONFIG));
+static_assert(
+ aidl::android::hardware::graphics::composer3::IComposerClient::EX_BAD_DISPLAY ==
+ static_cast<int32_t>(::android::hardware::graphics::composer::V2_4::Error::BAD_DISPLAY));
+static_assert(
+ aidl::android::hardware::graphics::composer3::IComposerClient::EX_BAD_LAYER ==
+ static_cast<int32_t>(::android::hardware::graphics::composer::V2_4::Error::BAD_LAYER));
+static_assert(
+ aidl::android::hardware::graphics::composer3::IComposerClient::EX_BAD_PARAMETER ==
+ static_cast<int32_t>(::android::hardware::graphics::composer::V2_4::Error::BAD_PARAMETER));
+static_assert(
+ aidl::android::hardware::graphics::composer3::IComposerClient::EX_NO_RESOURCES ==
+ static_cast<int32_t>(::android::hardware::graphics::composer::V2_4::Error::NO_RESOURCES));
+static_assert(
+ aidl::android::hardware::graphics::composer3::IComposerClient::EX_NOT_VALIDATED ==
+ static_cast<int32_t>(::android::hardware::graphics::composer::V2_4::Error::NOT_VALIDATED));
+static_assert(
+ aidl::android::hardware::graphics::composer3::IComposerClient::EX_UNSUPPORTED ==
+ static_cast<int32_t>(::android::hardware::graphics::composer::V2_4::Error::UNSUPPORTED));
+static_assert(
+ aidl::android::hardware::graphics::composer3::IComposerClient::EX_SEAMLESS_NOT_ALLOWED ==
+ static_cast<int32_t>(
+ ::android::hardware::graphics::composer::V2_4::Error::SEAMLESS_NOT_ALLOWED));
+static_assert(
+ aidl::android::hardware::graphics::composer3::IComposerClient::EX_SEAMLESS_NOT_POSSIBLE ==
+ static_cast<int32_t>(
+ ::android::hardware::graphics::composer::V2_4::Error::SEAMLESS_NOT_POSSIBLE));
+
+static_assert(
+ aidl::android::hardware::graphics::composer3::Capability::INVALID ==
+ static_cast<aidl::android::hardware::graphics::composer3::Capability>(
+ ::android::hardware::graphics::composer::V2_1::IComposer::Capability::INVALID));
+static_assert(aidl::android::hardware::graphics::composer3::Capability::SIDEBAND_STREAM ==
+ static_cast<aidl::android::hardware::graphics::composer3::Capability>(
+ ::android::hardware::graphics::composer::V2_1::IComposer::Capability::
+ SIDEBAND_STREAM));
+static_assert(
+ aidl::android::hardware::graphics::composer3::Capability::SKIP_CLIENT_COLOR_TRANSFORM ==
+ static_cast<aidl::android::hardware::graphics::composer3::Capability>(
+ ::android::hardware::graphics::composer::V2_1::IComposer::Capability::
+ SKIP_CLIENT_COLOR_TRANSFORM));
+static_assert(
+ aidl::android::hardware::graphics::composer3::Capability::PRESENT_FENCE_IS_NOT_RELIABLE ==
+ static_cast<aidl::android::hardware::graphics::composer3::Capability>(
+ ::android::hardware::graphics::composer::V2_1::IComposer::Capability::
+ PRESENT_FENCE_IS_NOT_RELIABLE));
+// HWC2_CAPABILITY_SKIP_VALIDATE was never defined for HIDL, so we just hardcode its value
+static_assert(aidl::android::hardware::graphics::composer3::Capability::SKIP_VALIDATE ==
+ static_cast<aidl::android::hardware::graphics::composer3::Capability>(4));
+
+static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest::LayerRequest::
+ CLEAR_CLIENT_TARGET ==
+ static_cast<int>(::android::hardware::graphics::composer::V2_1::IComposerClient::
+ LayerRequest::CLEAR_CLIENT_TARGET));
+
+static_assert(aidl::android::hardware::graphics::common::BlendMode::INVALID ==
+ static_cast<aidl::android::hardware::graphics::common::BlendMode>(
+ ::android::hardware::graphics::composer::V2_1::IComposerClient::BlendMode::
+ INVALID));
+static_assert(
+ aidl::android::hardware::graphics::common::BlendMode::NONE ==
+ static_cast<aidl::android::hardware::graphics::common::BlendMode>(
+ ::android::hardware::graphics::composer::V2_1::IComposerClient::BlendMode::NONE));
+static_assert(aidl::android::hardware::graphics::common::BlendMode::PREMULTIPLIED ==
+ static_cast<aidl::android::hardware::graphics::common::BlendMode>(
+ ::android::hardware::graphics::composer::V2_1::IComposerClient::BlendMode::
+ PREMULTIPLIED));
+static_assert(aidl::android::hardware::graphics::common::BlendMode::COVERAGE ==
+ static_cast<aidl::android::hardware::graphics::common::BlendMode>(
+ ::android::hardware::graphics::composer::V2_1::IComposerClient::BlendMode::
+ COVERAGE));
+
+static_assert(aidl::android::hardware::graphics::composer3::Composition::INVALID ==
+ static_cast<aidl::android::hardware::graphics::composer3::Composition>(
+ ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition::
+ INVALID));
+static_assert(aidl::android::hardware::graphics::composer3::Composition::CLIENT ==
+ static_cast<aidl::android::hardware::graphics::composer3::Composition>(
+ ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition::
+ CLIENT));
+static_assert(aidl::android::hardware::graphics::composer3::Composition::DEVICE ==
+ static_cast<aidl::android::hardware::graphics::composer3::Composition>(
+ ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition::
+ DEVICE));
+static_assert(aidl::android::hardware::graphics::composer3::Composition::SOLID_COLOR ==
+ static_cast<aidl::android::hardware::graphics::composer3::Composition>(
+ ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition::
+ SOLID_COLOR));
+static_assert(aidl::android::hardware::graphics::composer3::Composition::CURSOR ==
+ static_cast<aidl::android::hardware::graphics::composer3::Composition>(
+ ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition::
+ CURSOR));
+static_assert(aidl::android::hardware::graphics::composer3::Composition::SIDEBAND ==
+ static_cast<aidl::android::hardware::graphics::composer3::Composition>(
+ ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition::
+ SIDEBAND));
+
+static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest::FLIP_CLIENT_TARGET ==
+ static_cast<int>(::android::hardware::graphics::composer::V2_1::IComposerClient::
+ DisplayRequest::FLIP_CLIENT_TARGET));
+static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest::
+ WRITE_CLIENT_TARGET_TO_OUTPUT ==
+ static_cast<int>(::android::hardware::graphics::composer::V2_1::IComposerClient::
+ DisplayRequest::WRITE_CLIENT_TARGET_TO_OUTPUT));
+
+static_assert(
+ aidl::android::hardware::graphics::composer3::PowerMode::OFF ==
+ static_cast<aidl::android::hardware::graphics::composer3::PowerMode>(
+ ::android::hardware::graphics::composer::V2_2::IComposerClient::PowerMode::OFF));
+static_assert(
+ aidl::android::hardware::graphics::composer3::PowerMode::DOZE ==
+ static_cast<aidl::android::hardware::graphics::composer3::PowerMode>(
+ ::android::hardware::graphics::composer::V2_2::IComposerClient::PowerMode::DOZE));
+static_assert(aidl::android::hardware::graphics::composer3::PowerMode::DOZE_SUSPEND ==
+ static_cast<aidl::android::hardware::graphics::composer3::PowerMode>(
+ ::android::hardware::graphics::composer::V2_2::IComposerClient::PowerMode::
+ DOZE_SUSPEND));
+static_assert(
+ aidl::android::hardware::graphics::composer3::PowerMode::ON ==
+ static_cast<aidl::android::hardware::graphics::composer3::PowerMode>(
+ ::android::hardware::graphics::composer::V2_2::IComposerClient::PowerMode::ON));
+static_assert(aidl::android::hardware::graphics::composer3::PowerMode::ON_SUSPEND ==
+ static_cast<aidl::android::hardware::graphics::composer3::PowerMode>(
+ ::android::hardware::graphics::composer::V2_2::IComposerClient::PowerMode::
+ ON_SUSPEND));
+
+static_assert(aidl::android::hardware::graphics::composer3::DisplayCapability::INVALID ==
+ static_cast<aidl::android::hardware::graphics::composer3::DisplayCapability>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::
+ DisplayCapability::INVALID));
+static_assert(aidl::android::hardware::graphics::composer3::DisplayCapability::
+ SKIP_CLIENT_COLOR_TRANSFORM ==
+ static_cast<aidl::android::hardware::graphics::composer3::DisplayCapability>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::
+ DisplayCapability::SKIP_CLIENT_COLOR_TRANSFORM));
+static_assert(aidl::android::hardware::graphics::composer3::DisplayCapability::DOZE ==
+ static_cast<aidl::android::hardware::graphics::composer3::DisplayCapability>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::
+ DisplayCapability::DOZE));
+static_assert(aidl::android::hardware::graphics::composer3::DisplayCapability::BRIGHTNESS ==
+ static_cast<aidl::android::hardware::graphics::composer3::DisplayCapability>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::
+ DisplayCapability::BRIGHTNESS));
+static_assert(aidl::android::hardware::graphics::composer3::DisplayCapability::PROTECTED_CONTENTS ==
+ static_cast<aidl::android::hardware::graphics::composer3::DisplayCapability>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::
+ DisplayCapability::PROTECTED_CONTENTS));
+static_assert(
+ aidl::android::hardware::graphics::composer3::DisplayCapability::AUTO_LOW_LATENCY_MODE ==
+ static_cast<aidl::android::hardware::graphics::composer3::DisplayCapability>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::DisplayCapability::
+ AUTO_LOW_LATENCY_MODE));
+
+static_assert(aidl::android::hardware::graphics::composer3::DisplayAttribute::INVALID ==
+ static_cast<aidl::android::hardware::graphics::composer3::DisplayAttribute>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::
+ INVALID));
+static_assert(
+ aidl::android::hardware::graphics::composer3::DisplayAttribute::WIDTH ==
+ static_cast<aidl::android::hardware::graphics::composer3::DisplayAttribute>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::WIDTH));
+static_assert(
+ aidl::android::hardware::graphics::composer3::DisplayAttribute::HEIGHT ==
+ static_cast<aidl::android::hardware::graphics::composer3::DisplayAttribute>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::HEIGHT));
+static_assert(aidl::android::hardware::graphics::composer3::DisplayAttribute::VSYNC_PERIOD ==
+ static_cast<aidl::android::hardware::graphics::composer3::DisplayAttribute>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::
+ VSYNC_PERIOD));
+static_assert(
+ aidl::android::hardware::graphics::composer3::DisplayAttribute::DPI_X ==
+ static_cast<aidl::android::hardware::graphics::composer3::DisplayAttribute>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::DPI_X));
+static_assert(
+ aidl::android::hardware::graphics::composer3::DisplayAttribute::DPI_Y ==
+ static_cast<aidl::android::hardware::graphics::composer3::DisplayAttribute>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::DPI_Y));
+static_assert(aidl::android::hardware::graphics::composer3::DisplayAttribute::CONFIG_GROUP ==
+ static_cast<aidl::android::hardware::graphics::composer3::DisplayAttribute>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::
+ CONFIG_GROUP));
+
+static_assert(aidl::android::hardware::graphics::composer3::DisplayConnectionType::INTERNAL ==
+ static_cast<aidl::android::hardware::graphics::composer3::DisplayConnectionType>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::
+ DisplayConnectionType::INTERNAL));
+static_assert(aidl::android::hardware::graphics::composer3::DisplayConnectionType::EXTERNAL ==
+ static_cast<aidl::android::hardware::graphics::composer3::DisplayConnectionType>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::
+ DisplayConnectionType::EXTERNAL));
+
+static_assert(
+ aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::DISPLAY_RED_PRIMARY_X ==
+ static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
+ ::android::hardware::graphics::composer::V2_3::IComposerClient::
+ PerFrameMetadataKey::DISPLAY_RED_PRIMARY_X));
+static_assert(
+ aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::DISPLAY_RED_PRIMARY_Y ==
+ static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
+ ::android::hardware::graphics::composer::V2_3::IComposerClient::
+ PerFrameMetadataKey::DISPLAY_RED_PRIMARY_Y));
+static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::
+ DISPLAY_GREEN_PRIMARY_X ==
+ static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
+ ::android::hardware::graphics::composer::V2_3::IComposerClient::
+ PerFrameMetadataKey::DISPLAY_GREEN_PRIMARY_X));
+static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::
+ DISPLAY_GREEN_PRIMARY_Y ==
+ static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
+ ::android::hardware::graphics::composer::V2_3::IComposerClient::
+ PerFrameMetadataKey::DISPLAY_GREEN_PRIMARY_Y));
+static_assert(
+ aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_X ==
+ static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
+ ::android::hardware::graphics::composer::V2_3::IComposerClient::
+ PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_X));
+static_assert(
+ aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_Y ==
+ static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
+ ::android::hardware::graphics::composer::V2_3::IComposerClient::
+ PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_Y));
+static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::WHITE_POINT_X ==
+ static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
+ ::android::hardware::graphics::composer::V2_3::IComposerClient::
+ PerFrameMetadataKey::WHITE_POINT_X));
+static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::WHITE_POINT_Y ==
+ static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
+ ::android::hardware::graphics::composer::V2_3::IComposerClient::
+ PerFrameMetadataKey::WHITE_POINT_Y));
+static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::MAX_LUMINANCE ==
+ static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
+ ::android::hardware::graphics::composer::V2_3::IComposerClient::
+ PerFrameMetadataKey::MAX_LUMINANCE));
+static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::MIN_LUMINANCE ==
+ static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
+ ::android::hardware::graphics::composer::V2_3::IComposerClient::
+ PerFrameMetadataKey::MIN_LUMINANCE));
+static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::
+ MAX_CONTENT_LIGHT_LEVEL ==
+ static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
+ ::android::hardware::graphics::composer::V2_3::IComposerClient::
+ PerFrameMetadataKey::MAX_CONTENT_LIGHT_LEVEL));
+static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::
+ MAX_FRAME_AVERAGE_LIGHT_LEVEL ==
+ static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
+ ::android::hardware::graphics::composer::V2_3::IComposerClient::
+ PerFrameMetadataKey::MAX_FRAME_AVERAGE_LIGHT_LEVEL));
+static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::HDR10_PLUS_SEI ==
+ static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
+ ::android::hardware::graphics::composer::V2_3::IComposerClient::
+ PerFrameMetadataKey::HDR10_PLUS_SEI));
+
+static_assert(
+ aidl::android::hardware::graphics::composer3::FormatColorComponent::FORMAT_COMPONENT_0 ==
+ static_cast<aidl::android::hardware::graphics::composer3::FormatColorComponent>(
+ ::android::hardware::graphics::composer::V2_3::IComposerClient::
+ FormatColorComponent::FORMAT_COMPONENT_0));
+static_assert(
+ aidl::android::hardware::graphics::composer3::FormatColorComponent::FORMAT_COMPONENT_1 ==
+ static_cast<aidl::android::hardware::graphics::composer3::FormatColorComponent>(
+ ::android::hardware::graphics::composer::V2_3::IComposerClient::
+ FormatColorComponent::FORMAT_COMPONENT_1));
+static_assert(
+ aidl::android::hardware::graphics::composer3::FormatColorComponent::FORMAT_COMPONENT_2 ==
+ static_cast<aidl::android::hardware::graphics::composer3::FormatColorComponent>(
+ ::android::hardware::graphics::composer::V2_3::IComposerClient::
+ FormatColorComponent::FORMAT_COMPONENT_2));
+static_assert(
+ aidl::android::hardware::graphics::composer3::FormatColorComponent::FORMAT_COMPONENT_3 ==
+ static_cast<aidl::android::hardware::graphics::composer3::FormatColorComponent>(
+ ::android::hardware::graphics::composer::V2_3::IComposerClient::
+ FormatColorComponent::FORMAT_COMPONENT_3));
+
+static_assert(
+ aidl::android::hardware::graphics::composer3::ContentType::NONE ==
+ static_cast<aidl::android::hardware::graphics::composer3::ContentType>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::ContentType::NONE));
+static_assert(aidl::android::hardware::graphics::composer3::ContentType::GRAPHICS ==
+ static_cast<aidl::android::hardware::graphics::composer3::ContentType>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::ContentType::
+ GRAPHICS));
+static_assert(aidl::android::hardware::graphics::composer3::ContentType::PHOTO ==
+ static_cast<aidl::android::hardware::graphics::composer3::ContentType>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::ContentType::
+ PHOTO));
+static_assert(aidl::android::hardware::graphics::composer3::ContentType::CINEMA ==
+ static_cast<aidl::android::hardware::graphics::composer3::ContentType>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::ContentType::
+ CINEMA));
+static_assert(
+ aidl::android::hardware::graphics::composer3::ContentType::GAME ==
+ static_cast<aidl::android::hardware::graphics::composer3::ContentType>(
+ ::android::hardware::graphics::composer::V2_4::IComposerClient::ContentType::GAME));
+
+static_assert(
+ aidl::android::hardware::graphics::composer3::PresentOrValidate::Result::Presented ==
+ static_cast<aidl::android::hardware::graphics::composer3::PresentOrValidate::Result>(1));
+static_assert(
+ aidl::android::hardware::graphics::composer3::PresentOrValidate::Result::Validated ==
+ static_cast<aidl::android::hardware::graphics::composer3::PresentOrValidate::Result>(0));
+
+} // namespace android::h2a
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposer.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposer.aidl
index a6a9f73..b8edd80 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposer.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposer.aidl
@@ -27,7 +27,7 @@
const int EX_NO_RESOURCES = 6;
/**
- * Creates a v2.4 client of the composer. Supersedes @2.3::createClient.
+ * Creates a client of the composer.
*
* @return is the newly created client.
*
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl
index 1709e6d..ac95b41 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl
@@ -26,7 +26,7 @@
* must trigger at least one hotplug notification, even if it only occurs
* immediately after callback registration.
*
- * Displays which have been connected are assumed to be in PowerMode::OFF,
+ * Displays which have been connected are assumed to be in PowerMode.OFF,
* and the onVsync callback should not be called for a display until vsync
* has been enabled with setVsyncEnabled.
*
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
index 230980d..ab7f397 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -16,23 +16,20 @@
package android.hardware.graphics.composer3;
-import android.hardware.common.fmq.MQDescriptor;
-import android.hardware.common.fmq.SynchronizedReadWrite;
import android.hardware.graphics.composer3.ClientTargetProperty;
import android.hardware.graphics.composer3.ColorMode;
-import android.hardware.graphics.composer3.Command;
+import android.hardware.graphics.composer3.CommandResultPayload;
import android.hardware.graphics.composer3.ContentType;
import android.hardware.graphics.composer3.DisplayAttribute;
import android.hardware.graphics.composer3.DisplayCapability;
+import android.hardware.graphics.composer3.DisplayCommand;
import android.hardware.graphics.composer3.DisplayConnectionType;
import android.hardware.graphics.composer3.DisplayContentSample;
import android.hardware.graphics.composer3.DisplayContentSamplingAttributes;
import android.hardware.graphics.composer3.DisplayIdentification;
-import android.hardware.graphics.composer3.ExecuteCommandsStatus;
import android.hardware.graphics.composer3.FormatColorComponent;
import android.hardware.graphics.composer3.HdrCapabilities;
import android.hardware.graphics.composer3.IComposerCallback;
-import android.hardware.graphics.composer3.LayerGenericMetadataKey;
import android.hardware.graphics.composer3.PerFrameMetadataKey;
import android.hardware.graphics.composer3.PowerMode;
import android.hardware.graphics.composer3.ReadbackBufferAttributes;
@@ -159,23 +156,13 @@
void destroyVirtualDisplay(long display);
/**
- * Executes commands from the input command message queue. Return values
- * generated by the input commands are written to the output command
- * message queue in the form of value commands.
+ * Executes commands.
*
- * @param inLength is the length of input commands.
- * @param inHandles is an array of handles referenced by the input
- * commands.
+ * @param commands are the commands to be processed.
*
- * @return is the status of the command.
-
- * @exception EX_BAD_PARAMETER when inLength is not equal to the length of
- * commands in the input command message queue.
- * @exception NO_RESOURCES when the output command message queue was not
- * properly drained.
+ * @return are the command statuses.
*/
- ExecuteCommandsStatus executeCommands(
- int inLength, in android.hardware.common.NativeHandle[] inHandles);
+ CommandResultPayload[] executeCommands(in DisplayCommand[] commands);
/**
* Retrieves which display configuration is currently active.
@@ -197,7 +184,7 @@
/**
* Returns the color modes supported on this display.
*
- * All devices must support at least ColorMode::NATIVE.
+ * All devices must support at least ColorMode.NATIVE.
*
* @param display is the display to query.
*
@@ -213,7 +200,7 @@
*
* When the layer dataspace is a legacy dataspace (see
* common@1.1::Dataspace) and the display render intent is
- * RenderIntent::ENHANCE, the pixel values can go through an
+ * RenderIntent.ENHANCE, the pixel values can go through an
* implementation-defined saturation transform before being mapped to the
* current color mode colorimetrically.
*
@@ -259,22 +246,6 @@
int getDisplayAttribute(long display, int config, DisplayAttribute attribute);
/**
- * Use getDisplayCapabilities instead. If brightness is supported, must return
- * DisplayCapability::BRIGHTNESS as one of the display capabilities via getDisplayCapabilities.
- * Only use getDisplayCapabilities as the source of truth to query brightness support.
- *
- * Gets whether brightness operations are supported on a display.
- *
- * @param display The display.
- *
- * @return Whether brightness operations are supported on the display.
- *
- * @exception EX_BAD_DISPLAY when the display is invalid, or
- * @exception EX_BAD_PARAMETER when the output parameter is invalid.
- */
- boolean getDisplayBrightnessSupport(long display);
-
- /**
* Provides a list of supported capabilities (as described in the
* definition of DisplayCapability above). This list must not change after
* initialization.
@@ -383,21 +354,6 @@
DisplayContentSamplingAttributes getDisplayedContentSamplingAttributes(long display);
/**
- * Returns whether the given display supports PowerMode::DOZE and
- * PowerMode::DOZE_SUSPEND. DOZE_SUSPEND may not provide any benefit over
- * DOZE (see the definition of PowerMode for more information), but if
- * both DOZE and DOZE_SUSPEND are no different from PowerMode::ON, the
- * device must not claim support.
- *
- * @param display is the display to query.
- *
- * @return is true only when the display supports doze modes.
- *
- * @exception EX_BAD_DISPLAY when an invalid display handle was passed in.
- */
- boolean getDozeSupport(long display);
-
- /**
* Returns the high dynamic range (HDR) capabilities of the given display,
* which are invariant with regard to the active configuration.
*
@@ -412,20 +368,6 @@
HdrCapabilities getHdrCapabilities(long display);
/**
- * Retrieves the set of keys that may be passed into setLayerGenericMetadata
- *
- * Key names must meet the following requirements:
- * - Must be specified in reverse domain name notation
- * - Must not start with 'com.android' or 'android'
- * - Must be unique within the returned vector
- * - Must correspond to a matching HIDL struct type, which defines the
- * structure of its values. For example, the key 'com.example.V1-3.Foo'
- * should correspond to a value of type com.example@1.3::Foo, which is
- * defined in a vendor HAL extension
- */
- LayerGenericMetadataKey[] getLayerGenericMetadataKeys();
-
- /**
* Returns the maximum number of virtual displays supported by this device
* (which may be 0). The client must not attempt to create more than this
* many virtual displays on this device. This number must not change for
@@ -436,17 +378,6 @@
int getMaxVirtualDisplayCount();
/**
- * Gets the output command message queue.
- *
- * This function must only be called inside executeCommands closure.
- *
- * @return is the descriptor of the output command queue.
- *
- * @exception EX_NO_RESOURCES when failed to get the queue temporarily.
- */
- MQDescriptor<int, SynchronizedReadWrite> getOutputCommandQueue();
-
- /**
* Returns the PerFrameMetadataKeys that are supported by this device.
*
* @param display is the display on which to create the layer.
@@ -463,8 +394,8 @@
*
* The width and height of this buffer must be those of the currently-active
* display configuration, and the usage flags must consist of the following:
- * BufferUsage::CPU_READ | BufferUsage::GPU_TEXTURE |
- * BufferUsage::COMPOSER_OUTPUT
+ * BufferUsage.CPU_READ | BufferUsage.GPU_TEXTURE |
+ * BufferUsage.COMPOSER_OUTPUT
*
* The format and dataspace provided must be sufficient such that if a
* correctly-configured buffer is passed into setReadbackBuffer, filled by
@@ -533,14 +464,14 @@
* getReadbackBufferAttributes
* setReadbackBuffer
*/
- ParcelFileDescriptor getReadbackBufferFence(long display);
+ @nullable ParcelFileDescriptor getReadbackBufferFence(long display);
/**
* Returns the render intents supported by the specified display and color
* mode.
*
- * For SDR color modes, RenderIntent::COLORIMETRIC must be supported. For
- * HDR color modes, RenderIntent::TONE_MAP_COLORIMETRIC must be supported.
+ * For SDR color modes, RenderIntent.COLORIMETRIC must be supported. For
+ * HDR color modes, RenderIntent.TONE_MAP_COLORIMETRIC must be supported.
*
* @param display is the display to query.
* @param mode is the color mode to query.
@@ -554,11 +485,11 @@
/**
* Provides a list of all the content types supported by this display (any of
- * ContentType::{GRAPHICS, PHOTO, CINEMA, GAME}). This list must not change after
+ * ContentType.{GRAPHICS, PHOTO, CINEMA, GAME}). This list must not change after
* initialization.
*
* Content types are introduced in HDMI 1.4 and supporting them is optional. The
- * ContentType::NONE is always supported and will not be returned by this method..
+ * ContentType.NONE is always supported and will not be returned by this method..
*
* @return out is a list of supported content types.
*
@@ -625,7 +556,7 @@
* be triggered.
*
* This function should only be called if the display reports support for
- * DisplayCapability::AUTO_LOW_LATENCY_MODE from getDisplayCapabilities_2_4.
+ * DisplayCapability.AUTO_LOW_LATENCY_MODE from getDisplayCapabilities_2_4.
*
* @exception EX_BAD_DISPLAY when an invalid display handle was passed in.
* @exception EX_UNSUPPORTED when AUTO_LOW_LATENCY_MODE is not supported by the composer
@@ -649,8 +580,8 @@
* The color mode and render intent change must take effect on next
* presentDisplay.
*
- * All devices must support at least ColorMode::NATIVE and
- * RenderIntent::COLORIMETRIC, and displays are assumed to be in this mode
+ * All devices must support at least ColorMode.NATIVE and
+ * RenderIntent.COLORIMETRIC, and displays are assumed to be in this mode
* upon hotplug.
*
* @param display is the display to which the color mode is set.
@@ -732,20 +663,12 @@
long display, boolean enable, FormatColorComponent componentMask, long maxFrames);
/**
- * Sets the input command message queue.
- *
- * @param descriptor is the descriptor of the input command message queue.
- * @exception EX_NO_RESOURCES when failed to set the queue temporarily.
- */
- void setInputCommandQueue(in MQDescriptor<int, SynchronizedReadWrite> descriptor);
-
- /**
* Sets the power mode of the given display. The transition must be
* complete when this function returns. It is valid to call this function
* multiple times with the same power mode.
*
- * All displays must support PowerMode::ON and PowerMode::OFF. Whether a
- * display supports PowerMode::DOZE or PowerMode::DOZE_SUSPEND may be
+ * All displays must support PowerMode.ON and PowerMode.OFF. Whether a
+ * display supports PowerMode.DOZE or PowerMode.DOZE_SUSPEND may be
* queried using getDozeSupport.
*
* @param display is the display to which the power mode is set.
@@ -764,13 +687,15 @@
* This buffer must have been allocated as described in
* getReadbackBufferAttributes and is in the dataspace provided by the same.
*
+ * Also provides a file descriptor referring to a release sync fence
+ * object, which must be signaled when it is safe to write to the readback
+ * buffer. If it is already safe to write to the readback buffer, null may be passed instead.
+ *
* If there is hardware protected content on the display at the time of the next
* composition, the area of the readback buffer covered by such content must be
* completely black. Any areas of the buffer not covered by such content may
* optionally be black as well.
*
- * The release fence file descriptor provided works identically to the one
- * described for setOutputBuffer.
*
* This function must not be called between any call to validateDisplay and a
* subsequent call to presentDisplay.
@@ -778,7 +703,8 @@
* Parameters:
* @param display - the display on which to create the layer.
* @param buffer - the new readback buffer
- * @param releaseFence - a sync fence file descriptor as described in setOutputBuffer
+ * @param releaseFence - a sync fence file descriptor as described above or null if it is
+ * already safe to write to the readback buffer.
*
* @exception EX_BAD_DISPLAY - an invalid display handle was passed in
* @exception EX_BAD_PARAMETER - the new readback buffer handle was invalid
@@ -788,7 +714,7 @@
* getReadbackBufferFence
*/
void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer,
- in ParcelFileDescriptor releaseFence);
+ in @nullable ParcelFileDescriptor releaseFence);
/**
* Enables or disables the vsync signal for the given display. Virtual
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
new file mode 100644
index 0000000..44fd4dc
--- /dev/null
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
@@ -0,0 +1,267 @@
+/**
+ * Copyright (c) 2021, 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.graphics.composer3;
+
+import android.hardware.common.NativeHandle;
+import android.hardware.graphics.common.FRect;
+import android.hardware.graphics.common.Point;
+import android.hardware.graphics.common.Rect;
+import android.hardware.graphics.composer3.Buffer;
+import android.hardware.graphics.composer3.Color;
+import android.hardware.graphics.composer3.FloatColor;
+import android.hardware.graphics.composer3.ParcelableBlendMode;
+import android.hardware.graphics.composer3.ParcelableComposition;
+import android.hardware.graphics.composer3.ParcelableDataspace;
+import android.hardware.graphics.composer3.ParcelableTransform;
+import android.hardware.graphics.composer3.PerFrameMetadata;
+import android.hardware.graphics.composer3.PerFrameMetadataBlob;
+import android.hardware.graphics.composer3.PlaneAlpha;
+import android.hardware.graphics.composer3.WhitePointNits;
+import android.hardware.graphics.composer3.ZOrder;
+
+@VintfStability
+parcelable LayerCommand {
+ /**
+ * The layer which this commands refers to.
+ * @see IComposer.createLayer
+ */
+ long layer;
+
+ /**
+ * Asynchronously sets the position of a cursor layer.
+ *
+ * Prior to validateDisplay, a layer may be marked as Composition.CURSOR.
+ * If validation succeeds (i.e., the device does not request a composition
+ * change for that layer), then once a buffer has been set for the layer
+ * and it has been presented, its position may be set by this function at
+ * any time between presentDisplay and any subsequent validateDisplay
+ * calls for this display.
+ *
+ * Once validateDisplay is called, this function must not be called again
+ * until the validate/present sequence is completed.
+ *
+ * May be called from any thread so long as it is not interleaved with the
+ * validate/present sequence as described above.
+ */
+ @nullable Point cursorPosition;
+
+ /**
+ * Sets the buffer handle to be displayed for this layer. If the buffer
+ * properties set at allocation time (width, height, format, and usage)
+ * have not changed since the previous frame, it is not necessary to call
+ * validateDisplay before calling presentDisplay unless new state needs to
+ * be validated in the interim.
+ *
+ * Also provides a file descriptor referring to an acquire sync fence
+ * object, which must be signaled when it is safe to read from the given
+ * buffer. If it is already safe to read from the buffer, an empty handle
+ * may be passed instead.
+ *
+ * This function must return NONE and have no other effect if called for a
+ * layer with a composition type of Composition.SOLID_COLOR (because it
+ * has no buffer) or Composition.SIDEBAND or Composition.CLIENT (because
+ * synchronization and buffer updates for these layers are handled
+ * elsewhere).
+ */
+ @nullable Buffer buffer;
+
+ /**
+ * Provides the region of the source buffer which has been modified since
+ * the last frame. This region does not need to be validated before
+ * calling presentDisplay.
+ *
+ * Once set through this function, the damage region remains the same
+ * until a subsequent call to this function.
+ *
+ * If damage is non-empty, then it may be assumed that any portion of the
+ * source buffer not covered by one of the rects has not been modified
+ * this frame. If damage is empty, then the whole source buffer must be
+ * treated as if it has been modified.
+ *
+ * If the layer's contents are not modified relative to the prior frame,
+ * damage must contain exactly one empty rect([0, 0, 0, 0]).
+ *
+ * The damage rects are relative to the pre-transformed buffer, and their
+ * origin is the top-left corner. They must not exceed the dimensions of
+ * the latched buffer.
+ */
+ @nullable Rect[] damage;
+
+ /**
+ * Sets the blend mode of the given layer.
+ */
+ @nullable ParcelableBlendMode blendMode;
+
+ /**
+ * Sets the color of the given layer. If the composition type of the layer
+ * is not Composition.SOLID_COLOR, this call must succeed and have no
+ * other effect.
+ */
+ @nullable Color color;
+
+ /**
+ * Sets the color of the given layer. If the composition type of the layer
+ * is not Composition.SOLID_COLOR, this call must succeed and have no
+ * other effect.
+ */
+ @nullable FloatColor floatColor;
+
+ /**
+ * Sets the desired composition type of the given layer. During
+ * validateDisplay, the device may request changes to the composition
+ * types of any of the layers as described in the definition of
+ * Composition above.
+ */
+ @nullable ParcelableComposition composition;
+
+ /**
+ * Sets the dataspace of the layer.
+ *
+ * The dataspace provides more information about how to interpret the buffer
+ * or solid color, such as the encoding standard and color transform.
+ *
+ * See the values of ParcelableDataspace for more information.
+ */
+ @nullable ParcelableDataspace dataspace;
+
+ /**
+ * Sets the display frame (the portion of the display covered by a layer)
+ * of the given layer. This frame must not exceed the display dimensions.
+ */
+ @nullable Rect displayFrame;
+
+ /**
+ * Sets an alpha value (a floating point value in the range [0.0, 1.0])
+ * which will be applied to the whole layer. It can be conceptualized as a
+ * preprocessing step which applies the following function:
+ * if (blendMode == BlendMode.PREMULTIPLIED)
+ * out.rgb = in.rgb * planeAlpha
+ * out.a = in.a * planeAlpha
+ *
+ * If the device does not support this operation on a layer which is
+ * marked Composition.DEVICE, it must request a composition type change
+ * to Composition.CLIENT upon the next validateDisplay call.
+ *
+ */
+ @nullable PlaneAlpha planeAlpha;
+
+ /**
+ * Sets the sideband stream for this layer. If the composition type of the
+ * given layer is not Composition.SIDEBAND, this call must succeed and
+ * have no other effect.
+ */
+ @nullable NativeHandle sidebandStream;
+
+ /**
+ * Sets the source crop (the portion of the source buffer which will fill
+ * the display frame) of the given layer. This crop rectangle must not
+ * exceed the dimensions of the latched buffer.
+ *
+ * If the device is not capable of supporting a true float source crop
+ * (i.e., it will truncate or round the floats to integers), it must set
+ * this layer to Composition.CLIENT when crop is non-integral for the
+ * most accurate rendering.
+ *
+ * If the device cannot support float source crops, but still wants to
+ * handle the layer, it must use the following code (or similar) to
+ * convert to an integer crop:
+ * intCrop.left = (int) ceilf(crop.left);
+ * intCrop.top = (int) ceilf(crop.top);
+ * intCrop.right = (int) floorf(crop.right);
+ * intCrop.bottom = (int) floorf(crop.bottom);
+ */
+ @nullable FRect sourceCrop;
+
+ /**
+ * Sets the transform (rotation/flip) of the given layer.
+ */
+ @nullable ParcelableTransform transform;
+
+ /**
+ * Specifies the portion of the layer that is visible, including portions
+ * under translucent areas of other layers. The region is in screen space,
+ * and must not exceed the dimensions of the screen.
+ */
+ @nullable Rect[] visibleRegion;
+
+ /**
+ * Sets the desired Z order (height) of the given layer. A layer with a
+ * greater Z value occludes a layer with a lesser Z value.
+ */
+ @nullable ZOrder z;
+
+ /**
+ * Sets a matrix for color transform which will be applied on this layer
+ * before composition.
+ *
+ * If the device is not capable of apply the matrix on this layer, it must force
+ * this layer to client composition during VALIDATE_DISPLAY.
+ *
+ * The matrix provided is an affine color transformation of the following
+ * form:
+ *
+ * |r.r r.g r.b 0|
+ * |g.r g.g g.b 0|
+ * |b.r b.g b.b 0|
+ * |Tr Tg Tb 1|
+ *
+ * This matrix must be provided in row-major form:
+ *
+ * {r.r, r.g, r.b, 0, g.r, ...}.
+ *
+ * Given a matrix of this form and an input color [R_in, G_in, B_in],
+ * the input color must first be converted to linear space
+ * [R_linear, G_linear, B_linear], then the output linear color
+ * [R_out_linear, G_out_linear, B_out_linear] will be:
+ *
+ * R_out_linear = R_linear * r.r + G_linear * g.r + B_linear * b.r + Tr
+ * G_out_linear = R_linear * r.g + G_linear * g.g + B_linear * b.g + Tg
+ * B_out_linear = R_linear * r.b + G_linear * g.b + B_linear * b.b + Tb
+ *
+ * [R_out_linear, G_out_linear, B_out_linear] must then be converted to
+ * gamma space: [R_out, G_out, B_out] before blending.
+ */
+ @nullable float[] colorTransform;
+
+ /**
+ * Sets the desired white point for the layer. This is intended to be used when presenting
+ * an SDR layer alongside HDR content. The HDR content will be presented at the display
+ * brightness in nits, and accordingly SDR content shall be dimmed to the desired white point
+ * provided.
+ */
+ @nullable WhitePointNits whitePointNits;
+
+ /**
+ * Sets the PerFrameMetadata for the display. This metadata must be used
+ * by the implementation to better tone map content to that display.
+ *
+ * This is a command that may be called every frame.
+ */
+ @nullable PerFrameMetadata[] perFrameMetadata;
+
+ /**
+ * This command sends metadata that may be used for tone-mapping the
+ * associated layer. The metadata structure follows a {key, blob}
+ * format (see the PerFrameMetadataBlob struct). All keys must be
+ * returned by a prior call to getPerFrameMetadataKeys and must
+ * be part of the list of keys associated with blob-type metadata
+ * (see PerFrameMetadataKey).
+ *
+ * This command may be called every frame.
+ */
+ @nullable PerFrameMetadataBlob[] perFrameMetadataBlob;
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
deleted file mode 100644
index 17704b8..0000000
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Copyright (c) 2021, 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.graphics.composer3;
-
-@VintfStability
-parcelable LayerGenericMetadataKey {
- /**
- * Key names must comply with the requirements specified for
- * getLayerGenericMetadataKeys below
- */
- String name;
- /**
- * The mandatory flag is defined in the description of
- * setLayerGenericMetadata above
- */
- boolean mandatory;
-}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerRequest.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerRequest.aidl
deleted file mode 100644
index 10de558..0000000
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerRequest.aidl
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Copyright (c) 2021, 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.graphics.composer3;
-
-/**
- * Layer requests returned from getDisplayRequests.
- */
-@VintfStability
-@Backing(type="int")
-enum LayerRequest {
- /**
- * The client must clear its target with transparent pixels where
- * this layer would be. The client may ignore this request if the
- * layer must be blended.
- */
- CLEAR_CLIENT_TARGET = 1 << 0,
-}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableBlendMode.aidl
similarity index 75%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableBlendMode.aidl
index 0a93c9e..a6c016a 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableBlendMode.aidl
@@ -16,18 +16,9 @@
package android.hardware.graphics.composer3;
-/**
- * Special index values (always negative) for command queue commands.
- */
+import android.hardware.graphics.common.BlendMode;
+
@VintfStability
-@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+parcelable ParcelableBlendMode {
+ BlendMode blendMode;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableComposition.aidl
similarity index 75%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableComposition.aidl
index 0a93c9e..0946ce7 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableComposition.aidl
@@ -16,18 +16,9 @@
package android.hardware.graphics.composer3;
-/**
- * Special index values (always negative) for command queue commands.
- */
+import android.hardware.graphics.composer3.Composition;
+
@VintfStability
-@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+parcelable ParcelableComposition {
+ Composition composition;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableDataspace.aidl
similarity index 75%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableDataspace.aidl
index 0a93c9e..528cdf9 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableDataspace.aidl
@@ -16,18 +16,9 @@
package android.hardware.graphics.composer3;
-/**
- * Special index values (always negative) for command queue commands.
- */
+import android.hardware.graphics.common.Dataspace;
+
@VintfStability
-@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+parcelable ParcelableDataspace {
+ Dataspace dataspace;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableTransform.aidl
similarity index 75%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableTransform.aidl
index 0a93c9e..75f9f7e 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableTransform.aidl
@@ -16,18 +16,9 @@
package android.hardware.graphics.composer3;
-/**
- * Special index values (always negative) for command queue commands.
- */
+import android.hardware.graphics.common.Transform;
+
@VintfStability
-@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+parcelable ParcelableTransform {
+ Transform transform;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl
index b666e6a..3962920 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.aidl
@@ -16,8 +16,6 @@
package android.hardware.graphics.composer3;
-import android.hardware.graphics.composer3.PerFrameMetadataKey;
-
/**
* PerFrameMetadataKey
*
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PlaneAlpha.aidl
similarity index 76%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to graphics/composer/aidl/android/hardware/graphics/composer3/PlaneAlpha.aidl
index 0a93c9e..347dc19 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PlaneAlpha.aidl
@@ -16,18 +16,12 @@
package android.hardware.graphics.composer3;
-/**
- * Special index values (always negative) for command queue commands.
- */
@VintfStability
-@Backing(type="int")
-enum HandleIndex {
+parcelable PlaneAlpha {
/**
- * No handle
+ * An alpha value (a floating point value in the range [0.0, 1.0])
+ * which will be applied to a whole layer.
+ * @see LayerCommand.planeAlpha
*/
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+ float alpha;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentFence.aidl
similarity index 77%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to graphics/composer/aidl/android/hardware/graphics/composer3/PresentFence.aidl
index 0a93c9e..244b4e5 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentFence.aidl
@@ -16,18 +16,16 @@
package android.hardware.graphics.composer3;
-/**
- * Special index values (always negative) for command queue commands.
- */
@VintfStability
-@Backing(type="int")
-enum HandleIndex {
+parcelable PresentFence {
/**
- * No handle
+ * The display which this commands refers to.
+ * @see IComposer.createDisplay
*/
- EMPTY = -1,
+ long display;
+
/**
- * Use cached handle
+ * The present fence for this display.
*/
- CACHED = -2,
+ ParcelFileDescriptor fence;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl
similarity index 71%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl
index 0a93c9e..5ae8940 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl
@@ -16,18 +16,17 @@
package android.hardware.graphics.composer3;
-/**
- * Special index values (always negative) for command queue commands.
- */
@VintfStability
-@Backing(type="int")
-enum HandleIndex {
+parcelable PresentOrValidate {
/**
- * No handle
+ * The display which this commands refers to.
+ * @see IComposer.createDisplay
*/
- EMPTY = -1,
+ long display;
+
/**
- * Use cached handle
+ * Whether PresentOrValidate presented or validated the display.
*/
- CACHED = -2,
+ @VintfStability enum Result { Validated, Presented }
+ Result result;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ReleaseFences.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ReleaseFences.aidl
new file mode 100644
index 0000000..459a042
--- /dev/null
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ReleaseFences.aidl
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2021, 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.graphics.composer3;
+
+@VintfStability
+parcelable ReleaseFences {
+ /**
+ * The display which this commands refers to.
+ * @see IComposer.createDisplay
+ */
+ long display;
+ @VintfStability
+ parcelable Layer {
+ /**
+ * The layer which this commands refers to.
+ * @see IComposer.createLayer
+ */
+ long layer;
+
+ /**
+ * The release fence for this layer.
+ */
+ ParcelFileDescriptor fence;
+ }
+
+ /**
+ * The layers which has release fences.
+ */
+ Layer[] layers;
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/RenderIntent.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/RenderIntent.aidl
index 043b24d..debf32c 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/RenderIntent.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/RenderIntent.aidl
@@ -25,8 +25,8 @@
* modes should not affect the mapping.
*
* RenderIntent overrides the render intents defined for individual color
- * modes. It is ignored when the color mode is ColorMode::NATIVE, because
- * ColorMode::NATIVE colors are already display colors.
+ * modes. It is ignored when the color mode is ColorMode.NATIVE, because
+ * ColorMode.NATIVE colors are already display colors.
*/
@VintfStability
@Backing(type="int")
@@ -36,7 +36,7 @@
* gamut are hard-clipped.
*
* This implies that the display must have been calibrated unless
- * ColorMode::NATIVE is the only supported color mode.
+ * ColorMode.NATIVE is the only supported color mode.
*/
COLORIMETRIC = 0,
/**
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl
similarity index 64%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl
copy to graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl
index c6fd063..2a1d1c6 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/BlendMode.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl
@@ -16,23 +16,14 @@
package android.hardware.graphics.composer3;
-/**
- * Blend modes, settable per layer.
- */
@VintfStability
-@Backing(type="int")
-enum BlendMode {
- INVALID = 0,
+parcelable WhitePointNits {
/**
- * colorOut = colorSrc
+ * The desired white point for the layer. This is intended to be used when presenting
+ * an SDR layer alongside HDR content. The HDR content will be presented at the display
+ * brightness in nits, and accordingly SDR content shall be dimmed to the desired white point
+ * provided.
+ * @see LayerCommand.whitePointNits.
*/
- NONE = 1,
- /**
- * colorOut = colorSrc + colorDst * (1 - alphaSrc)
- */
- PREMULTIPLIED = 2,
- /**
- * colorOut = colorSrc * alphaSrc + colorDst * (1 - alphaSrc)
- */
- COVERAGE = 3,
+ float nits;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ZOrder.aidl
similarity index 76%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to graphics/composer/aidl/android/hardware/graphics/composer3/ZOrder.aidl
index 0a93c9e..56cc200 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ZOrder.aidl
@@ -16,18 +16,12 @@
package android.hardware.graphics.composer3;
-/**
- * Special index values (always negative) for command queue commands.
- */
@VintfStability
-@Backing(type="int")
-enum HandleIndex {
+parcelable ZOrder {
/**
- * No handle
+ * The desired Z order (height) of the given layer. A layer with a
+ * greater Z value occludes a layer with a lesser Z value.
+ * @see LayerCommand.z;
*/
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+ int z;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp
deleted file mode 100644
index d59190d..0000000
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp
+++ /dev/null
@@ -1,615 +0,0 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "android/hardware/graphics/composer3/translate-ndk.h"
-
-namespace android::h2a {
-
-static_assert(
- aidl::android::hardware::graphics::composer3::IComposer::EX_NO_RESOURCES ==
- static_cast<int32_t>(::android::hardware::graphics::composer::V2_4::Error::NO_RESOURCES));
-
-static_assert(
- aidl::android::hardware::graphics::composer3::IComposerClient::EX_BAD_CONFIG ==
- static_cast<int32_t>(::android::hardware::graphics::composer::V2_4::Error::BAD_CONFIG));
-static_assert(
- aidl::android::hardware::graphics::composer3::IComposerClient::EX_BAD_DISPLAY ==
- static_cast<int32_t>(::android::hardware::graphics::composer::V2_4::Error::BAD_DISPLAY));
-static_assert(
- aidl::android::hardware::graphics::composer3::IComposerClient::EX_BAD_LAYER ==
- static_cast<int32_t>(::android::hardware::graphics::composer::V2_4::Error::BAD_LAYER));
-static_assert(
- aidl::android::hardware::graphics::composer3::IComposerClient::EX_BAD_PARAMETER ==
- static_cast<int32_t>(::android::hardware::graphics::composer::V2_4::Error::BAD_PARAMETER));
-static_assert(
- aidl::android::hardware::graphics::composer3::IComposerClient::EX_NO_RESOURCES ==
- static_cast<int32_t>(::android::hardware::graphics::composer::V2_4::Error::NO_RESOURCES));
-static_assert(
- aidl::android::hardware::graphics::composer3::IComposerClient::EX_NOT_VALIDATED ==
- static_cast<int32_t>(::android::hardware::graphics::composer::V2_4::Error::NOT_VALIDATED));
-static_assert(
- aidl::android::hardware::graphics::composer3::IComposerClient::EX_UNSUPPORTED ==
- static_cast<int32_t>(::android::hardware::graphics::composer::V2_4::Error::UNSUPPORTED));
-static_assert(
- aidl::android::hardware::graphics::composer3::IComposerClient::EX_SEAMLESS_NOT_ALLOWED ==
- static_cast<int32_t>(
- ::android::hardware::graphics::composer::V2_4::Error::SEAMLESS_NOT_ALLOWED));
-static_assert(
- aidl::android::hardware::graphics::composer3::IComposerClient::EX_SEAMLESS_NOT_POSSIBLE ==
- static_cast<int32_t>(
- ::android::hardware::graphics::composer::V2_4::Error::SEAMLESS_NOT_POSSIBLE));
-
-static_assert(
- aidl::android::hardware::graphics::composer3::Capability::INVALID ==
- static_cast<aidl::android::hardware::graphics::composer3::Capability>(
- ::android::hardware::graphics::composer::V2_1::IComposer::Capability::INVALID));
-static_assert(aidl::android::hardware::graphics::composer3::Capability::SIDEBAND_STREAM ==
- static_cast<aidl::android::hardware::graphics::composer3::Capability>(
- ::android::hardware::graphics::composer::V2_1::IComposer::Capability::
- SIDEBAND_STREAM));
-static_assert(
- aidl::android::hardware::graphics::composer3::Capability::SKIP_CLIENT_COLOR_TRANSFORM ==
- static_cast<aidl::android::hardware::graphics::composer3::Capability>(
- ::android::hardware::graphics::composer::V2_1::IComposer::Capability::
- SKIP_CLIENT_COLOR_TRANSFORM));
-static_assert(
- aidl::android::hardware::graphics::composer3::Capability::PRESENT_FENCE_IS_NOT_RELIABLE ==
- static_cast<aidl::android::hardware::graphics::composer3::Capability>(
- ::android::hardware::graphics::composer::V2_1::IComposer::Capability::
- PRESENT_FENCE_IS_NOT_RELIABLE));
-// HWC2_CAPABILITY_SKIP_VALIDATE was never defined for HIDL, so we just hardcode its value
-static_assert(aidl::android::hardware::graphics::composer3::Capability::SKIP_VALIDATE ==
- static_cast<aidl::android::hardware::graphics::composer3::Capability>(4));
-
-static_assert(aidl::android::hardware::graphics::composer3::LayerRequest::CLEAR_CLIENT_TARGET ==
- static_cast<aidl::android::hardware::graphics::composer3::LayerRequest>(
- ::android::hardware::graphics::composer::V2_1::IComposerClient::LayerRequest::
- CLEAR_CLIENT_TARGET));
-
-static_assert(aidl::android::hardware::graphics::composer3::BlendMode::INVALID ==
- static_cast<aidl::android::hardware::graphics::composer3::BlendMode>(
- ::android::hardware::graphics::composer::V2_1::IComposerClient::BlendMode::
- INVALID));
-static_assert(
- aidl::android::hardware::graphics::composer3::BlendMode::NONE ==
- static_cast<aidl::android::hardware::graphics::composer3::BlendMode>(
- ::android::hardware::graphics::composer::V2_1::IComposerClient::BlendMode::NONE));
-static_assert(aidl::android::hardware::graphics::composer3::BlendMode::PREMULTIPLIED ==
- static_cast<aidl::android::hardware::graphics::composer3::BlendMode>(
- ::android::hardware::graphics::composer::V2_1::IComposerClient::BlendMode::
- PREMULTIPLIED));
-static_assert(aidl::android::hardware::graphics::composer3::BlendMode::COVERAGE ==
- static_cast<aidl::android::hardware::graphics::composer3::BlendMode>(
- ::android::hardware::graphics::composer::V2_1::IComposerClient::BlendMode::
- COVERAGE));
-
-static_assert(aidl::android::hardware::graphics::composer3::Composition::INVALID ==
- static_cast<aidl::android::hardware::graphics::composer3::Composition>(
- ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition::
- INVALID));
-static_assert(aidl::android::hardware::graphics::composer3::Composition::CLIENT ==
- static_cast<aidl::android::hardware::graphics::composer3::Composition>(
- ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition::
- CLIENT));
-static_assert(aidl::android::hardware::graphics::composer3::Composition::DEVICE ==
- static_cast<aidl::android::hardware::graphics::composer3::Composition>(
- ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition::
- DEVICE));
-static_assert(aidl::android::hardware::graphics::composer3::Composition::SOLID_COLOR ==
- static_cast<aidl::android::hardware::graphics::composer3::Composition>(
- ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition::
- SOLID_COLOR));
-static_assert(aidl::android::hardware::graphics::composer3::Composition::CURSOR ==
- static_cast<aidl::android::hardware::graphics::composer3::Composition>(
- ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition::
- CURSOR));
-static_assert(aidl::android::hardware::graphics::composer3::Composition::SIDEBAND ==
- static_cast<aidl::android::hardware::graphics::composer3::Composition>(
- ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition::
- SIDEBAND));
-
-static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest::FLIP_CLIENT_TARGET ==
- static_cast<aidl::android::hardware::graphics::composer3::DisplayRequest>(
- ::android::hardware::graphics::composer::V2_1::IComposerClient::
- DisplayRequest::FLIP_CLIENT_TARGET));
-static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest::
- WRITE_CLIENT_TARGET_TO_OUTPUT ==
- static_cast<aidl::android::hardware::graphics::composer3::DisplayRequest>(
- ::android::hardware::graphics::composer::V2_1::IComposerClient::
- DisplayRequest::WRITE_CLIENT_TARGET_TO_OUTPUT));
-
-static_assert(aidl::android::hardware::graphics::composer3::HandleIndex::EMPTY ==
- static_cast<aidl::android::hardware::graphics::composer3::HandleIndex>(
- ::android::hardware::graphics::composer::V2_1::IComposerClient::HandleIndex::
- EMPTY));
-static_assert(aidl::android::hardware::graphics::composer3::HandleIndex::CACHED ==
- static_cast<aidl::android::hardware::graphics::composer3::HandleIndex>(
- ::android::hardware::graphics::composer::V2_1::IComposerClient::HandleIndex::
- CACHED));
-
-static_assert(
- aidl::android::hardware::graphics::composer3::PowerMode::OFF ==
- static_cast<aidl::android::hardware::graphics::composer3::PowerMode>(
- ::android::hardware::graphics::composer::V2_2::IComposerClient::PowerMode::OFF));
-static_assert(
- aidl::android::hardware::graphics::composer3::PowerMode::DOZE ==
- static_cast<aidl::android::hardware::graphics::composer3::PowerMode>(
- ::android::hardware::graphics::composer::V2_2::IComposerClient::PowerMode::DOZE));
-static_assert(aidl::android::hardware::graphics::composer3::PowerMode::DOZE_SUSPEND ==
- static_cast<aidl::android::hardware::graphics::composer3::PowerMode>(
- ::android::hardware::graphics::composer::V2_2::IComposerClient::PowerMode::
- DOZE_SUSPEND));
-static_assert(
- aidl::android::hardware::graphics::composer3::PowerMode::ON ==
- static_cast<aidl::android::hardware::graphics::composer3::PowerMode>(
- ::android::hardware::graphics::composer::V2_2::IComposerClient::PowerMode::ON));
-static_assert(aidl::android::hardware::graphics::composer3::PowerMode::ON_SUSPEND ==
- static_cast<aidl::android::hardware::graphics::composer3::PowerMode>(
- ::android::hardware::graphics::composer::V2_2::IComposerClient::PowerMode::
- ON_SUSPEND));
-
-static_assert(aidl::android::hardware::graphics::composer3::DisplayCapability::INVALID ==
- static_cast<aidl::android::hardware::graphics::composer3::DisplayCapability>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::
- DisplayCapability::INVALID));
-static_assert(aidl::android::hardware::graphics::composer3::DisplayCapability::
- SKIP_CLIENT_COLOR_TRANSFORM ==
- static_cast<aidl::android::hardware::graphics::composer3::DisplayCapability>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::
- DisplayCapability::SKIP_CLIENT_COLOR_TRANSFORM));
-static_assert(aidl::android::hardware::graphics::composer3::DisplayCapability::DOZE ==
- static_cast<aidl::android::hardware::graphics::composer3::DisplayCapability>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::
- DisplayCapability::DOZE));
-static_assert(aidl::android::hardware::graphics::composer3::DisplayCapability::BRIGHTNESS ==
- static_cast<aidl::android::hardware::graphics::composer3::DisplayCapability>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::
- DisplayCapability::BRIGHTNESS));
-static_assert(aidl::android::hardware::graphics::composer3::DisplayCapability::PROTECTED_CONTENTS ==
- static_cast<aidl::android::hardware::graphics::composer3::DisplayCapability>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::
- DisplayCapability::PROTECTED_CONTENTS));
-static_assert(
- aidl::android::hardware::graphics::composer3::DisplayCapability::AUTO_LOW_LATENCY_MODE ==
- static_cast<aidl::android::hardware::graphics::composer3::DisplayCapability>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::DisplayCapability::
- AUTO_LOW_LATENCY_MODE));
-
-static_assert(aidl::android::hardware::graphics::composer3::Command::LENGTH_MASK ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- LENGTH_MASK));
-static_assert(aidl::android::hardware::graphics::composer3::Command::OPCODE_SHIFT ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- OPCODE_SHIFT));
-static_assert(aidl::android::hardware::graphics::composer3::Command::OPCODE_MASK ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- OPCODE_MASK));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SELECT_DISPLAY ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SELECT_DISPLAY));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SELECT_LAYER ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SELECT_LAYER));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_ERROR ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_ERROR));
-static_assert(
- aidl::android::hardware::graphics::composer3::Command::SET_CHANGED_COMPOSITION_TYPES ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_CHANGED_COMPOSITION_TYPES));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_DISPLAY_REQUESTS ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_DISPLAY_REQUESTS));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_PRESENT_FENCE ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_PRESENT_FENCE));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_RELEASE_FENCES ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_RELEASE_FENCES));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_COLOR_TRANSFORM ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_COLOR_TRANSFORM));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_CLIENT_TARGET ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_CLIENT_TARGET));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_OUTPUT_BUFFER ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_OUTPUT_BUFFER));
-static_assert(aidl::android::hardware::graphics::composer3::Command::VALIDATE_DISPLAY ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- VALIDATE_DISPLAY));
-static_assert(aidl::android::hardware::graphics::composer3::Command::ACCEPT_DISPLAY_CHANGES ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- ACCEPT_DISPLAY_CHANGES));
-static_assert(aidl::android::hardware::graphics::composer3::Command::PRESENT_DISPLAY ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- PRESENT_DISPLAY));
-static_assert(aidl::android::hardware::graphics::composer3::Command::PRESENT_OR_VALIDATE_DISPLAY ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- PRESENT_OR_VALIDATE_DISPLAY));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_CURSOR_POSITION ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_CURSOR_POSITION));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_BUFFER ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_BUFFER));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_SURFACE_DAMAGE ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_SURFACE_DAMAGE));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_BLEND_MODE ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_BLEND_MODE));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_COLOR ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_COLOR));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_COMPOSITION_TYPE ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_COMPOSITION_TYPE));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_DATASPACE ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_DATASPACE));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_DISPLAY_FRAME ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_DISPLAY_FRAME));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_PLANE_ALPHA ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_PLANE_ALPHA));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_SIDEBAND_STREAM ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_SIDEBAND_STREAM));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_SOURCE_CROP ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_SOURCE_CROP));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_TRANSFORM ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_TRANSFORM));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_VISIBLE_REGION ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_VISIBLE_REGION));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_Z_ORDER ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_Z_ORDER));
-static_assert(aidl::android::hardware::graphics::composer3::Command::
- SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_PER_FRAME_METADATA ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_PER_FRAME_METADATA));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_FLOAT_COLOR ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_FLOAT_COLOR));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_COLOR_TRANSFORM ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_COLOR_TRANSFORM));
-static_assert(
- aidl::android::hardware::graphics::composer3::Command::SET_LAYER_PER_FRAME_METADATA_BLOBS ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_PER_FRAME_METADATA_BLOBS));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_CLIENT_TARGET_PROPERTY ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_CLIENT_TARGET_PROPERTY));
-static_assert(aidl::android::hardware::graphics::composer3::Command::SET_LAYER_GENERIC_METADATA ==
- static_cast<aidl::android::hardware::graphics::composer3::Command>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Command::
- SET_LAYER_GENERIC_METADATA));
-
-static_assert(aidl::android::hardware::graphics::composer3::DisplayAttribute::INVALID ==
- static_cast<aidl::android::hardware::graphics::composer3::DisplayAttribute>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::
- INVALID));
-static_assert(
- aidl::android::hardware::graphics::composer3::DisplayAttribute::WIDTH ==
- static_cast<aidl::android::hardware::graphics::composer3::DisplayAttribute>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::WIDTH));
-static_assert(
- aidl::android::hardware::graphics::composer3::DisplayAttribute::HEIGHT ==
- static_cast<aidl::android::hardware::graphics::composer3::DisplayAttribute>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::HEIGHT));
-static_assert(aidl::android::hardware::graphics::composer3::DisplayAttribute::VSYNC_PERIOD ==
- static_cast<aidl::android::hardware::graphics::composer3::DisplayAttribute>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::
- VSYNC_PERIOD));
-static_assert(
- aidl::android::hardware::graphics::composer3::DisplayAttribute::DPI_X ==
- static_cast<aidl::android::hardware::graphics::composer3::DisplayAttribute>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::DPI_X));
-static_assert(
- aidl::android::hardware::graphics::composer3::DisplayAttribute::DPI_Y ==
- static_cast<aidl::android::hardware::graphics::composer3::DisplayAttribute>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::DPI_Y));
-static_assert(aidl::android::hardware::graphics::composer3::DisplayAttribute::CONFIG_GROUP ==
- static_cast<aidl::android::hardware::graphics::composer3::DisplayAttribute>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::Attribute::
- CONFIG_GROUP));
-
-static_assert(aidl::android::hardware::graphics::composer3::DisplayConnectionType::INTERNAL ==
- static_cast<aidl::android::hardware::graphics::composer3::DisplayConnectionType>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::
- DisplayConnectionType::INTERNAL));
-static_assert(aidl::android::hardware::graphics::composer3::DisplayConnectionType::EXTERNAL ==
- static_cast<aidl::android::hardware::graphics::composer3::DisplayConnectionType>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::
- DisplayConnectionType::EXTERNAL));
-
-static_assert(
- aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::DISPLAY_RED_PRIMARY_X ==
- static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
- ::android::hardware::graphics::composer::V2_3::IComposerClient::
- PerFrameMetadataKey::DISPLAY_RED_PRIMARY_X));
-static_assert(
- aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::DISPLAY_RED_PRIMARY_Y ==
- static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
- ::android::hardware::graphics::composer::V2_3::IComposerClient::
- PerFrameMetadataKey::DISPLAY_RED_PRIMARY_Y));
-static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::
- DISPLAY_GREEN_PRIMARY_X ==
- static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
- ::android::hardware::graphics::composer::V2_3::IComposerClient::
- PerFrameMetadataKey::DISPLAY_GREEN_PRIMARY_X));
-static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::
- DISPLAY_GREEN_PRIMARY_Y ==
- static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
- ::android::hardware::graphics::composer::V2_3::IComposerClient::
- PerFrameMetadataKey::DISPLAY_GREEN_PRIMARY_Y));
-static_assert(
- aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_X ==
- static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
- ::android::hardware::graphics::composer::V2_3::IComposerClient::
- PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_X));
-static_assert(
- aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_Y ==
- static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
- ::android::hardware::graphics::composer::V2_3::IComposerClient::
- PerFrameMetadataKey::DISPLAY_BLUE_PRIMARY_Y));
-static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::WHITE_POINT_X ==
- static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
- ::android::hardware::graphics::composer::V2_3::IComposerClient::
- PerFrameMetadataKey::WHITE_POINT_X));
-static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::WHITE_POINT_Y ==
- static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
- ::android::hardware::graphics::composer::V2_3::IComposerClient::
- PerFrameMetadataKey::WHITE_POINT_Y));
-static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::MAX_LUMINANCE ==
- static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
- ::android::hardware::graphics::composer::V2_3::IComposerClient::
- PerFrameMetadataKey::MAX_LUMINANCE));
-static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::MIN_LUMINANCE ==
- static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
- ::android::hardware::graphics::composer::V2_3::IComposerClient::
- PerFrameMetadataKey::MIN_LUMINANCE));
-static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::
- MAX_CONTENT_LIGHT_LEVEL ==
- static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
- ::android::hardware::graphics::composer::V2_3::IComposerClient::
- PerFrameMetadataKey::MAX_CONTENT_LIGHT_LEVEL));
-static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::
- MAX_FRAME_AVERAGE_LIGHT_LEVEL ==
- static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
- ::android::hardware::graphics::composer::V2_3::IComposerClient::
- PerFrameMetadataKey::MAX_FRAME_AVERAGE_LIGHT_LEVEL));
-static_assert(aidl::android::hardware::graphics::composer3::PerFrameMetadataKey::HDR10_PLUS_SEI ==
- static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(
- ::android::hardware::graphics::composer::V2_3::IComposerClient::
- PerFrameMetadataKey::HDR10_PLUS_SEI));
-
-static_assert(
- aidl::android::hardware::graphics::composer3::FormatColorComponent::FORMAT_COMPONENT_0 ==
- static_cast<aidl::android::hardware::graphics::composer3::FormatColorComponent>(
- ::android::hardware::graphics::composer::V2_3::IComposerClient::
- FormatColorComponent::FORMAT_COMPONENT_0));
-static_assert(
- aidl::android::hardware::graphics::composer3::FormatColorComponent::FORMAT_COMPONENT_1 ==
- static_cast<aidl::android::hardware::graphics::composer3::FormatColorComponent>(
- ::android::hardware::graphics::composer::V2_3::IComposerClient::
- FormatColorComponent::FORMAT_COMPONENT_1));
-static_assert(
- aidl::android::hardware::graphics::composer3::FormatColorComponent::FORMAT_COMPONENT_2 ==
- static_cast<aidl::android::hardware::graphics::composer3::FormatColorComponent>(
- ::android::hardware::graphics::composer::V2_3::IComposerClient::
- FormatColorComponent::FORMAT_COMPONENT_2));
-static_assert(
- aidl::android::hardware::graphics::composer3::FormatColorComponent::FORMAT_COMPONENT_3 ==
- static_cast<aidl::android::hardware::graphics::composer3::FormatColorComponent>(
- ::android::hardware::graphics::composer::V2_3::IComposerClient::
- FormatColorComponent::FORMAT_COMPONENT_3));
-
-static_assert(
- aidl::android::hardware::graphics::composer3::ContentType::NONE ==
- static_cast<aidl::android::hardware::graphics::composer3::ContentType>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::ContentType::NONE));
-static_assert(aidl::android::hardware::graphics::composer3::ContentType::GRAPHICS ==
- static_cast<aidl::android::hardware::graphics::composer3::ContentType>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::ContentType::
- GRAPHICS));
-static_assert(aidl::android::hardware::graphics::composer3::ContentType::PHOTO ==
- static_cast<aidl::android::hardware::graphics::composer3::ContentType>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::ContentType::
- PHOTO));
-static_assert(aidl::android::hardware::graphics::composer3::ContentType::CINEMA ==
- static_cast<aidl::android::hardware::graphics::composer3::ContentType>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::ContentType::
- CINEMA));
-static_assert(
- aidl::android::hardware::graphics::composer3::ContentType::GAME ==
- static_cast<aidl::android::hardware::graphics::composer3::ContentType>(
- ::android::hardware::graphics::composer::V2_4::IComposerClient::ContentType::GAME));
-
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_4::VsyncPeriodChangeTimeline& in,
- aidl::android::hardware::graphics::composer3::VsyncPeriodChangeTimeline* out) {
- out->newVsyncAppliedTimeNanos = static_cast<int64_t>(in.newVsyncAppliedTimeNanos);
- out->refreshRequired = static_cast<bool>(in.refreshRequired);
- out->refreshTimeNanos = static_cast<int64_t>(in.refreshTimeNanos);
- return true;
-}
-
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_1::IComposerClient::Rect& in,
- aidl::android::hardware::graphics::common::Rect* out) {
- out->left = static_cast<int32_t>(in.left);
- out->top = static_cast<int32_t>(in.top);
- out->right = static_cast<int32_t>(in.right);
- out->bottom = static_cast<int32_t>(in.bottom);
- return true;
-}
-
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_1::IComposerClient::FRect& in,
- aidl::android::hardware::graphics::common::FRect* out) {
- out->left = static_cast<float>(in.left);
- out->top = static_cast<float>(in.top);
- out->right = static_cast<float>(in.right);
- out->bottom = static_cast<float>(in.bottom);
- return true;
-}
-
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_1::IComposerClient::Color& in,
- aidl::android::hardware::graphics::composer3::Color* out) {
- // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit
- // your needs.
- if (in.r > std::numeric_limits<int8_t>::max() || in.r < 0) {
- return false;
- }
- out->r = static_cast<int8_t>(in.r);
- // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit
- // your needs.
- if (in.g > std::numeric_limits<int8_t>::max() || in.g < 0) {
- return false;
- }
- out->g = static_cast<int8_t>(in.g);
- // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit
- // your needs.
- if (in.b > std::numeric_limits<int8_t>::max() || in.b < 0) {
- return false;
- }
- out->b = static_cast<int8_t>(in.b);
- // FIXME This requires conversion between signed and unsigned. Change this if it doesn't suit
- // your needs.
- if (in.a > std::numeric_limits<int8_t>::max() || in.a < 0) {
- return false;
- }
- out->a = static_cast<int8_t>(in.a);
- return true;
-}
-
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_3::IComposerClient::PerFrameMetadata& in,
- aidl::android::hardware::graphics::composer3::PerFrameMetadata* out) {
- out->key =
- static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(in.key);
- out->value = static_cast<float>(in.value);
- return true;
-}
-
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_2::IComposerClient::FloatColor& in,
- aidl::android::hardware::graphics::composer3::FloatColor* out) {
- out->r = static_cast<float>(in.r);
- out->g = static_cast<float>(in.g);
- out->b = static_cast<float>(in.b);
- out->a = static_cast<float>(in.a);
- return true;
-}
-
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_3::IComposerClient::PerFrameMetadataBlob&
- in,
- aidl::android::hardware::graphics::composer3::PerFrameMetadataBlob* out) {
- out->key =
- static_cast<aidl::android::hardware::graphics::composer3::PerFrameMetadataKey>(in.key);
- {
- size_t size = in.blob.size();
- for (size_t i = 0; i < size; i++) {
- // FIXME This requires conversion between signed and unsigned. Change this if it doesn't
- // suit your needs.
- if (in.blob[i] > std::numeric_limits<int8_t>::max() || in.blob[i] < 0) {
- return false;
- }
- out->blob.push_back(static_cast<int8_t>(in.blob[i]));
- }
- }
- return true;
-}
-
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_4::IComposerClient::
- VsyncPeriodChangeConstraints& in,
- aidl::android::hardware::graphics::composer3::VsyncPeriodChangeConstraints* out) {
- out->desiredTimeNanos = static_cast<int64_t>(in.desiredTimeNanos);
- out->seamlessRequired = static_cast<bool>(in.seamlessRequired);
- return true;
-}
-
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_4::IComposerClient::ClientTargetProperty&
- in,
- aidl::android::hardware::graphics::composer3::ClientTargetProperty* out) {
- out->pixelFormat =
- static_cast<aidl::android::hardware::graphics::common::PixelFormat>(in.pixelFormat);
- out->dataspace =
- static_cast<aidl::android::hardware::graphics::common::Dataspace>(in.dataspace);
- return true;
-}
-
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_4::IComposerClient::
- LayerGenericMetadataKey& in,
- aidl::android::hardware::graphics::composer3::LayerGenericMetadataKey* out) {
- out->name = in.name;
- out->mandatory = static_cast<bool>(in.mandatory);
- return true;
-}
-
-} // namespace android::h2a
\ No newline at end of file
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp
index 9bf8609..741572d 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/Android.bp
@@ -35,7 +35,6 @@
"VtsHalGraphicsComposer3_TargetTest.cpp",
"VtsHalGraphicsComposer3_ReadbackTest.cpp",
"composer-vts/GraphicsComposerCallback.cpp",
- "composer-vts/TestCommandReader.cpp",
],
shared_libs: [
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp
index 4008cb4..0ece1d5 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp
@@ -19,6 +19,7 @@
#include <aidl/Gtest.h>
#include <aidl/Vintf.h>
#include <aidl/android/hardware/graphics/common/BufferUsage.h>
+#include <aidl/android/hardware/graphics/composer3/IComposer.h>
#include <android/binder_manager.h>
#include <composer-vts/include/ReadbackVts.h>
#include <composer-vts/include/RenderEngineVts.h>
@@ -28,7 +29,6 @@
#include <ui/PixelFormat.h>
#include <ui/Rect.h>
#include "composer-vts/include/GraphicsComposerCallback.h"
-#include "composer-vts/include/TestCommandReader.h"
namespace aidl::android::hardware::graphics::composer3::vts {
namespace {
@@ -70,9 +70,7 @@
EXPECT_TRUE(mComposerClient->setVsyncEnabled(mPrimaryDisplay, false).isOk());
mComposerCallback->setVsyncAllowed(false);
- // set up command writer/reader and gralloc
- mWriter = std::make_shared<CommandWriterBase>(1024);
- mReader = std::make_unique<TestCommandReader>();
+ // set up gralloc
mGraphicBuffer = allocate();
ASSERT_NO_FATAL_FAILURE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON));
@@ -104,8 +102,10 @@
void TearDown() override {
ASSERT_NO_FATAL_FAILURE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF));
- EXPECT_EQ(0, mReader->mErrors.size());
- EXPECT_EQ(0, mReader->mCompositionChanges.size());
+ const auto errors = mReader.takeErrors();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty());
+
if (mComposerCallback != nullptr) {
EXPECT_EQ(0, mComposerCallback->getInvalidHotplugCount());
EXPECT_EQ(0, mComposerCallback->getInvalidRefreshCount());
@@ -114,17 +114,14 @@
}
::android::sp<::android::GraphicBuffer> allocate() {
- return ::android::sp<::android::GraphicBuffer>::make(
- mDisplayWidth, mDisplayHeight, ::android::PIXEL_FORMAT_RGBA_8888,
- /*layerCount*/ 1,
- static_cast<uint64_t>(static_cast<int>(common::BufferUsage::CPU_WRITE_OFTEN) |
- static_cast<int>(common::BufferUsage::CPU_READ_OFTEN)),
- "VtsHalGraphicsComposer3_ReadbackTest");
- }
+ const auto width = static_cast<uint32_t>(mDisplayWidth);
+ const auto height = static_cast<uint32_t>(mDisplayHeight);
+ const auto usage = static_cast<uint32_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
+ static_cast<uint32_t>(common::BufferUsage::CPU_READ_OFTEN);
- void clearCommandReaderState() {
- mReader->mCompositionChanges.clear();
- mReader->mErrors.clear();
+ return ::android::sp<::android::GraphicBuffer>::make(
+ width, height, ::android::PIXEL_FORMAT_RGBA_8888,
+ /*layerCount*/ 1u, usage, "VtsHalGraphicsComposer3_ReadbackTest");
}
void writeLayers(const std::vector<std::shared_ptr<TestLayer>>& layers) {
@@ -135,31 +132,18 @@
}
void execute() {
- TestCommandReader* reader = mReader.get();
- CommandWriterBase* writer = mWriter.get();
- bool queueChanged = false;
- int32_t commandLength = 0;
- std::vector<NativeHandle> commandHandles;
- ASSERT_TRUE(writer->writeQueue(&queueChanged, &commandLength, &commandHandles));
-
- if (queueChanged) {
- auto ret = mComposerClient->setInputCommandQueue(writer->getMQDescriptor());
- ASSERT_TRUE(ret.isOk());
+ const auto& commands = mWriter.getPendingCommands();
+ if (commands.empty()) {
+ mWriter.reset();
+ return;
}
- ExecuteCommandsStatus commandStatus;
- EXPECT_TRUE(mComposerClient->executeCommands(commandLength, commandHandles, &commandStatus)
- .isOk());
+ std::vector<CommandResultPayload> results;
+ auto status = mComposerClient->executeCommands(commands, &results);
+ ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription();
- if (commandStatus.queueChanged) {
- MQDescriptor<int32_t, SynchronizedReadWrite> outputCommandQueue;
- ASSERT_TRUE(mComposerClient->getOutputCommandQueue(&outputCommandQueue).isOk());
- reader->setMQDescriptor(outputCommandQueue);
- }
- ASSERT_TRUE(reader->readQueue(commandStatus.length, std::move(commandStatus.handles)));
- reader->parse();
- reader->reset();
- writer->reset();
+ mReader.parse(std::move(results));
+ mWriter.reset();
}
bool getHasReadbackBuffer() {
@@ -181,8 +165,8 @@
int32_t mDisplayWidth;
int32_t mDisplayHeight;
std::vector<ColorMode> mTestColorModes;
- std::shared_ptr<CommandWriterBase> mWriter;
- std::unique_ptr<TestCommandReader> mReader;
+ ComposerClientWriter mWriter;
+ ComposerClientReader mReader;
::android::sp<::android::GraphicBuffer> mGraphicBuffer;
std::unique_ptr<TestRenderEngine> mTestRenderEngine;
@@ -246,7 +230,6 @@
TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) {
for (ColorMode mode : mTestColorModes) {
- mWriter->selectDisplay(mPrimaryDisplay);
ASSERT_NO_FATAL_FAILURE(
mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
@@ -272,20 +255,19 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->validateDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
// if hwc cannot handle and asks for composition change,
// just succeed the test
- if (mReader->mCompositionChanges.size() != 0) {
- clearCommandReaderState();
+ if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
GTEST_SUCCEED();
return;
}
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->presentDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
mTestRenderEngine->setRenderLayers(layers);
@@ -296,7 +278,6 @@
TEST_P(GraphicsCompositionTest, SetLayerBuffer) {
for (ColorMode mode : mTestColorModes) {
- mWriter->selectDisplay(mPrimaryDisplay);
ASSERT_NO_FATAL_FAILURE(
mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
@@ -305,8 +286,6 @@
return;
}
- mWriter->selectDisplay(mPrimaryDisplay);
-
ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGraphicBuffer,
mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
@@ -331,21 +310,20 @@
std::vector<std::shared_ptr<TestLayer>> layers = {layer};
writeLayers(layers);
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->validateDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- if (mReader->mCompositionChanges.size() != 0) {
- clearCommandReaderState();
+ if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
GTEST_SUCCEED();
return;
}
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay();
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
mTestRenderEngine->setRenderLayers(layers);
@@ -356,7 +334,6 @@
TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) {
for (ColorMode mode : mTestColorModes) {
- mWriter->selectDisplay(mPrimaryDisplay);
ASSERT_NO_FATAL_FAILURE(
mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
@@ -380,7 +357,7 @@
mGraphicBuffer->reallocate(static_cast<uint32_t>(mDisplayWidth),
static_cast<uint32_t>(mDisplayHeight), 1,
static_cast<uint32_t>(common::PixelFormat::RGBA_8888), usage);
- mWriter->setLayerBuffer(0, mGraphicBuffer->handle, -1);
+ mWriter.setLayerBuffer(mPrimaryDisplay, layer->getLayer(), 0, mGraphicBuffer->handle, -1);
// expected color for each pixel
std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
@@ -390,18 +367,17 @@
mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
- mWriter->validateDisplay();
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- if (mReader->mCompositionChanges.size() != 0) {
- clearCommandReaderState();
+ if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
GTEST_SUCCEED();
return;
}
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->presentDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
}
@@ -443,7 +419,8 @@
return;
}
- aidl::android::hardware::common::NativeHandle bufferHandle = ::android::dupToAidl(nullptr);
+ aidl::android::hardware::common::NativeHandle bufferHandle =
+ ::android::dupToAidl(mGraphicBuffer->handle);
ndk::ScopedFileDescriptor releaseFence = ndk::ScopedFileDescriptor(-1);
const auto error =
mComposerClient->setReadbackBuffer(mPrimaryDisplay, bufferHandle, releaseFence);
@@ -470,7 +447,6 @@
.isOk());
for (ColorMode mode : mTestColorModes) {
- mWriter->selectDisplay(mPrimaryDisplay);
EXPECT_TRUE(mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC)
.isOk());
@@ -479,8 +455,6 @@
return;
}
- mWriter->selectDisplay(mPrimaryDisplay);
-
std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
{0, 0, mDisplayWidth, mDisplayHeight / 4}, RED);
@@ -504,13 +478,14 @@
mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->validateDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- if (!mReader->mCompositionChanges.empty()) {
- ASSERT_EQ(1, mReader->mCompositionChanges.size());
- ASSERT_EQ(1, mReader->mCompositionChanges[0].second);
+ auto changedCompositionTypes = mReader.takeChangedCompositionTypes(mPrimaryDisplay);
+ if (!changedCompositionTypes.empty()) {
+ ASSERT_EQ(1, changedCompositionTypes.size());
+ ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0].composition);
PixelFormat clientFormat = PixelFormat::RGBA_8888;
auto clientUsage = static_cast<uint32_t>(
@@ -541,18 +516,19 @@
mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &fenceHandle).isOk());
layer->setToClientComposition(mWriter);
- mWriter->acceptDisplayChanges();
- mWriter->setClientTarget(0, mGraphicBuffer->handle, fenceHandle.get(), clientDataspace,
- std::vector<common::Rect>(1, damage));
+ mWriter.acceptDisplayChanges(mPrimaryDisplay);
+ mWriter.setClientTarget(mPrimaryDisplay, 0, mGraphicBuffer->handle, fenceHandle.get(),
+ clientDataspace, std::vector<common::Rect>(1, damage));
execute();
- ASSERT_EQ(0, mReader->mCompositionChanges.size());
+ changedCompositionTypes = mReader.takeChangedCompositionTypes(mPrimaryDisplay);
+ ASSERT_TRUE(changedCompositionTypes.empty());
}
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay();
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
}
@@ -563,7 +539,6 @@
mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kClientTargetSlotCount));
for (ColorMode mode : mTestColorModes) {
- mWriter->selectDisplay(mPrimaryDisplay);
ASSERT_NO_FATAL_FAILURE(
mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
@@ -613,15 +588,15 @@
clientLayer->setDisplayFrame(clientFrame);
clientLayer->setZOrder(0);
clientLayer->write(mWriter);
- mWriter->validateDisplay();
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- if (mReader->mCompositionChanges.size() != 1) {
- mReader->mCompositionChanges.clear();
+ auto changedCompositionTypes = mReader.takeChangedCompositionTypes(mPrimaryDisplay);
+ if (changedCompositionTypes.size() != 1) {
continue;
}
// create client target buffer
- ASSERT_EQ(1, mReader->mCompositionChanges[0].second);
+ ASSERT_EQ(Composition::CLIENT, changedCompositionTypes[0].composition);
mGraphicBuffer->reallocate(static_cast<uint32_t>(mDisplayWidth),
static_cast<uint32_t>(mDisplayHeight),
static_cast<int32_t>(common::PixelFormat::RGBA_8888),
@@ -642,23 +617,23 @@
EXPECT_TRUE(mComposerClient->getReadbackBufferFence(mPrimaryDisplay, &fenceHandle).isOk());
clientLayer->setToClientComposition(mWriter);
- mWriter->acceptDisplayChanges();
- mWriter->setClientTarget(0, mGraphicBuffer->handle, fenceHandle.get(), clientDataspace,
- std::vector<common::Rect>(1, clientFrame));
+ mWriter.acceptDisplayChanges(mPrimaryDisplay);
+ mWriter.setClientTarget(mPrimaryDisplay, 0, mGraphicBuffer->handle, fenceHandle.get(),
+ clientDataspace, std::vector<common::Rect>(1, clientFrame));
execute();
- ASSERT_EQ(0, mReader->mCompositionChanges.size());
- ASSERT_EQ(0, mReader->mErrors.size());
+ changedCompositionTypes = mReader.takeChangedCompositionTypes(mPrimaryDisplay);
+ ASSERT_TRUE(changedCompositionTypes.empty());
+ ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay();
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
}
}
TEST_P(GraphicsCompositionTest, SetLayerDamage) {
for (ColorMode mode : mTestColorModes) {
- mWriter->selectDisplay(mPrimaryDisplay);
ASSERT_NO_FATAL_FAILURE(
mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
@@ -667,8 +642,6 @@
return;
}
- mWriter->selectDisplay(mPrimaryDisplay);
-
common::Rect redRect = {0, 0, mDisplayWidth / 4, mDisplayHeight / 4};
std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
@@ -689,18 +662,17 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->validateDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- if (mReader->mCompositionChanges.size() != 0) {
- clearCommandReaderState();
+ if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
GTEST_SUCCEED();
return;
}
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->presentDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
@@ -716,14 +688,14 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->validateDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
- ASSERT_EQ(0, mReader->mCompositionChanges.size());
- mWriter->presentDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty());
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
}
@@ -731,7 +703,6 @@
TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) {
for (ColorMode mode : mTestColorModes) {
- mWriter->selectDisplay(mPrimaryDisplay);
ASSERT_NO_FATAL_FAILURE(
mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
@@ -755,19 +726,18 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->validateDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- if (mReader->mCompositionChanges.size() != 0) {
- clearCommandReaderState();
+ if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
GTEST_SUCCEED();
return;
}
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay();
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
@@ -780,7 +750,6 @@
TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) {
for (ColorMode mode : mTestColorModes) {
- mWriter->selectDisplay(mPrimaryDisplay);
ASSERT_NO_FATAL_FAILURE(
mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
@@ -789,8 +758,6 @@
return;
}
- mWriter->selectDisplay(mPrimaryDisplay);
-
std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
{0, 0, mDisplayWidth, mDisplayHeight / 4}, RED);
@@ -818,18 +785,17 @@
mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->validateDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- if (mReader->mCompositionChanges.size() != 0) {
- clearCommandReaderState();
+ if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
GTEST_SUCCEED();
return;
}
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->presentDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
mTestRenderEngine->setRenderLayers(layers);
ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
@@ -839,7 +805,6 @@
TEST_P(GraphicsCompositionTest, SetLayerZOrder) {
for (ColorMode mode : mTestColorModes) {
- mWriter->selectDisplay(mPrimaryDisplay);
ASSERT_NO_FATAL_FAILURE(
mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
@@ -874,17 +839,16 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->validateDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- if (mReader->mCompositionChanges.size() != 0) {
- clearCommandReaderState();
+ if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
GTEST_SUCCEED();
return;
}
- mWriter->presentDisplay();
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
@@ -896,14 +860,14 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->validateDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- ASSERT_EQ(0, mReader->mCompositionChanges.size());
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->presentDisplay();
+ ASSERT_TRUE(mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty());
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
mTestRenderEngine->setRenderLayers(layers);
@@ -999,7 +963,6 @@
TEST_P(GraphicsBlendModeCompositionTest, None) {
for (ColorMode mode : mTestColorModes) {
- mWriter->selectDisplay(mPrimaryDisplay);
ASSERT_NO_FATAL_FAILURE(
mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
@@ -1008,8 +971,6 @@
return;
}
- mWriter->selectDisplay(mPrimaryDisplay);
-
std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
setBackgroundColor(BLACK);
@@ -1021,18 +982,17 @@
mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(mLayers);
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->validateDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- if (mReader->mCompositionChanges.size() != 0) {
- clearCommandReaderState();
+ if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
GTEST_SUCCEED();
return;
}
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->presentDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
mTestRenderEngine->setRenderLayers(mLayers);
@@ -1043,7 +1003,6 @@
TEST_P(GraphicsBlendModeCompositionTest, Coverage) {
for (ColorMode mode : mTestColorModes) {
- mWriter->selectDisplay(mPrimaryDisplay);
ASSERT_NO_FATAL_FAILURE(
mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
@@ -1052,8 +1011,6 @@
return;
}
- mWriter->selectDisplay(mPrimaryDisplay);
-
std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
setBackgroundColor(BLACK);
@@ -1066,25 +1023,23 @@
mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(mLayers);
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->validateDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- if (mReader->mCompositionChanges.size() != 0) {
- clearCommandReaderState();
+ if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
GTEST_SUCCEED();
return;
}
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->presentDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
}
}
TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) {
for (ColorMode mode : mTestColorModes) {
- mWriter->selectDisplay(mPrimaryDisplay);
ASSERT_NO_FATAL_FAILURE(
mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
@@ -1092,7 +1047,6 @@
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- mWriter->selectDisplay(mPrimaryDisplay);
std::vector<Color> expectedColors(static_cast<size_t>(mDisplayWidth * mDisplayHeight));
@@ -1105,18 +1059,17 @@
mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(mLayers);
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->validateDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- if (mReader->mCompositionChanges.size() != 0) {
- clearCommandReaderState();
+ if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
GTEST_SUCCEED();
return;
}
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->presentDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
mTestRenderEngine->setRenderLayers(mLayers);
ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
@@ -1128,7 +1081,7 @@
protected:
void SetUp() override {
GraphicsCompositionTest::SetUp();
- mWriter->selectDisplay(mPrimaryDisplay);
+
auto backgroundLayer = std::make_shared<TestColorLayer>(mComposerClient, mPrimaryDisplay);
backgroundLayer->setColor({0, 0, 0, 0});
backgroundLayer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight});
@@ -1159,8 +1112,6 @@
TEST_P(GraphicsTransformCompositionTest, FLIP_H) {
for (ColorMode mode : mTestColorModes) {
- ASSERT_NE(nullptr, mWriter);
- mWriter->selectDisplay(mPrimaryDisplay);
auto error =
mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC);
if (!error.isOk() &&
@@ -1187,18 +1138,17 @@
{0, mSideLength / 2, mSideLength / 2, mSideLength}, BLUE);
writeLayers(mLayers);
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->validateDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- if (mReader->mCompositionChanges.size() != 0) {
- clearCommandReaderState();
+ if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
GTEST_SUCCEED();
return;
}
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->presentDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
mTestRenderEngine->setRenderLayers(mLayers);
@@ -1209,7 +1159,6 @@
TEST_P(GraphicsTransformCompositionTest, FLIP_V) {
for (ColorMode mode : mTestColorModes) {
- mWriter->selectDisplay(mPrimaryDisplay);
ASSERT_NO_FATAL_FAILURE(
mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
@@ -1231,18 +1180,17 @@
{mSideLength / 2, 0, mSideLength, mSideLength / 2}, BLUE);
writeLayers(mLayers);
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->validateDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- if (mReader->mCompositionChanges.size() != 0) {
- clearCommandReaderState();
+ if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
GTEST_SUCCEED();
return;
}
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->presentDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
mTestRenderEngine->setRenderLayers(mLayers);
ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
@@ -1252,7 +1200,6 @@
TEST_P(GraphicsTransformCompositionTest, ROT_180) {
for (ColorMode mode : mTestColorModes) {
- mWriter->selectDisplay(mPrimaryDisplay);
ASSERT_NO_FATAL_FAILURE(
mComposerClient->setColorMode(mPrimaryDisplay, mode, RenderIntent::COLORIMETRIC));
@@ -1275,18 +1222,17 @@
{0, 0, mSideLength / 2, mSideLength / 2}, BLUE);
writeLayers(mLayers);
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->validateDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- if (!mReader->mCompositionChanges.empty()) {
- clearCommandReaderState();
+ if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
GTEST_SUCCEED();
return;
}
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->presentDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_NO_FATAL_FAILURE(readbackBuffer.checkReadbackBuffer(expectedColors));
mTestRenderEngine->setRenderLayers(mLayers);
ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
@@ -1313,4 +1259,4 @@
::android::PrintInstanceNameToString);
} // namespace
-} // namespace aidl::android::hardware::graphics::composer3::vts
\ No newline at end of file
+} // namespace aidl::android::hardware::graphics::composer3::vts
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
index b9460c8..4dbe191 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
@@ -4,18 +4,20 @@
#include <aidl/Gtest.h>
#include <aidl/Vintf.h>
+#include <aidl/android/hardware/graphics/common/BlendMode.h>
#include <aidl/android/hardware/graphics/common/BufferUsage.h>
#include <aidl/android/hardware/graphics/common/FRect.h>
#include <aidl/android/hardware/graphics/common/Rect.h>
-#include <aidl/android/hardware/graphics/composer3/BlendMode.h>
#include <aidl/android/hardware/graphics/composer3/Composition.h>
#include <aidl/android/hardware/graphics/composer3/IComposer.h>
#include <android-base/properties.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
-#include <android/hardware/graphics/composer3/command-buffer.h>
+#include <android/hardware/graphics/composer3/ComposerClientReader.h>
+#include <android/hardware/graphics/composer3/ComposerClientWriter.h>
#include <binder/ProcessState.h>
#include <gtest/gtest.h>
+#include <ui/Fence.h>
#include <ui/GraphicBuffer.h>
#include <ui/PixelFormat.h>
#include <algorithm>
@@ -27,7 +29,6 @@
#include <unordered_set>
#include <utility>
#include "composer-vts/include/GraphicsComposerCallback.h"
-#include "composer-vts/include/TestCommandReader.h"
// TODO(b/129481165): remove the #pragma below and fix conversion issues
#pragma clang diagnostic pop // ignored "-Wconversion
@@ -567,25 +568,6 @@
}
}
-TEST_P(GraphicsComposerAidlTest, getDisplayCapabilitiesBasic) {
- std::vector<DisplayCapability> capabilities;
- const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities);
- ASSERT_TRUE(error.isOk());
- const bool hasDozeSupport = std::find(capabilities.begin(), capabilities.end(),
- DisplayCapability::DOZE) != capabilities.end();
- bool isDozeSupported = false;
- EXPECT_TRUE(mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk());
- EXPECT_EQ(hasDozeSupport, isDozeSupported);
-
- bool hasBrightnessSupport = std::find(capabilities.begin(), capabilities.end(),
- DisplayCapability::BRIGHTNESS) != capabilities.end();
- bool isBrightnessSupported = false;
- EXPECT_TRUE(
- mComposerClient->getDisplayBrightnessSupport(mPrimaryDisplay, &isBrightnessSupported)
- .isOk());
- EXPECT_EQ(isBrightnessSupported, hasBrightnessSupport);
-}
-
/*
* Test that if brightness operations are supported, setDisplayBrightness works as expected.
*/
@@ -859,28 +841,6 @@
Test_setContentType(ContentType::GAME, "GAME");
}
-TEST_P(GraphicsComposerAidlTest, getLayerGenericMetadataKeys) {
- std::vector<LayerGenericMetadataKey> keys;
- EXPECT_TRUE(mComposerClient->getLayerGenericMetadataKeys(&keys).isOk());
-
- std::regex reverseDomainName("^[a-zA-Z-]{2,}(\\.[a-zA-Z0-9-]+)+$");
- std::unordered_set<std::string> uniqueNames;
- for (const auto& key : keys) {
- std::string name(key.name);
-
- // Keys must not start with 'android' or 'com.android'
- EXPECT_FALSE(name.find("android") == 0);
- EXPECT_FALSE(name.find("com.android") == 0);
-
- // Keys must be in reverse domain name format
- EXPECT_TRUE(std::regex_match(name, reverseDomainName));
-
- // Keys must be unique within this list
- const auto& [iter, inserted] = uniqueNames.insert(name);
- EXPECT_TRUE(inserted);
- }
-}
-
TEST_P(GraphicsComposerAidlTest, CreateVirtualDisplay) {
int32_t maxVirtualDisplayCount;
EXPECT_TRUE(mComposerClient->getMaxVirtualDisplayCount(&maxVirtualDisplayCount).isOk());
@@ -1010,18 +970,26 @@
}
}
-TEST_P(GraphicsComposerAidlTest, GetDozeSupportBadDisplay) {
- bool isDozeSupport;
- const auto error = mComposerClient->getDozeSupport(mInvalidDisplayId, &isDozeSupport);
- EXPECT_FALSE(error.isOk());
- ASSERT_EQ(IComposerClient::EX_BAD_DISPLAY, error.getServiceSpecificError());
-}
-
TEST_P(GraphicsComposerAidlTest, SetPowerModeUnsupported) {
- bool isDozeSupported;
- mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk();
+ std::vector<DisplayCapability> capabilities;
+ auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities);
+ ASSERT_TRUE(error.isOk());
+ const bool isDozeSupported = std::find(capabilities.begin(), capabilities.end(),
+ DisplayCapability::DOZE) != capabilities.end();
+ const bool isSuspendSupported = std::find(capabilities.begin(), capabilities.end(),
+ DisplayCapability::SUSPEND) != capabilities.end();
if (!isDozeSupported) {
- auto error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE);
+ error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE);
+ EXPECT_FALSE(error.isOk());
+ EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError());
+
+ error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE_SUSPEND);
+ EXPECT_FALSE(error.isOk());
+ EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError());
+ }
+
+ if (!isSuspendSupported) {
+ error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON_SUSPEND);
EXPECT_FALSE(error.isOk());
EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError());
@@ -1042,15 +1010,27 @@
}
TEST_P(GraphicsComposerAidlTest, SetPowerMode) {
+ std::vector<DisplayCapability> capabilities;
+ const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities);
+ ASSERT_TRUE(error.isOk());
+ const bool isDozeSupported = std::find(capabilities.begin(), capabilities.end(),
+ DisplayCapability::DOZE) != capabilities.end();
+ const bool isSuspendSupported = std::find(capabilities.begin(), capabilities.end(),
+ DisplayCapability::SUSPEND) != capabilities.end();
+
std::vector<PowerMode> modes;
modes.push_back(PowerMode::OFF);
- modes.push_back(PowerMode::ON_SUSPEND);
modes.push_back(PowerMode::ON);
- bool isDozeSupported;
- EXPECT_TRUE(mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk());
+ if (isSuspendSupported) {
+ modes.push_back(PowerMode::ON_SUSPEND);
+ }
+
if (isDozeSupported) {
modes.push_back(PowerMode::DOZE);
+ }
+
+ if (isSuspendSupported && isDozeSupported) {
modes.push_back(PowerMode::DOZE_SUSPEND);
}
@@ -1060,6 +1040,14 @@
}
TEST_P(GraphicsComposerAidlTest, SetPowerModeVariations) {
+ std::vector<DisplayCapability> capabilities;
+ const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities);
+ ASSERT_TRUE(error.isOk());
+ const bool isDozeSupported = std::find(capabilities.begin(), capabilities.end(),
+ DisplayCapability::DOZE) != capabilities.end();
+ const bool isSuspendSupported = std::find(capabilities.begin(), capabilities.end(),
+ DisplayCapability::SUSPEND) != capabilities.end();
+
std::vector<PowerMode> modes;
modes.push_back(PowerMode::OFF);
@@ -1084,15 +1072,15 @@
}
modes.clear();
- modes.push_back(PowerMode::ON_SUSPEND);
- modes.push_back(PowerMode::ON_SUSPEND);
- for (auto mode : modes) {
- EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk());
+ if (isSuspendSupported) {
+ modes.push_back(PowerMode::ON_SUSPEND);
+ modes.push_back(PowerMode::ON_SUSPEND);
+ for (auto mode : modes) {
+ EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk());
+ }
+ modes.clear();
}
- modes.clear();
- bool isDozeSupported = false;
- ASSERT_TRUE(mComposerClient->getDozeSupport(mPrimaryDisplay, &isDozeSupported).isOk());
if (isDozeSupported) {
modes.push_back(PowerMode::DOZE);
modes.push_back(PowerMode::DOZE);
@@ -1100,12 +1088,15 @@
EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk());
}
modes.clear();
+ }
+ if (isSuspendSupported && isDozeSupported) {
modes.push_back(PowerMode::DOZE_SUSPEND);
modes.push_back(PowerMode::DOZE_SUSPEND);
for (auto mode : modes) {
EXPECT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, mode).isOk());
}
+ modes.clear();
}
}
@@ -1148,45 +1139,27 @@
// Tests for Command.
class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest {
protected:
- void SetUp() override {
- ASSERT_NO_FATAL_FAILURE(GraphicsComposerAidlTest::SetUp());
-
- mWriter = std::make_unique<CommandWriterBase>(1024);
- mReader = std::make_unique<TestCommandReader>();
- }
-
void TearDown() override {
- ASSERT_EQ(0, mReader->mErrors.size());
- ASSERT_EQ(0, mReader->mCompositionChanges.size());
+ const auto errors = mReader.takeErrors();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ ASSERT_TRUE(mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty());
+
ASSERT_NO_FATAL_FAILURE(GraphicsComposerAidlTest::TearDown());
}
void execute() {
- TestCommandReader* reader = mReader.get();
- CommandWriterBase* writer = mWriter.get();
- bool queueChanged = false;
- int32_t commandLength = 0;
- std::vector<NativeHandle> commandHandles;
- ASSERT_TRUE(writer->writeQueue(&queueChanged, &commandLength, &commandHandles));
-
- if (queueChanged) {
- auto ret = mComposerClient->setInputCommandQueue(writer->getMQDescriptor());
- ASSERT_TRUE(ret.isOk());
+ const auto& commands = mWriter.getPendingCommands();
+ if (commands.empty()) {
+ mWriter.reset();
+ return;
}
- ExecuteCommandsStatus commandStatus;
- EXPECT_TRUE(mComposerClient->executeCommands(commandLength, commandHandles, &commandStatus)
- .isOk());
+ std::vector<CommandResultPayload> results;
+ const auto status = mComposerClient->executeCommands(commands, &results);
+ ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription();
- if (commandStatus.queueChanged) {
- MQDescriptor<int32_t, SynchronizedReadWrite> outputCommandQueue;
- ASSERT_TRUE(mComposerClient->getOutputCommandQueue(&outputCommandQueue).isOk());
- reader->setMQDescriptor(outputCommandQueue);
- }
- ASSERT_TRUE(reader->readQueue(commandStatus.length, std::move(commandStatus.handles)));
- reader->parse();
- reader->reset();
- writer->reset();
+ mReader.parse(std::move(results));
+ mWriter.reset();
}
static inline auto toTimePoint(nsecs_t time) {
@@ -1255,7 +1228,6 @@
std::this_thread::sleep_until(toTimePoint(timeline->refreshTimeNanos));
}
- mWriter->selectDisplay(display.get());
EXPECT_TRUE(mComposerClient->setPowerMode(display.get(), PowerMode::ON).isOk());
EXPECT_TRUE(
mComposerClient
@@ -1265,53 +1237,101 @@
int64_t layer = 0;
ASSERT_NO_FATAL_FAILURE(layer = createLayer(display));
{
- auto buffer = allocate();
+ const auto buffer = allocate();
ASSERT_NE(nullptr, buffer);
ASSERT_EQ(::android::OK, buffer->initCheck());
ASSERT_NE(nullptr, buffer->handle);
- mWriter->selectLayer(layer);
- mWriter->setLayerCompositionType(Composition::DEVICE);
- mWriter->setLayerDisplayFrame(display.getFrameRect());
- mWriter->setLayerPlaneAlpha(1);
- mWriter->setLayerSourceCrop(display.getCrop());
- mWriter->setLayerTransform(static_cast<Transform>(0));
- mWriter->setLayerVisibleRegion(std::vector<Rect>(1, display.getFrameRect()));
- mWriter->setLayerZOrder(10);
- mWriter->setLayerBlendMode(BlendMode::NONE);
- mWriter->setLayerSurfaceDamage(std::vector<Rect>(1, display.getFrameRect()));
- mWriter->setLayerBuffer(0, buffer->handle, -1);
- mWriter->setLayerDataspace(common::Dataspace::UNKNOWN);
+ mWriter.setLayerCompositionType(display.get(), layer, Composition::DEVICE);
+ mWriter.setLayerDisplayFrame(display.get(), layer, display.getFrameRect());
+ mWriter.setLayerPlaneAlpha(display.get(), layer, 1);
+ mWriter.setLayerSourceCrop(display.get(), layer, display.getCrop());
+ mWriter.setLayerTransform(display.get(), layer, static_cast<Transform>(0));
+ mWriter.setLayerVisibleRegion(display.get(), layer,
+ std::vector<Rect>(1, display.getFrameRect()));
+ mWriter.setLayerZOrder(display.get(), layer, 10);
+ mWriter.setLayerBlendMode(display.get(), layer, BlendMode::NONE);
+ mWriter.setLayerSurfaceDamage(display.get(), layer,
+ std::vector<Rect>(1, display.getFrameRect()));
+ mWriter.setLayerBuffer(display.get(), layer, 0, buffer->handle, -1);
+ mWriter.setLayerDataspace(display.get(), layer, common::Dataspace::UNKNOWN);
- mWriter->validateDisplay();
+ mWriter.validateDisplay(display.get(), ComposerClientWriter::kNoTimestamp);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
- mReader->mCompositionChanges.clear();
+ ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay();
+ mWriter.presentDisplay(display.get());
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
}
{
- auto buffer = allocate();
+ const auto buffer = allocate();
ASSERT_NE(nullptr, buffer->handle);
- mWriter->selectLayer(layer);
- mWriter->setLayerBuffer(0, buffer->handle, -1);
- mWriter->setLayerSurfaceDamage(std::vector<Rect>(1, {0, 0, 10, 10}));
- mWriter->validateDisplay();
+ mWriter.setLayerBuffer(display.get(), layer, 0, buffer->handle, -1);
+ mWriter.setLayerSurfaceDamage(display.get(), layer,
+ std::vector<Rect>(1, {0, 0, 10, 10}));
+ mWriter.validateDisplay(display.get(), ComposerClientWriter::kNoTimestamp);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
- mReader->mCompositionChanges.clear();
+ ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->presentDisplay();
+ mWriter.presentDisplay(display.get());
execute();
}
ASSERT_NO_FATAL_FAILURE(destroyLayer(display, layer));
}
+ sp<::android::Fence> presentAndGetFence(
+ std::optional<ClockMonotonicTimestamp> expectedPresentTime) {
+ mWriter.validateDisplay(mPrimaryDisplay, expectedPresentTime);
+ execute();
+ EXPECT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.presentDisplay(mPrimaryDisplay);
+ execute();
+ EXPECT_TRUE(mReader.takeErrors().empty());
+
+ auto presentFence = mReader.takePresentFence(mPrimaryDisplay);
+ // take ownership
+ const int fenceOwner = presentFence.get();
+ *presentFence.getR() = -1;
+ EXPECT_NE(-1, fenceOwner);
+ return sp<::android::Fence>::make(fenceOwner);
+ }
+
+ int32_t getVsyncPeriod() {
+ int32_t activeConfig;
+ EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &activeConfig).isOk());
+
+ int32_t vsyncPeriod;
+ EXPECT_TRUE(mComposerClient
+ ->getDisplayAttribute(mPrimaryDisplay, activeConfig,
+ DisplayAttribute::VSYNC_PERIOD, &vsyncPeriod)
+ .isOk());
+ return vsyncPeriod;
+ }
+
+ int64_t createOnScreenLayer() {
+ const int64_t layer = createLayer(mDisplays[0]);
+ mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::DEVICE);
+ mWriter.setLayerDisplayFrame(mPrimaryDisplay, layer, {0, 0, mDisplayWidth, mDisplayHeight});
+ mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 1);
+ mWriter.setLayerSourceCrop(
+ mPrimaryDisplay, layer,
+ {0, 0, static_cast<float>(mDisplayWidth), static_cast<float>(mDisplayHeight)});
+ mWriter.setLayerTransform(mPrimaryDisplay, layer, static_cast<Transform>(0));
+ mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer,
+ std::vector<Rect>(1, {0, 0, mDisplayWidth, mDisplayHeight}));
+ mWriter.setLayerZOrder(mPrimaryDisplay, layer, 10);
+ mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE);
+ mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer,
+ std::vector<Rect>(1, {0, 0, mDisplayWidth, mDisplayHeight}));
+ mWriter.setLayerDataspace(mPrimaryDisplay, layer, common::Dataspace::UNKNOWN);
+ return layer;
+ }
+
void Test_setActiveConfigWithConstraints(const TestParameters& params) {
for (VtsDisplay& display : mDisplays) {
forEachTwoConfigs(display.get(), [&](int32_t config1, int32_t config2) {
@@ -1402,6 +1422,47 @@
}
}
+ void Test_expectedPresentTime(std::optional<int> framesDelay) {
+ ASSERT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk());
+
+ const auto vsyncPeriod = getVsyncPeriod();
+
+ const auto buffer1 = allocate();
+ const auto buffer2 = allocate();
+ ASSERT_NE(nullptr, buffer1);
+ ASSERT_NE(nullptr, buffer2);
+
+ const auto layer = createOnScreenLayer();
+ mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, buffer1->handle, -1);
+ const sp<::android::Fence> presentFence1 =
+ presentAndGetFence(ComposerClientWriter::kNoTimestamp);
+ presentFence1->waitForever(LOG_TAG);
+
+ auto expectedPresentTime = presentFence1->getSignalTime() + vsyncPeriod;
+ if (framesDelay.has_value()) {
+ expectedPresentTime += *framesDelay * vsyncPeriod;
+ }
+
+ mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, buffer2->handle, -1);
+ const auto setExpectedPresentTime = [&]() -> std::optional<ClockMonotonicTimestamp> {
+ if (!framesDelay.has_value()) {
+ return ComposerClientWriter::kNoTimestamp;
+ } else if (*framesDelay == 0) {
+ return ClockMonotonicTimestamp{0};
+ }
+ return ClockMonotonicTimestamp{expectedPresentTime};
+ }();
+
+ const sp<::android::Fence> presentFence2 = presentAndGetFence(setExpectedPresentTime);
+ presentFence2->waitForever(LOG_TAG);
+
+ const auto actualPresentTime = presentFence2->getSignalTime();
+ const auto presentError = std::abs(expectedPresentTime - actualPresentTime);
+ EXPECT_LE(presentError, vsyncPeriod / 2);
+
+ ASSERT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk());
+ }
+
// clang-format off
const std::array<float, 16> kIdentity = {{
1.0f, 0.0f, 0.0f, 0.0f,
@@ -1411,26 +1472,23 @@
}};
// clang-format on
- std::unique_ptr<CommandWriterBase> mWriter;
- std::unique_ptr<TestCommandReader> mReader;
+ ComposerClientWriter mWriter;
+ ComposerClientReader mReader;
};
TEST_P(GraphicsComposerAidlCommandTest, SET_COLOR_TRANSFORM) {
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->setColorTransform(kIdentity.data(), ColorTransform::IDENTITY);
+ mWriter.setColorTransform(mPrimaryDisplay, kIdentity.data());
execute();
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerColorTransform) {
int64_t layer;
EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->selectLayer(layer);
- mWriter->setLayerColorTransform(kIdentity.data());
+ mWriter.setLayerColorTransform(mPrimaryDisplay, layer, kIdentity.data());
execute();
- if (mReader->mErrors.size() == 1 && mReader->mErrors[0].second == EX_UNSUPPORTED_OPERATION) {
- mReader->mErrors.clear();
+ const auto errors = mReader.takeErrors();
+ if (errors.size() == 1 && errors[0].errorCode == EX_UNSUPPORTED_OPERATION) {
GTEST_SUCCEED() << "setLayerColorTransform is not supported";
return;
}
@@ -1440,8 +1498,8 @@
EXPECT_TRUE(
mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kBufferSlotCount).isOk());
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->setClientTarget(0, nullptr, -1, Dataspace::UNKNOWN, std::vector<Rect>());
+ mWriter.setClientTarget(mPrimaryDisplay, 0, nullptr, -1, Dataspace::UNKNOWN,
+ std::vector<Rect>());
execute();
}
@@ -1460,30 +1518,27 @@
kBufferSlotCount, &display)
.isOk());
- mWriter->selectDisplay(display.display);
- auto handle = allocate()->handle;
- mWriter->setOutputBuffer(0, handle, -1);
+ const auto buffer = allocate();
+ const auto handle = buffer->handle;
+ mWriter.setOutputBuffer(display.display, 0, handle, -1);
execute();
}
TEST_P(GraphicsComposerAidlCommandTest, VALIDATE_DISPLAY) {
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->validateDisplay();
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
}
TEST_P(GraphicsComposerAidlCommandTest, ACCEPT_DISPLAY_CHANGES) {
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->validateDisplay();
- mWriter->acceptDisplayChanges();
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.acceptDisplayChanges(mPrimaryDisplay);
execute();
}
// TODO(b/208441745) fix the test failure
TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY) {
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->validateDisplay();
- mWriter->presentDisplay();
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
}
@@ -1503,7 +1558,6 @@
GTEST_SUCCEED() << "Device does not have skip validate capability, skipping";
return;
}
- mWriter->selectDisplay(mPrimaryDisplay);
mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON);
std::vector<RenderIntent> renderIntents;
@@ -1511,44 +1565,45 @@
for (auto intent : renderIntents) {
mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::NATIVE, intent);
- auto handle = allocate()->handle;
+ const auto buffer = allocate();
+ const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
Rect displayFrame{0, 0, mDisplayWidth, mDisplayHeight};
int64_t layer;
EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- mWriter->selectLayer(layer);
- mWriter->setLayerCompositionType(Composition::DEVICE);
- mWriter->setLayerDisplayFrame(displayFrame);
- mWriter->setLayerPlaneAlpha(1);
- mWriter->setLayerSourceCrop({0, 0, (float)mDisplayWidth, (float)mDisplayHeight});
- mWriter->setLayerTransform(static_cast<Transform>(0));
- mWriter->setLayerVisibleRegion(std::vector<Rect>(1, displayFrame));
- mWriter->setLayerZOrder(10);
- mWriter->setLayerBlendMode(BlendMode::NONE);
- mWriter->setLayerSurfaceDamage(std::vector<Rect>(1, displayFrame));
- mWriter->setLayerBuffer(0, handle, -1);
- mWriter->setLayerDataspace(Dataspace::UNKNOWN);
+ mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::DEVICE);
+ mWriter.setLayerDisplayFrame(mPrimaryDisplay, layer, displayFrame);
+ mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 1);
+ mWriter.setLayerSourceCrop(mPrimaryDisplay, layer,
+ {0, 0, (float)mDisplayWidth, (float)mDisplayHeight});
+ mWriter.setLayerTransform(mPrimaryDisplay, layer, static_cast<Transform>(0));
+ mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector<Rect>(1, displayFrame));
+ mWriter.setLayerZOrder(mPrimaryDisplay, layer, 10);
+ mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE);
+ mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector<Rect>(1, displayFrame));
+ mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle, -1);
+ mWriter.setLayerDataspace(mPrimaryDisplay, layer, Dataspace::UNKNOWN);
- mWriter->validateDisplay();
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- if (mReader->mCompositionChanges.size() != 0) {
+ if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
GTEST_SUCCEED() << "Composition change requested, skipping test";
return;
}
- ASSERT_EQ(0, mReader->mErrors.size());
- mWriter->presentDisplay();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
- ASSERT_EQ(0, mReader->mErrors.size());
+ ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->selectLayer(layer);
- auto handle2 = allocate()->handle;
+ const auto buffer2 = allocate();
+ const auto handle2 = buffer2->handle;
ASSERT_NE(nullptr, handle2);
- mWriter->setLayerBuffer(0, handle2, -1);
- mWriter->setLayerSurfaceDamage(std::vector<Rect>(1, {0, 0, 10, 10}));
- mWriter->presentDisplay();
+ mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle2, -1);
+ mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector<Rect>(1, {0, 0, 10, 10}));
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
}
}
@@ -1558,50 +1613,51 @@
int64_t layer;
EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- auto handle = allocate()->handle;
+ const auto buffer = allocate();
+ const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
Rect displayFrame{0, 0, mDisplayWidth, mDisplayHeight};
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->selectLayer(layer);
- mWriter->setLayerBuffer(0, handle, -1);
- mWriter->setLayerCompositionType(Composition::CURSOR);
- mWriter->setLayerDisplayFrame(displayFrame);
- mWriter->setLayerPlaneAlpha(1);
- mWriter->setLayerSourceCrop({0, 0, (float)mDisplayWidth, (float)mDisplayHeight});
- mWriter->setLayerTransform(static_cast<Transform>(0));
- mWriter->setLayerVisibleRegion(std::vector<Rect>(1, displayFrame));
- mWriter->setLayerZOrder(10);
- mWriter->setLayerBlendMode(BlendMode::NONE);
- mWriter->setLayerSurfaceDamage(std::vector<Rect>(1, displayFrame));
- mWriter->setLayerDataspace(Dataspace::UNKNOWN);
- mWriter->validateDisplay();
+ mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle, -1);
+ mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::CURSOR);
+ mWriter.setLayerDisplayFrame(mPrimaryDisplay, layer, displayFrame);
+ mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 1);
+ mWriter.setLayerSourceCrop(mPrimaryDisplay, layer,
+ {0, 0, (float)mDisplayWidth, (float)mDisplayHeight});
+ mWriter.setLayerTransform(mPrimaryDisplay, layer, static_cast<Transform>(0));
+ mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector<Rect>(1, displayFrame));
+ mWriter.setLayerZOrder(mPrimaryDisplay, layer, 10);
+ mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE);
+ mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector<Rect>(1, displayFrame));
+ mWriter.setLayerDataspace(mPrimaryDisplay, layer, Dataspace::UNKNOWN);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
- if (mReader->mCompositionChanges.size() != 0) {
+
+ if (!mReader.takeChangedCompositionTypes(mPrimaryDisplay).empty()) {
GTEST_SUCCEED() << "Composition change requested, skipping test";
return;
}
- mWriter->presentDisplay();
- ASSERT_EQ(0, mReader->mErrors.size());
+ mWriter.presentDisplay(mPrimaryDisplay);
+ ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->setLayerCursorPosition(1, 1);
- mWriter->setLayerCursorPosition(0, 0);
- mWriter->validateDisplay();
- mWriter->presentDisplay();
+ mWriter.setLayerCursorPosition(mPrimaryDisplay, layer, 1, 1);
+ execute();
+
+ mWriter.setLayerCursorPosition(mPrimaryDisplay, layer, 0, 0);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
+ mWriter.presentDisplay(mPrimaryDisplay);
execute();
}
TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_BUFFER) {
- auto handle = allocate()->handle;
+ const auto buffer = allocate();
+ const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
int64_t layer;
EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
-
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->selectLayer(layer);
- mWriter->setLayerBuffer(0, handle, -1);
+ mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle, -1);
execute();
}
@@ -1612,58 +1668,77 @@
Rect empty{0, 0, 0, 0};
Rect unit{0, 0, 1, 1};
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->selectLayer(layer);
- mWriter->setLayerSurfaceDamage(std::vector<Rect>(1, empty));
- mWriter->setLayerSurfaceDamage(std::vector<Rect>(1, unit));
- mWriter->setLayerSurfaceDamage(std::vector<Rect>());
+ mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector<Rect>(1, empty));
execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector<Rect>(1, unit));
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector<Rect>());
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
}
TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_BLEND_MODE) {
int64_t layer;
EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->selectLayer(layer);
- mWriter->setLayerBlendMode(BlendMode::NONE);
- mWriter->setLayerBlendMode(BlendMode::PREMULTIPLIED);
- mWriter->setLayerBlendMode(BlendMode::COVERAGE);
+ mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE);
execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::PREMULTIPLIED);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::COVERAGE);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
}
TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_COLOR) {
int64_t layer;
EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->selectLayer(layer);
- mWriter->setLayerColor(Color{static_cast<int8_t>(0xff), static_cast<int8_t>(0xff),
- static_cast<int8_t>(0xff), static_cast<int8_t>(0xff)});
- mWriter->setLayerColor(Color{0, 0, 0, 0});
+ mWriter.setLayerColor(mPrimaryDisplay, layer,
+ Color{static_cast<int8_t>(0xff), static_cast<int8_t>(0xff),
+ static_cast<int8_t>(0xff), static_cast<int8_t>(0xff)});
execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerColor(mPrimaryDisplay, layer, Color{0, 0, 0, 0});
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
}
TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_COMPOSITION_TYPE) {
int64_t layer;
EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->selectLayer(layer);
- mWriter->setLayerCompositionType(Composition::CLIENT);
- mWriter->setLayerCompositionType(Composition::DEVICE);
- mWriter->setLayerCompositionType(Composition::SOLID_COLOR);
- mWriter->setLayerCompositionType(Composition::CURSOR);
+ mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::CLIENT);
execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::DEVICE);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::SOLID_COLOR);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::CURSOR);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
}
TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_DATASPACE) {
int64_t layer;
EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->selectLayer(layer);
- mWriter->setLayerDataspace(Dataspace::UNKNOWN);
+ mWriter.setLayerDataspace(mPrimaryDisplay, layer, Dataspace::UNKNOWN);
execute();
}
@@ -1671,9 +1746,7 @@
int64_t layer;
EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->selectLayer(layer);
- mWriter->setLayerDisplayFrame(Rect{0, 0, 1, 1});
+ mWriter.setLayerDisplayFrame(mPrimaryDisplay, layer, Rect{0, 0, 1, 1});
execute();
}
@@ -1681,11 +1754,13 @@
int64_t layer;
EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->selectLayer(layer);
- mWriter->setLayerPlaneAlpha(0.0f);
- mWriter->setLayerPlaneAlpha(1.0f);
+ mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 0.0f);
execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 1.0f);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
}
TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SIDEBAND_STREAM) {
@@ -1697,15 +1772,14 @@
return;
}
- auto handle = allocate()->handle;
+ const auto buffer = allocate();
+ const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
int64_t layer;
EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->selectLayer(layer);
- mWriter->setLayerSidebandStream(handle);
+ mWriter.setLayerSidebandStream(mPrimaryDisplay, layer, handle);
execute();
}
@@ -1713,9 +1787,7 @@
int64_t layer;
EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->selectLayer(layer);
- mWriter->setLayerSourceCrop(FRect{0.0f, 0.0f, 1.0f, 1.0f});
+ mWriter.setLayerSourceCrop(mPrimaryDisplay, layer, FRect{0.0f, 0.0f, 1.0f, 1.0f});
execute();
}
@@ -1723,19 +1795,41 @@
int64_t layer;
EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->selectLayer(layer);
- mWriter->setLayerTransform(static_cast<Transform>(0));
- mWriter->setLayerTransform(Transform::FLIP_H);
- mWriter->setLayerTransform(Transform::FLIP_V);
- mWriter->setLayerTransform(Transform::ROT_90);
- mWriter->setLayerTransform(Transform::ROT_180);
- mWriter->setLayerTransform(Transform::ROT_270);
- mWriter->setLayerTransform(static_cast<Transform>(static_cast<int>(Transform::FLIP_H) |
- static_cast<int>(Transform::ROT_90)));
- mWriter->setLayerTransform(static_cast<Transform>(static_cast<int>(Transform::FLIP_V) |
- static_cast<int>(Transform::ROT_90)));
+ mWriter.setLayerTransform(mPrimaryDisplay, layer, static_cast<Transform>(0));
execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::FLIP_H);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::FLIP_V);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::ROT_90);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::ROT_180);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerTransform(mPrimaryDisplay, layer, Transform::ROT_270);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerTransform(mPrimaryDisplay, layer,
+ static_cast<Transform>(static_cast<int>(Transform::FLIP_H) |
+ static_cast<int>(Transform::ROT_90)));
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerTransform(mPrimaryDisplay, layer,
+ static_cast<Transform>(static_cast<int>(Transform::FLIP_V) |
+ static_cast<int>(Transform::ROT_90)));
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
}
TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_VISIBLE_REGION) {
@@ -1745,32 +1839,36 @@
Rect empty{0, 0, 0, 0};
Rect unit{0, 0, 1, 1};
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->selectLayer(layer);
- mWriter->setLayerVisibleRegion(std::vector<Rect>(1, empty));
- mWriter->setLayerVisibleRegion(std::vector<Rect>(1, unit));
- mWriter->setLayerVisibleRegion(std::vector<Rect>());
+ mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector<Rect>(1, empty));
execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector<Rect>(1, unit));
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer, std::vector<Rect>());
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
}
TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_Z_ORDER) {
int64_t layer;
EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->selectLayer(layer);
- mWriter->setLayerZOrder(10);
- mWriter->setLayerZOrder(0);
+ mWriter.setLayerZOrder(mPrimaryDisplay, layer, 10);
execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.setLayerZOrder(mPrimaryDisplay, layer, 0);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
}
TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_PER_FRAME_METADATA) {
int64_t layer;
EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- mWriter->selectDisplay(mPrimaryDisplay);
- mWriter->selectLayer(layer);
-
/**
* DISPLAY_P3 is a color space that uses the DCI_P3 primaries,
* the D65 white point and the SRGB transfer functions.
@@ -1796,11 +1894,11 @@
aidlMetadata.push_back({PerFrameMetadataKey::MIN_LUMINANCE, 0.1f});
aidlMetadata.push_back({PerFrameMetadataKey::MAX_CONTENT_LIGHT_LEVEL, 78.0});
aidlMetadata.push_back({PerFrameMetadataKey::MAX_FRAME_AVERAGE_LIGHT_LEVEL, 62.0});
- mWriter->setLayerPerFrameMetadata(aidlMetadata);
+ mWriter.setLayerPerFrameMetadata(mPrimaryDisplay, layer, aidlMetadata);
execute();
- if (mReader->mErrors.size() == 1 && mReader->mErrors[0].second == EX_UNSUPPORTED_OPERATION) {
- mReader->mErrors.clear();
+ const auto errors = mReader.takeErrors();
+ if (errors.size() == 1 && errors[0].errorCode == EX_UNSUPPORTED_OPERATION) {
GTEST_SUCCEED() << "SetLayerPerFrameMetadata is not supported";
EXPECT_TRUE(mComposerClient->destroyLayer(mPrimaryDisplay, layer).isOk());
return;
@@ -1907,6 +2005,18 @@
}
}
+TEST_P(GraphicsComposerAidlCommandTest, expectedPresentTime_NoTimestamp) {
+ ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(std::nullopt));
+}
+
+TEST_P(GraphicsComposerAidlCommandTest, expectedPresentTime_0) {
+ ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(0));
+}
+
+TEST_P(GraphicsComposerAidlCommandTest, expectedPresentTime_5) {
+ ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(5));
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandTest);
INSTANTIATE_TEST_SUITE_P(
PerInstance, GraphicsComposerAidlCommandTest,
@@ -1929,5 +2039,41 @@
ALOGE("Failed to stop init.svc.surfaceflinger");
return -1;
}
+
+ android::ProcessState::self()->setThreadPoolMaxThreadCount(4);
+
+ // The binder threadpool we start will inherit sched policy and priority
+ // of (this) creating thread. We want the binder thread pool to have
+ // SCHED_FIFO policy and priority 1 (lowest RT priority)
+ // Once the pool is created we reset this thread's priority back to
+ // original.
+ // This thread policy is based on what we do in the SurfaceFlinger while starting
+ // the thread pool and we need to replicate that for the VTS tests.
+ int newPriority = 0;
+ int origPolicy = sched_getscheduler(0);
+ struct sched_param origSchedParam;
+
+ int errorInPriorityModification = sched_getparam(0, &origSchedParam);
+ if (errorInPriorityModification == 0) {
+ int policy = SCHED_FIFO;
+ newPriority = sched_get_priority_min(policy);
+
+ struct sched_param param;
+ param.sched_priority = newPriority;
+
+ errorInPriorityModification = sched_setscheduler(0, policy, ¶m);
+ }
+
+ // start the thread pool
+ android::ProcessState::self()->startThreadPool();
+
+ // Reset current thread's policy and priority
+ if (errorInPriorityModification == 0) {
+ errorInPriorityModification = sched_setscheduler(0, origPolicy, &origSchedParam);
+ } else {
+ ALOGE("Failed to set VtsHalGraphicsComposer3_TargetTest binder threadpool priority to "
+ "SCHED_FIFO");
+ }
+
return RUN_ALL_TESTS();
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp
index 2b058c7..df038db 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/Android.bp
@@ -28,7 +28,6 @@
defaults: ["hidl_defaults"],
srcs: [
"GraphicsComposerCallback.cpp",
- "TestCommandReader.cpp",
"ReadbackVts.cpp",
"RenderEngineVts.cpp",
],
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp
index b612309..5eb912b 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp
@@ -32,15 +32,14 @@
const std::vector<Dataspace> ReadbackHelper::dataspaces = {common::Dataspace::SRGB,
common::Dataspace::DISPLAY_P3};
-void TestLayer::write(const std::shared_ptr<CommandWriterBase>& writer) {
- writer->selectLayer(mLayer);
- writer->setLayerDisplayFrame(mDisplayFrame);
- writer->setLayerSourceCrop(mSourceCrop);
- writer->setLayerZOrder(mZOrder);
- writer->setLayerSurfaceDamage(mSurfaceDamage);
- writer->setLayerTransform(mTransform);
- writer->setLayerPlaneAlpha(mAlpha);
- writer->setLayerBlendMode(mBlendMode);
+void TestLayer::write(ComposerClientWriter& writer) {
+ writer.setLayerDisplayFrame(mDisplay, mLayer, mDisplayFrame);
+ writer.setLayerSourceCrop(mDisplay, mLayer, mSourceCrop);
+ writer.setLayerZOrder(mDisplay, mLayer, mZOrder);
+ writer.setLayerSurfaceDamage(mDisplay, mLayer, mSurfaceDamage);
+ writer.setLayerTransform(mDisplay, mLayer, mTransform);
+ writer.setLayerPlaneAlpha(mDisplay, mLayer, mAlpha);
+ writer.setLayerBlendMode(mDisplay, mLayer, mBlendMode);
}
std::string ReadbackHelper::getColorModeString(ColorMode mode) {
@@ -243,21 +242,21 @@
int outBytesPerPixel;
int outBytesPerStride;
- auto status = mGraphicBuffer->lockAsync(mUsage, mAccessRegion, nullptr, fenceHandle.get(),
+ void* bufData = nullptr;
+ auto status = mGraphicBuffer->lockAsync(mUsage, mAccessRegion, &bufData, fenceHandle.get(),
&outBytesPerPixel, &outBytesPerStride);
EXPECT_EQ(::android::OK, status);
ASSERT_TRUE(mPixelFormat == PixelFormat::RGB_888 || mPixelFormat == PixelFormat::RGBA_8888);
- ReadbackHelper::compareColorBuffers(expectedColors, mGraphicBuffer.get(),
- static_cast<int32_t>(mStride), mWidth, mHeight,
- mPixelFormat);
+ ReadbackHelper::compareColorBuffers(expectedColors, bufData, static_cast<int32_t>(mStride),
+ mWidth, mHeight, mPixelFormat);
status = mGraphicBuffer->unlock();
EXPECT_EQ(::android::OK, status);
}
-void TestColorLayer::write(const std::shared_ptr<CommandWriterBase>& writer) {
+void TestColorLayer::write(ComposerClientWriter& writer) {
TestLayer::write(writer);
- writer->setLayerCompositionType(Composition::SOLID_COLOR);
- writer->setLayerColor(mColor);
+ writer.setLayerCompositionType(mDisplay, mLayer, Composition::SOLID_COLOR);
+ writer.setLayerColor(mDisplay, mLayer, mColor);
}
LayerSettings TestColorLayer::toRenderEngineLayerSettings() {
@@ -297,12 +296,12 @@
setSourceCrop({0, 0, (float)width, (float)height});
}
-void TestBufferLayer::write(const std::shared_ptr<CommandWriterBase>& writer) {
+void TestBufferLayer::write(ComposerClientWriter& writer) {
TestLayer::write(writer);
- writer->setLayerCompositionType(mComposition);
- writer->setLayerVisibleRegion(std::vector<Rect>(1, mDisplayFrame));
+ writer.setLayerCompositionType(mDisplay, mLayer, mComposition);
+ writer.setLayerVisibleRegion(mDisplay, mLayer, std::vector<Rect>(1, mDisplayFrame));
if (mGraphicBuffer->handle != nullptr)
- writer->setLayerBuffer(0, mGraphicBuffer->handle, mFillFence);
+ writer.setLayerBuffer(mDisplay, mLayer, 0, mGraphicBuffer->handle, mFillFence);
}
LayerSettings TestBufferLayer::toRenderEngineLayerSettings() {
@@ -346,15 +345,12 @@
ASSERT_EQ(::android::OK, mGraphicBuffer->initCheck());
}
-void TestBufferLayer::setDataspace(common::Dataspace dataspace,
- const std::shared_ptr<CommandWriterBase>& writer) {
- writer->selectLayer(mLayer);
- writer->setLayerDataspace(dataspace);
+void TestBufferLayer::setDataspace(common::Dataspace dataspace, ComposerClientWriter& writer) {
+ writer.setLayerDataspace(mDisplay, mLayer, dataspace);
}
-void TestBufferLayer::setToClientComposition(const std::shared_ptr<CommandWriterBase>& writer) {
- writer->selectLayer(mLayer);
- writer->setLayerCompositionType(Composition::CLIENT);
+void TestBufferLayer::setToClientComposition(ComposerClientWriter& writer) {
+ writer.setLayerCompositionType(mDisplay, mLayer, Composition::CLIENT);
}
-} // namespace aidl::android::hardware::graphics::composer3::vts
\ No newline at end of file
+} // namespace aidl::android::hardware::graphics::composer3::vts
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp
index e83750e..50ce462 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/RenderEngineVts.cpp
@@ -86,4 +86,4 @@
ASSERT_EQ(::android::OK, mGraphicBuffer->unlock());
}
-} // namespace aidl::android::hardware::graphics::composer3::vts
\ No newline at end of file
+} // namespace aidl::android::hardware::graphics::composer3::vts
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/TestCommandReader.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/TestCommandReader.cpp
deleted file mode 100644
index a5a84d9..0000000
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/TestCommandReader.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "include/TestCommandReader.h"
-#include <gtest/gtest.h>
-
-namespace aidl::android::hardware::graphics::composer3::vts {
-
-void TestCommandReader::parse() {
- mErrors.clear();
- mCompositionChanges.clear();
- while (!isEmpty()) {
- int32_t command;
- uint16_t length;
- ASSERT_TRUE(beginCommand(&command, &length));
-
- parseSingleCommand(command, length);
-
- endCommand();
- }
-}
-
-void TestCommandReader::parseSingleCommand(int32_t commandRaw, uint16_t length) {
- auto command = static_cast<Command>(commandRaw);
-
- switch (command) {
- case Command::SET_CLIENT_TARGET_PROPERTY: {
- ASSERT_EQ(2, length);
- read();
- close(readFence());
- } break;
- case Command::SELECT_DISPLAY: {
- ASSERT_EQ(2, length);
- read64(); // display
- } break;
- case Command::SET_ERROR: {
- ASSERT_EQ(2, length);
- auto loc = read();
- auto err = readSigned();
- std::pair<uint32_t, uint32_t> error(loc, err);
- mErrors.push_back(error);
- } break;
- case Command::SET_CHANGED_COMPOSITION_TYPES: {
- ASSERT_EQ(0, length % 3);
- for (uint16_t count = 0; count < length / 3; ++count) {
- uint64_t layerId = read64();
- uint32_t composition = read();
-
- std::pair<uint64_t, uint32_t> compositionChange(layerId, composition);
- mCompositionChanges.push_back(compositionChange);
- }
- } break;
- case Command::SET_DISPLAY_REQUESTS: {
- ASSERT_EQ(1, length % 3);
- read(); // displayRequests, ignored for now
- for (uint16_t count = 0; count < (length - 1) / 3; ++count) {
- read64(); // layer
- // silently eat requests to clear the client target, since we won't be testing
- // client composition anyway
- ASSERT_EQ(1u, read());
- }
- } break;
- case Command::SET_PRESENT_FENCE: {
- ASSERT_EQ(1, length);
- close(readFence());
- } break;
- case Command::SET_RELEASE_FENCES: {
- ASSERT_EQ(0, length % 3);
- for (uint16_t count = 0; count < length / 3; ++count) {
- read64();
- close(readFence());
- }
- } break;
- default:
- GTEST_FAIL() << "unexpected return command " << std::hex << static_cast<int>(command);
- break;
- }
-}
-} // namespace aidl::android::hardware::graphics::composer3::vts
\ No newline at end of file
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h
index 85b4fdc..60a036e 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h
@@ -21,10 +21,10 @@
#pragma clang diagnostic ignored "-Wconversion"
#include <GraphicsComposerCallback.h>
-#include <TestCommandReader.h>
#include <aidl/android/hardware/graphics/composer3/IComposerClient.h>
#include <android-base/unique_fd.h>
-#include <android/hardware/graphics/composer3/command-buffer.h>
+#include <android/hardware/graphics/composer3/ComposerClientReader.h>
+#include <android/hardware/graphics/composer3/ComposerClientWriter.h>
#include <mapper-vts/2.1/MapperVts.h>
#include <renderengine/RenderEngine.h>
#include <ui/GraphicBuffer.h>
@@ -54,7 +54,7 @@
class TestLayer {
public:
TestLayer(const std::shared_ptr<IComposerClient>& client, int64_t display)
- : mComposerClient(client) {
+ : mDisplay(display), mComposerClient(client) {
client->createLayer(display, kBufferSlotCount, &mLayer);
}
@@ -62,7 +62,7 @@
// call destroyLayers here
virtual ~TestLayer(){};
- virtual void write(const std::shared_ptr<CommandWriterBase>& writer);
+ virtual void write(ComposerClientWriter& writer);
virtual LayerSettings toRenderEngineLayerSettings();
void setDisplayFrame(Rect frame) { mDisplayFrame = frame; }
@@ -83,7 +83,10 @@
float getAlpha() const { return mAlpha; }
+ int64_t getLayer() const { return mLayer; }
+
protected:
+ int64_t mDisplay;
int64_t mLayer;
Rect mDisplayFrame = {0, 0, 0, 0};
std::vector<Rect> mSurfaceDamage;
@@ -103,7 +106,7 @@
TestColorLayer(const std::shared_ptr<IComposerClient>& client, int64_t display)
: TestLayer{client, display} {}
- void write(const std::shared_ptr<CommandWriterBase>& writer) override;
+ void write(ComposerClientWriter& writer) override;
LayerSettings toRenderEngineLayerSettings() override;
@@ -121,7 +124,7 @@
uint32_t height, common::PixelFormat format,
Composition composition = Composition::DEVICE);
- void write(const std::shared_ptr<CommandWriterBase>& writer) override;
+ void write(ComposerClientWriter& writer) override;
LayerSettings toRenderEngineLayerSettings() override;
@@ -129,9 +132,9 @@
void setBuffer(std::vector<Color> colors);
- void setDataspace(Dataspace dataspace, const std::shared_ptr<CommandWriterBase>& writer);
+ void setDataspace(Dataspace dataspace, ComposerClientWriter& writer);
- void setToClientComposition(const std::shared_ptr<CommandWriterBase>& writer);
+ void setToClientComposition(ComposerClientWriter& writer);
uint32_t getWidth() const { return mWidth; }
@@ -211,4 +214,4 @@
native_handle_t mBufferHandle;
};
-} // namespace aidl::android::hardware::graphics::composer3::vts
\ No newline at end of file
+} // namespace aidl::android::hardware::graphics::composer3::vts
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h
index eaff6d7..2798e09 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/RenderEngineVts.h
@@ -68,4 +68,4 @@
DisplaySettings mDisplaySettings;
};
-} // namespace aidl::android::hardware::graphics::composer3::vts
\ No newline at end of file
+} // namespace aidl::android::hardware::graphics::composer3::vts
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/TestCommandReader.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/TestCommandReader.h
deleted file mode 100644
index 852a56e..0000000
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/TestCommandReader.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Copyright (c) 2021, 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.
- */
-#pragma once
-
-// TODO(b/129481165): remove the #pragma below and fix conversion issues
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wconversion"
-
-#include <android/hardware/graphics/composer3/command-buffer.h>
-
-// TODO(b/129481165): remove the #pragma below and fix conversion issues
-#pragma clang diagnostic pop // ignored "-Wconversion
-
-namespace aidl::android::hardware::graphics::composer3::vts {
-
-class TestCommandReader : public CommandReaderBase {
- public:
- virtual ~TestCommandReader() = default;
-
- std::vector<std::pair<uint32_t, uint32_t>> mErrors;
- std::vector<std::pair<uint64_t, uint32_t>> mCompositionChanges;
-
- // Parse all commands in the return command queue. Call GTEST_FAIL() for
- // unexpected errors or commands.
- void parse();
- virtual void parseSingleCommand(int32_t commandRaw, uint16_t length);
-};
-} // namespace aidl::android::hardware::graphics::composer3::vts
diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h
new file mode 100644
index 0000000..f9e35e9
--- /dev/null
+++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientReader.h
@@ -0,0 +1,226 @@
+/*
+ * Copyright 2021 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.
+ */
+
+#pragma once
+
+#include <algorithm>
+#include <limits>
+#include <memory>
+#include <unordered_map>
+#include <unordered_set>
+#include <vector>
+
+#include <inttypes.h>
+#include <string.h>
+
+#include <aidl/android/hardware/graphics/composer3/ClientTargetProperty.h>
+#include <aidl/android/hardware/graphics/composer3/Composition.h>
+#include <aidl/android/hardware/graphics/composer3/CommandResultPayload.h>
+
+
+#include <log/log.h>
+#include <sync/sync.h>
+
+
+using aidl::android::hardware::graphics::common::Dataspace;
+
+namespace aidl::android::hardware::graphics::composer3 {
+
+class ComposerClientReader {
+ public:
+ ~ComposerClientReader() { resetData(); }
+
+ // Parse and execute commands from the command queue. The commands are
+ // actually return values from the server and will be saved in ReturnData.
+ void parse(std::vector<CommandResultPayload>&& results) {
+ resetData();
+
+ for (auto& result : results) {
+ switch (result.getTag()) {
+ case CommandResultPayload::Tag::error:
+ parseSetError(std::move(result.get<CommandResultPayload::Tag::error>()));
+ break;
+ case CommandResultPayload::Tag::changedCompositionTypes:
+ parseSetChangedCompositionTypes(std::move(
+ result.get<CommandResultPayload::Tag::changedCompositionTypes>()));
+ break;
+ case CommandResultPayload::Tag::displayRequest:
+ parseSetDisplayRequests(
+ std::move(result.get<CommandResultPayload::Tag::displayRequest>()));
+ break;
+ case CommandResultPayload::Tag::presentFence:
+ parseSetPresentFence(
+ std::move(result.get<CommandResultPayload::Tag::presentFence>()));
+ break;
+ case CommandResultPayload::Tag::releaseFences:
+ parseSetReleaseFences(
+ std::move(result.get<CommandResultPayload::Tag::releaseFences>()));
+ break;
+ case CommandResultPayload::Tag::presentOrValidateResult:
+ parseSetPresentOrValidateDisplayResult(std::move(
+ result.get<CommandResultPayload::Tag::presentOrValidateResult>()));
+ break;
+ case CommandResultPayload::Tag::clientTargetProperty:
+ parseSetClientTargetProperty(std::move(
+ result.get<CommandResultPayload::Tag::clientTargetProperty>()));
+ break;
+ }
+ }
+ }
+
+ std::vector<CommandError> takeErrors() { return std::move(mErrors); }
+
+ void hasChanges(int64_t display, uint32_t* outNumChangedCompositionTypes,
+ uint32_t* outNumLayerRequestMasks) const {
+ auto found = mReturnData.find(display);
+ if (found == mReturnData.end()) {
+ *outNumChangedCompositionTypes = 0;
+ *outNumLayerRequestMasks = 0;
+ return;
+ }
+
+ const ReturnData& data = found->second;
+
+ *outNumChangedCompositionTypes = static_cast<uint32_t>(data.changedLayers.size());
+ *outNumLayerRequestMasks = static_cast<uint32_t>(data.displayRequests.layerRequests.size());
+ }
+
+ // Get and clear saved changed composition types.
+ std::vector<ChangedCompositionLayer> takeChangedCompositionTypes(int64_t display) {
+ auto found = mReturnData.find(display);
+ if (found == mReturnData.end()) {
+ return {};
+ }
+
+ ReturnData& data = found->second;
+ return std::move(data.changedLayers);
+ }
+
+ // Get and clear saved display requests.
+ DisplayRequest takeDisplayRequests(int64_t display) {
+ auto found = mReturnData.find(display);
+ if (found == mReturnData.end()) {
+ return {};
+ }
+
+ ReturnData& data = found->second;
+ return std::move(data.displayRequests);
+ }
+
+ // Get and clear saved release fences.
+ std::vector<ReleaseFences::Layer> takeReleaseFences(int64_t display) {
+ auto found = mReturnData.find(display);
+ if (found == mReturnData.end()) {
+ return {};
+ }
+
+ ReturnData& data = found->second;
+ return std::move(data.releasedLayers);
+ }
+
+ // Get and clear saved present fence.
+ ndk::ScopedFileDescriptor takePresentFence(int64_t display) {
+ auto found = mReturnData.find(display);
+ if (found == mReturnData.end()) {
+ return {};
+ }
+
+ ReturnData& data = found->second;
+ return std::move(data.presentFence);
+ }
+
+ // Get what stage succeeded during PresentOrValidate: Present or Validate
+ std::optional<PresentOrValidate::Result> takePresentOrValidateStage(int64_t display) {
+ auto found = mReturnData.find(display);
+ if (found == mReturnData.end()) {
+ return std::nullopt;
+ }
+ ReturnData& data = found->second;
+ return data.presentOrValidateState;
+ }
+
+ // Get the client target properties requested by hardware composer.
+ ClientTargetPropertyWithNits takeClientTargetProperty(int64_t display) {
+ auto found = mReturnData.find(display);
+
+ // If not found, return the default values.
+ if (found == mReturnData.end()) {
+ return ClientTargetPropertyWithNits{
+ .clientTargetProperty = {common::PixelFormat::RGBA_8888, Dataspace::UNKNOWN},
+ .whitePointNits = -1.f,
+ };
+ }
+
+ ReturnData& data = found->second;
+ return std::move(data.clientTargetProperty);
+ }
+
+ private:
+ void resetData() {
+ mErrors.clear();
+ mReturnData.clear();
+ }
+
+ void parseSetError(CommandError&& error) { mErrors.emplace_back(error); }
+
+ void parseSetChangedCompositionTypes(ChangedCompositionTypes&& changedCompositionTypes) {
+ auto& data = mReturnData[changedCompositionTypes.display];
+ data.changedLayers = std::move(changedCompositionTypes.layers);
+ }
+
+ void parseSetDisplayRequests(DisplayRequest&& displayRequest) {
+ auto& data = mReturnData[displayRequest.display];
+ data.displayRequests = std::move(displayRequest);
+ }
+
+ void parseSetPresentFence(PresentFence&& presentFence) {
+ auto& data = mReturnData[presentFence.display];
+ data.presentFence = std::move(presentFence.fence);
+ }
+
+ void parseSetReleaseFences(ReleaseFences&& releaseFences) {
+ auto& data = mReturnData[releaseFences.display];
+ data.releasedLayers = std::move(releaseFences.layers);
+ }
+
+ void parseSetPresentOrValidateDisplayResult(const PresentOrValidate&& presentOrValidate) {
+ auto& data = mReturnData[presentOrValidate.display];
+ data.presentOrValidateState = std::move(presentOrValidate.result);
+ }
+
+ void parseSetClientTargetProperty(const ClientTargetPropertyWithNits&& clientTargetProperty) {
+ auto& data = mReturnData[clientTargetProperty.display];
+ data.clientTargetProperty = std::move(clientTargetProperty);
+ }
+
+ struct ReturnData {
+ DisplayRequest displayRequests;
+ std::vector<ChangedCompositionLayer> changedLayers;
+ ndk::ScopedFileDescriptor presentFence;
+ std::vector<ReleaseFences::Layer> releasedLayers;
+ PresentOrValidate::Result presentOrValidateState;
+
+ ClientTargetPropertyWithNits clientTargetProperty = {
+ .clientTargetProperty = {common::PixelFormat::RGBA_8888, Dataspace::UNKNOWN},
+ .whitePointNits = -1.f,
+ };
+ };
+
+ std::vector<CommandError> mErrors;
+ std::unordered_map<int64_t, ReturnData> mReturnData;
+};
+
+} // namespace aidl::android::hardware::graphics::composer3
diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
new file mode 100644
index 0000000..16d63e5
--- /dev/null
+++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
@@ -0,0 +1,270 @@
+/*
+ * Copyright 2021 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.
+ */
+
+#pragma once
+
+#include <algorithm>
+#include <limits>
+#include <memory>
+#include <unordered_map>
+#include <unordered_set>
+#include <vector>
+
+#include <inttypes.h>
+#include <string.h>
+
+#include <aidl/android/hardware/graphics/common/BlendMode.h>
+#include <aidl/android/hardware/graphics/composer3/Color.h>
+#include <aidl/android/hardware/graphics/composer3/Composition.h>
+#include <aidl/android/hardware/graphics/composer3/FloatColor.h>
+#include <aidl/android/hardware/graphics/composer3/PerFrameMetadata.h>
+#include <aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h>
+
+#include <aidl/android/hardware/graphics/composer3/DisplayCommand.h>
+
+#include <aidl/android/hardware/graphics/common/ColorTransform.h>
+#include <aidl/android/hardware/graphics/common/FRect.h>
+#include <aidl/android/hardware/graphics/common/Rect.h>
+#include <aidl/android/hardware/graphics/common/Transform.h>
+
+#include <log/log.h>
+#include <sync/sync.h>
+
+#include <aidlcommonsupport/NativeHandle.h>
+
+using aidl::android::hardware::graphics::common::BlendMode;
+using aidl::android::hardware::graphics::common::ColorTransform;
+using aidl::android::hardware::graphics::common::Dataspace;
+using aidl::android::hardware::graphics::common::FRect;
+using aidl::android::hardware::graphics::common::Rect;
+using aidl::android::hardware::graphics::common::Transform;
+
+using namespace aidl::android::hardware::graphics::composer3;
+
+using aidl::android::hardware::common::NativeHandle;
+
+namespace aidl::android::hardware::graphics::composer3 {
+
+class ComposerClientWriter {
+ public:
+ static constexpr std::optional<ClockMonotonicTimestamp> kNoTimestamp = std::nullopt;
+
+ ComposerClientWriter() { reset(); }
+
+ virtual ~ComposerClientWriter() { reset(); }
+
+ void reset() {
+ mDisplayCommand.reset();
+ mLayerCommand.reset();
+ mCommands.clear();
+ }
+
+ void setColorTransform(int64_t display, const float* matrix) {
+ std::vector<float> matVec;
+ matVec.reserve(16);
+ matVec.assign(matrix, matrix + 16);
+ getDisplayCommand(display).colorTransformMatrix.emplace(std::move(matVec));
+ }
+
+ void setClientTarget(int64_t display, uint32_t slot, const native_handle_t* target,
+ int acquireFence, Dataspace dataspace, const std::vector<Rect>& damage) {
+ ClientTarget clientTargetCommand;
+ clientTargetCommand.buffer = getBuffer(slot, target, acquireFence);
+ clientTargetCommand.dataspace = dataspace;
+ clientTargetCommand.damage.assign(damage.begin(), damage.end());
+ getDisplayCommand(display).clientTarget.emplace(std::move(clientTargetCommand));
+ }
+
+ void setOutputBuffer(int64_t display, uint32_t slot, const native_handle_t* buffer,
+ int releaseFence) {
+ getDisplayCommand(display).virtualDisplayOutputBuffer.emplace(
+ getBuffer(slot, buffer, releaseFence));
+ }
+
+ void validateDisplay(int64_t display,
+ std::optional<ClockMonotonicTimestamp> expectedPresentTime) {
+ auto& command = getDisplayCommand(display);
+ command.expectedPresentTime = expectedPresentTime;
+ command.validateDisplay = true;
+ }
+
+ void presentOrvalidateDisplay(int64_t display,
+ std::optional<ClockMonotonicTimestamp> expectedPresentTime) {
+ auto& command = getDisplayCommand(display);
+ command.expectedPresentTime = expectedPresentTime;
+ command.presentOrValidateDisplay = true;
+ }
+
+ void acceptDisplayChanges(int64_t display) {
+ getDisplayCommand(display).acceptDisplayChanges = true;
+ }
+
+ void presentDisplay(int64_t display) { getDisplayCommand(display).presentDisplay = true; }
+
+ void setLayerCursorPosition(int64_t display, int64_t layer, int32_t x, int32_t y) {
+ common::Point cursorPosition;
+ cursorPosition.x = x;
+ cursorPosition.y = y;
+ getLayerCommand(display, layer).cursorPosition.emplace(std::move(cursorPosition));
+ }
+
+ void setLayerBuffer(int64_t display, int64_t layer, uint32_t slot,
+ const native_handle_t* buffer, int acquireFence) {
+ getLayerCommand(display, layer).buffer = getBuffer(slot, buffer, acquireFence);
+ }
+
+ void setLayerSurfaceDamage(int64_t display, int64_t layer, const std::vector<Rect>& damage) {
+ getLayerCommand(display, layer).damage.emplace(damage.begin(), damage.end());
+ }
+
+ void setLayerBlendMode(int64_t display, int64_t layer, BlendMode mode) {
+ ParcelableBlendMode parcelableBlendMode;
+ parcelableBlendMode.blendMode = mode;
+ getLayerCommand(display, layer).blendMode.emplace(std::move(parcelableBlendMode));
+ }
+
+ void setLayerColor(int64_t display, int64_t layer, Color color) {
+ getLayerCommand(display, layer).color.emplace(std::move(color));
+ }
+
+ void setLayerCompositionType(int64_t display, int64_t layer, Composition type) {
+ ParcelableComposition compositionPayload;
+ compositionPayload.composition = type;
+ getLayerCommand(display, layer).composition.emplace(std::move(compositionPayload));
+ }
+
+ void setLayerDataspace(int64_t display, int64_t layer, Dataspace dataspace) {
+ ParcelableDataspace dataspacePayload;
+ dataspacePayload.dataspace = dataspace;
+ getLayerCommand(display, layer).dataspace.emplace(std::move(dataspacePayload));
+ }
+
+ void setLayerDisplayFrame(int64_t display, int64_t layer, const Rect& frame) {
+ getLayerCommand(display, layer).displayFrame.emplace(frame);
+ }
+
+ void setLayerPlaneAlpha(int64_t display, int64_t layer, float alpha) {
+ PlaneAlpha planeAlpha;
+ planeAlpha.alpha = alpha;
+ getLayerCommand(display, layer).planeAlpha.emplace(std::move(planeAlpha));
+ }
+
+ void setLayerSidebandStream(int64_t display, int64_t layer, const native_handle_t* stream) {
+ NativeHandle handle;
+ if (stream) handle = ::android::dupToAidl(stream);
+ getLayerCommand(display, layer).sidebandStream.emplace(std::move(handle));
+ }
+
+ void setLayerSourceCrop(int64_t display, int64_t layer, const FRect& crop) {
+ getLayerCommand(display, layer).sourceCrop.emplace(crop);
+ }
+
+ void setLayerTransform(int64_t display, int64_t layer, Transform transform) {
+ ParcelableTransform transformPayload;
+ transformPayload.transform = transform;
+ getLayerCommand(display, layer).transform.emplace(std::move(transformPayload));
+ }
+
+ void setLayerVisibleRegion(int64_t display, int64_t layer, const std::vector<Rect>& visible) {
+ getLayerCommand(display, layer).visibleRegion.emplace(visible.begin(), visible.end());
+ }
+
+ void setLayerZOrder(int64_t display, int64_t layer, uint32_t z) {
+ ZOrder zorder;
+ zorder.z = z;
+ getLayerCommand(display, layer).z.emplace(std::move(zorder));
+ }
+
+ void setLayerPerFrameMetadata(int64_t display, int64_t layer,
+ const std::vector<PerFrameMetadata>& metadataVec) {
+ getLayerCommand(display, layer)
+ .perFrameMetadata.emplace(metadataVec.begin(), metadataVec.end());
+ }
+
+ void setLayerColorTransform(int64_t display, int64_t layer, const float* matrix) {
+ getLayerCommand(display, layer).colorTransform.emplace(matrix, matrix + 16);
+ }
+
+ void setLayerPerFrameMetadataBlobs(int64_t display, int64_t layer,
+ const std::vector<PerFrameMetadataBlob>& metadata) {
+ getLayerCommand(display, layer)
+ .perFrameMetadataBlob.emplace(metadata.begin(), metadata.end());
+ }
+
+ void setLayerFloatColor(int64_t display, int64_t layer, FloatColor color) {
+ getLayerCommand(display, layer).floatColor.emplace(color);
+ }
+
+ void setLayerWhitePointNits(int64_t display, int64_t layer, float whitePointNits) {
+ getLayerCommand(display, layer)
+ .whitePointNits.emplace(WhitePointNits{.nits = whitePointNits});
+ }
+
+ const std::vector<DisplayCommand>& getPendingCommands() {
+ flushLayerCommand();
+ flushDisplayCommand();
+ return mCommands;
+ }
+
+ private:
+ std::optional<DisplayCommand> mDisplayCommand;
+ std::optional<LayerCommand> mLayerCommand;
+ std::vector<DisplayCommand> mCommands;
+
+ Buffer getBuffer(int slot, const native_handle_t* bufferHandle, int fence) {
+ Buffer bufferCommand;
+ bufferCommand.slot = slot;
+ if (bufferHandle) bufferCommand.handle.emplace(::android::dupToAidl(bufferHandle));
+ if (fence > 0) bufferCommand.fence = ::ndk::ScopedFileDescriptor(fence);
+ return bufferCommand;
+ }
+
+ void flushLayerCommand() {
+ if (mLayerCommand.has_value()) {
+ mDisplayCommand->layers.emplace_back(std::move(*mLayerCommand));
+ mLayerCommand.reset();
+ }
+ }
+
+ void flushDisplayCommand() {
+ if (mDisplayCommand.has_value()) {
+ mCommands.emplace_back(std::move(*mDisplayCommand));
+ mDisplayCommand.reset();
+ }
+ }
+
+ DisplayCommand& getDisplayCommand(int64_t display) {
+ if (!mDisplayCommand.has_value() || mDisplayCommand->display != display) {
+ flushLayerCommand();
+ flushDisplayCommand();
+ mDisplayCommand.emplace();
+ mDisplayCommand->display = display;
+ }
+ return *mDisplayCommand;
+ }
+
+ LayerCommand& getLayerCommand(int64_t display, int64_t layer) {
+ getDisplayCommand(display);
+ if (!mLayerCommand.has_value() || mLayerCommand->layer != layer) {
+ flushLayerCommand();
+ mLayerCommand.emplace();
+ mLayerCommand->layer = layer;
+ }
+ return *mLayerCommand;
+ }
+};
+
+} // namespace aidl::android::hardware::graphics::composer3
diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h
deleted file mode 100644
index d02cf9c..0000000
--- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h
+++ /dev/null
@@ -1,895 +0,0 @@
-/*
- * Copyright 2021 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.
- */
-
-#pragma once
-
-#include <algorithm>
-#include <limits>
-#include <memory>
-#include <vector>
-
-#include <inttypes.h>
-#include <string.h>
-
-#include <aidl/android/hardware/graphics/composer3/BlendMode.h>
-#include <aidl/android/hardware/graphics/composer3/ClientTargetProperty.h>
-#include <aidl/android/hardware/graphics/composer3/Color.h>
-#include <aidl/android/hardware/graphics/composer3/Command.h>
-#include <aidl/android/hardware/graphics/composer3/Composition.h>
-#include <aidl/android/hardware/graphics/composer3/FloatColor.h>
-#include <aidl/android/hardware/graphics/composer3/HandleIndex.h>
-#include <aidl/android/hardware/graphics/composer3/IComposer.h>
-#include <aidl/android/hardware/graphics/composer3/IComposerClient.h>
-#include <aidl/android/hardware/graphics/composer3/PerFrameMetadata.h>
-#include <aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h>
-
-#include <aidl/android/hardware/graphics/common/ColorTransform.h>
-#include <aidl/android/hardware/graphics/common/FRect.h>
-#include <aidl/android/hardware/graphics/common/Rect.h>
-#include <aidl/android/hardware/graphics/common/Transform.h>
-
-#include <fmq/AidlMessageQueue.h>
-#include <log/log.h>
-#include <sync/sync.h>
-
-#include <aidlcommonsupport/NativeHandle.h>
-
-using aidl::android::hardware::graphics::common::ColorTransform;
-using aidl::android::hardware::graphics::common::Dataspace;
-using aidl::android::hardware::graphics::common::FRect;
-using aidl::android::hardware::graphics::common::Rect;
-using aidl::android::hardware::graphics::common::Transform;
-
-using aidl::android::hardware::graphics::composer3::BlendMode;
-using aidl::android::hardware::graphics::composer3::ClientTargetProperty;
-using aidl::android::hardware::graphics::composer3::Color;
-using aidl::android::hardware::graphics::composer3::Command;
-using aidl::android::hardware::graphics::composer3::Composition;
-using aidl::android::hardware::graphics::composer3::FloatColor;
-using aidl::android::hardware::graphics::composer3::HandleIndex;
-using aidl::android::hardware::graphics::composer3::PerFrameMetadata;
-using aidl::android::hardware::graphics::composer3::PerFrameMetadataBlob;
-
-using aidl::android::hardware::common::NativeHandle;
-using aidl::android::hardware::common::fmq::SynchronizedReadWrite;
-using android::AidlMessageQueue;
-using CommandQueueType = AidlMessageQueue<int32_t, SynchronizedReadWrite>;
-using aidl::android::hardware::common::fmq::MQDescriptor;
-using DescriptorType = MQDescriptor<int32_t, SynchronizedReadWrite>;
-
-namespace aidl::android::hardware::graphics::composer3 {
-
-// This class helps build a command queue. Note that all sizes/lengths are in
-// units of uint32_t's.
-class CommandWriterBase {
- public:
- CommandWriterBase(uint32_t initialMaxSize) : mDataMaxSize(initialMaxSize) {
- mData = std::make_unique<int32_t[]>(mDataMaxSize);
- reset();
- }
-
- virtual ~CommandWriterBase() { reset(); }
-
- void reset() {
- mDataWritten = 0;
- mCommandEnd = 0;
-
- // handles in mDataHandles are owned by the caller
- mDataHandles.clear();
-
- // handles in mTemporaryHandles are owned by the writer
- for (auto handle : mTemporaryHandles) {
- native_handle_close(handle);
- native_handle_delete(handle);
- }
- mTemporaryHandles.clear();
- }
-
- Command getCommand(uint32_t offset) {
- uint32_t val = (offset < mDataWritten) ? mData[offset] : 0;
- return static_cast<Command>(val & static_cast<uint32_t>(Command::OPCODE_MASK));
- }
-
- bool writeQueue(bool* outQueueChanged, int32_t* outCommandLength,
- std::vector<NativeHandle>* outCommandHandles) {
- if (mDataWritten == 0) {
- *outQueueChanged = false;
- *outCommandLength = 0;
- outCommandHandles->clear();
- return true;
- }
-
- // After data are written to the queue, it may not be read by the
- // remote reader when
- //
- // - the writer does not send them (because of other errors)
- // - the hwbinder transaction fails
- // - the reader does not read them (because of other errors)
- //
- // Discard the stale data here.
- size_t staleDataSize = mQueue ? mQueue->availableToRead() : 0;
- if (staleDataSize > 0) {
- ALOGW("discarding stale data from message queue");
- CommandQueueType::MemTransaction tx;
- if (mQueue->beginRead(staleDataSize, &tx)) {
- mQueue->commitRead(staleDataSize);
- }
- }
-
- // write data to queue, optionally resizing it
- if (mQueue && (mDataMaxSize <= mQueue->getQuantumCount())) {
- if (!mQueue->write(mData.get(), mDataWritten)) {
- ALOGE("failed to write commands to message queue");
- return false;
- }
-
- *outQueueChanged = false;
- } else {
- auto newQueue = std::make_unique<CommandQueueType>(mDataMaxSize);
- if (!newQueue->isValid() || !newQueue->write(mData.get(), mDataWritten)) {
- ALOGE("failed to prepare a new message queue ");
- return false;
- }
-
- mQueue = std::move(newQueue);
- *outQueueChanged = true;
- }
-
- *outCommandLength = mDataWritten;
- *outCommandHandles = std::move(mDataHandles);
-
- return true;
- }
-
- DescriptorType getMQDescriptor() const {
- return (mQueue) ? mQueue->dupeDesc() : DescriptorType{};
- }
-
- static constexpr uint16_t kSelectDisplayLength = 2;
- void selectDisplay(int64_t display) {
- beginCommand(Command::SELECT_DISPLAY, kSelectDisplayLength);
- write64(display);
- endCommand();
- }
-
- static constexpr uint16_t kSelectLayerLength = 2;
- void selectLayer(int64_t layer) {
- beginCommand(Command::SELECT_LAYER, kSelectLayerLength);
- write64(layer);
- endCommand();
- }
-
- static constexpr uint16_t kSetErrorLength = 2;
- void setError(uint32_t location, int32_t error) {
- beginCommand(Command::SET_ERROR, kSetErrorLength);
- write(location);
- writeSigned(error);
- endCommand();
- }
-
- static constexpr uint32_t kPresentOrValidateDisplayResultLength = 1;
- void setPresentOrValidateResult(uint32_t state) {
- beginCommand(Command::SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT,
- kPresentOrValidateDisplayResultLength);
- write(state);
- endCommand();
- }
-
- void setChangedCompositionTypes(const std::vector<int64_t>& layers,
- const std::vector<Composition>& types) {
- size_t totalLayers = std::min(layers.size(), types.size());
- size_t currentLayer = 0;
-
- while (currentLayer < totalLayers) {
- size_t count =
- std::min(totalLayers - currentLayer, static_cast<size_t>(kMaxLength) / 3);
-
- beginCommand(Command::SET_CHANGED_COMPOSITION_TYPES, count * 3);
- for (size_t i = 0; i < count; i++) {
- write64(layers[currentLayer + i]);
- writeSigned(static_cast<int32_t>(types[currentLayer + i]));
- }
- endCommand();
-
- currentLayer += count;
- }
- }
-
- void setDisplayRequests(uint32_t displayRequestMask, const std::vector<int64_t>& layers,
- const std::vector<uint32_t>& layerRequestMasks) {
- size_t totalLayers = std::min(layers.size(), layerRequestMasks.size());
- size_t currentLayer = 0;
-
- while (currentLayer < totalLayers) {
- size_t count =
- std::min(totalLayers - currentLayer, static_cast<size_t>(kMaxLength - 1) / 3);
-
- beginCommand(Command::SET_DISPLAY_REQUESTS, 1 + count * 3);
- write(displayRequestMask);
- for (size_t i = 0; i < count; i++) {
- write64(layers[currentLayer + i]);
- write(static_cast<int32_t>(layerRequestMasks[currentLayer + i]));
- }
- endCommand();
-
- currentLayer += count;
- }
- }
-
- static constexpr uint16_t kSetPresentFenceLength = 1;
- void setPresentFence(int presentFence) {
- beginCommand(Command::SET_PRESENT_FENCE, kSetPresentFenceLength);
- writeFence(presentFence);
- endCommand();
- }
-
- void setReleaseFences(const std::vector<int64_t>& layers,
- const std::vector<int>& releaseFences) {
- size_t totalLayers = std::min(layers.size(), releaseFences.size());
- size_t currentLayer = 0;
-
- while (currentLayer < totalLayers) {
- size_t count =
- std::min(totalLayers - currentLayer, static_cast<size_t>(kMaxLength) / 3);
-
- beginCommand(Command::SET_RELEASE_FENCES, count * 3);
- for (size_t i = 0; i < count; i++) {
- write64(layers[currentLayer + i]);
- writeFence(releaseFences[currentLayer + i]);
- }
- endCommand();
-
- currentLayer += count;
- }
- }
-
- static constexpr uint16_t kSetColorTransformLength = 17;
- void setColorTransform(const float* matrix, ColorTransform hint) {
- beginCommand(Command::SET_COLOR_TRANSFORM, kSetColorTransformLength);
- for (int i = 0; i < 16; i++) {
- writeFloat(matrix[i]);
- }
- writeSigned(static_cast<int32_t>(hint));
- endCommand();
- }
-
- void setClientTarget(uint32_t slot, const native_handle_t* target, int acquireFence,
- Dataspace dataspace, const std::vector<Rect>& damage) {
- setClientTargetInternal(slot, target, acquireFence, static_cast<int32_t>(dataspace),
- damage);
- }
-
- static constexpr uint16_t kSetOutputBufferLength = 3;
- void setOutputBuffer(uint32_t slot, const native_handle_t* buffer, int releaseFence) {
- beginCommand(Command::SET_OUTPUT_BUFFER, kSetOutputBufferLength);
- write(slot);
- writeHandle(buffer, true);
- writeFence(releaseFence);
- endCommand();
- }
-
- static constexpr uint16_t kValidateDisplayLength = 0;
- void validateDisplay() {
- beginCommand(Command::VALIDATE_DISPLAY, kValidateDisplayLength);
- endCommand();
- }
-
- static constexpr uint16_t kPresentOrValidateDisplayLength = 0;
- void presentOrvalidateDisplay() {
- beginCommand(Command::PRESENT_OR_VALIDATE_DISPLAY, kPresentOrValidateDisplayLength);
- endCommand();
- }
-
- static constexpr uint16_t kAcceptDisplayChangesLength = 0;
- void acceptDisplayChanges() {
- beginCommand(Command::ACCEPT_DISPLAY_CHANGES, kAcceptDisplayChangesLength);
- endCommand();
- }
-
- static constexpr uint16_t kPresentDisplayLength = 0;
- void presentDisplay() {
- beginCommand(Command::PRESENT_DISPLAY, kPresentDisplayLength);
- endCommand();
- }
-
- static constexpr uint16_t kSetLayerCursorPositionLength = 2;
- void setLayerCursorPosition(int32_t x, int32_t y) {
- beginCommand(Command::SET_LAYER_CURSOR_POSITION, kSetLayerCursorPositionLength);
- writeSigned(x);
- writeSigned(y);
- endCommand();
- }
-
- static constexpr uint16_t kSetLayerBufferLength = 3;
- void setLayerBuffer(uint32_t slot, const native_handle_t* buffer, int acquireFence) {
- beginCommand(Command::SET_LAYER_BUFFER, kSetLayerBufferLength);
- write(slot);
- writeHandle(buffer, true);
- writeFence(acquireFence);
- endCommand();
- }
-
- void setLayerSurfaceDamage(const std::vector<Rect>& damage) {
- bool doWrite = (damage.size() <= kMaxLength / 4);
- size_t length = (doWrite) ? damage.size() * 4 : 0;
-
- beginCommand(Command::SET_LAYER_SURFACE_DAMAGE, length);
- // When there are too many rectangles in the damage region and doWrite
- // is false, we write no rectangle at all which means the entire
- // layer is damaged.
- if (doWrite) {
- writeRegion(damage);
- }
- endCommand();
- }
-
- static constexpr uint16_t kSetLayerBlendModeLength = 1;
- void setLayerBlendMode(BlendMode mode) {
- beginCommand(Command::SET_LAYER_BLEND_MODE, kSetLayerBlendModeLength);
- writeSigned(static_cast<int32_t>(mode));
- endCommand();
- }
-
- static constexpr uint16_t kSetLayerColorLength = 1;
- void setLayerColor(Color color) {
- beginCommand(Command::SET_LAYER_COLOR, kSetLayerColorLength);
- writeColor(color);
- endCommand();
- }
-
- static constexpr uint16_t kSetLayerCompositionTypeLength = 1;
- void setLayerCompositionType(Composition type) {
- beginCommand(Command::SET_LAYER_COMPOSITION_TYPE, kSetLayerCompositionTypeLength);
- writeSigned(static_cast<int32_t>(type));
- endCommand();
- }
-
- static constexpr uint16_t kSetLayerDataspaceLength = 1;
- void setLayerDataspace(Dataspace dataspace) {
- setLayerDataspaceInternal(static_cast<int32_t>(dataspace));
- }
-
- static constexpr uint16_t kSetLayerDisplayFrameLength = 4;
- void setLayerDisplayFrame(const Rect& frame) {
- beginCommand(Command::SET_LAYER_DISPLAY_FRAME, kSetLayerDisplayFrameLength);
- writeRect(frame);
- endCommand();
- }
-
- static constexpr uint16_t kSetLayerPlaneAlphaLength = 1;
- void setLayerPlaneAlpha(float alpha) {
- beginCommand(Command::SET_LAYER_PLANE_ALPHA, kSetLayerPlaneAlphaLength);
- writeFloat(alpha);
- endCommand();
- }
-
- static constexpr uint16_t kSetLayerSidebandStreamLength = 1;
- void setLayerSidebandStream(const native_handle_t* stream) {
- beginCommand(Command::SET_LAYER_SIDEBAND_STREAM, kSetLayerSidebandStreamLength);
- writeHandle(stream);
- endCommand();
- }
-
- static constexpr uint16_t kSetLayerSourceCropLength = 4;
- void setLayerSourceCrop(const FRect& crop) {
- beginCommand(Command::SET_LAYER_SOURCE_CROP, kSetLayerSourceCropLength);
- writeFRect(crop);
- endCommand();
- }
-
- static constexpr uint16_t kSetLayerTransformLength = 1;
- void setLayerTransform(Transform transform) {
- beginCommand(Command::SET_LAYER_TRANSFORM, kSetLayerTransformLength);
- writeSigned(static_cast<int32_t>(transform));
- endCommand();
- }
-
- void setLayerVisibleRegion(const std::vector<Rect>& visible) {
- bool doWrite = (visible.size() <= kMaxLength / 4);
- size_t length = (doWrite) ? visible.size() * 4 : 0;
-
- beginCommand(Command::SET_LAYER_VISIBLE_REGION, length);
- // When there are too many rectangles in the visible region and
- // doWrite is false, we write no rectangle at all which means the
- // entire layer is visible.
- if (doWrite) {
- writeRegion(visible);
- }
- endCommand();
- }
-
- static constexpr uint16_t kSetLayerZOrderLength = 1;
- void setLayerZOrder(uint32_t z) {
- beginCommand(Command::SET_LAYER_Z_ORDER, kSetLayerZOrderLength);
- write(z);
- endCommand();
- }
-
- void setLayerPerFrameMetadata(const std::vector<PerFrameMetadata>& metadataVec) {
- beginCommand(Command::SET_LAYER_PER_FRAME_METADATA, metadataVec.size() * 2);
- for (const auto& metadata : metadataVec) {
- writeSigned(static_cast<int32_t>(metadata.key));
- writeFloat(metadata.value);
- }
- endCommand();
- }
-
- static constexpr uint16_t kSetLayerColorTransformLength = 16;
- void setLayerColorTransform(const float* matrix) {
- beginCommand(Command::SET_LAYER_COLOR_TRANSFORM, kSetLayerColorTransformLength);
- for (int i = 0; i < 16; i++) {
- writeFloat(matrix[i]);
- }
- endCommand();
- }
-
- void setLayerPerFrameMetadataBlobs(const std::vector<PerFrameMetadataBlob>& metadata) {
- // in units of uint32_t's
- size_t commandLength = 0;
-
- if (metadata.size() > std::numeric_limits<uint32_t>::max()) {
- LOG_FATAL("too many metadata blobs - dynamic metadata size is too large");
- return;
- }
-
- // space for numElements
- commandLength += 1;
-
- for (auto metadataBlob : metadata) {
- commandLength += 1; // key of metadata blob
- commandLength += 1; // size information of metadata blob
-
- // metadata content size
- size_t metadataSize = metadataBlob.blob.size() / sizeof(uint32_t);
- commandLength += metadataSize;
- commandLength +=
- (metadataBlob.blob.size() - (metadataSize * sizeof(uint32_t)) > 0) ? 1 : 0;
- }
-
- if (commandLength > std::numeric_limits<uint16_t>::max()) {
- LOG_FATAL("dynamic metadata size is too large");
- return;
- }
-
- // Blobs are written as:
- // {numElements, key1, size1, blob1, key2, size2, blob2, key3, size3...}
- uint16_t length = static_cast<uint16_t>(commandLength);
- beginCommand(Command::SET_LAYER_PER_FRAME_METADATA_BLOBS, length);
- write(static_cast<uint32_t>(metadata.size()));
- for (auto metadataBlob : metadata) {
- writeSigned(static_cast<int32_t>(metadataBlob.key));
- write(static_cast<uint32_t>(metadataBlob.blob.size()));
- writeBlob(static_cast<uint32_t>(metadataBlob.blob.size()), metadataBlob.blob.data());
- }
- endCommand();
- }
-
- static constexpr uint16_t kSetLayerFloatColorLength = 4;
- void setLayerFloatColor(FloatColor color) {
- beginCommand(Command::SET_LAYER_FLOAT_COLOR, kSetLayerFloatColorLength);
- writeFloatColor(color);
- endCommand();
- }
-
- static constexpr uint16_t kSetClientTargetPropertyLength = 2;
- void setClientTargetProperty(const ClientTargetProperty& clientTargetProperty) {
- beginCommand(Command::SET_CLIENT_TARGET_PROPERTY, kSetClientTargetPropertyLength);
- writeSigned(static_cast<int32_t>(clientTargetProperty.pixelFormat));
- writeSigned(static_cast<int32_t>(clientTargetProperty.dataspace));
- endCommand();
- }
-
- void setLayerGenericMetadata(const std::string& key, const bool mandatory,
- const std::vector<uint8_t>& value) {
- const size_t commandSize = 3 + sizeToElements(key.size()) + sizeToElements(value.size());
- if (commandSize > std::numeric_limits<uint16_t>::max()) {
- LOG_FATAL("Too much generic metadata (%zu elements)", commandSize);
- return;
- }
-
- beginCommand(Command::SET_LAYER_GENERIC_METADATA, static_cast<uint16_t>(commandSize));
- write(key.size());
- writeBlob(key.size(), reinterpret_cast<const unsigned char*>(key.c_str()));
- write(mandatory);
- write(value.size());
- writeBlob(value.size(), value.data());
- endCommand();
- }
-
- protected:
- template <typename T>
- void beginCommand(T command, uint16_t length) {
- beginCommandBase(static_cast<Command>(command), length);
- }
-
- void setClientTargetInternal(uint32_t slot, const native_handle_t* target, int acquireFence,
- int32_t dataspace, const std::vector<Rect>& damage) {
- bool doWrite = (damage.size() <= (kMaxLength - 4) / 4);
- size_t length = 4 + ((doWrite) ? damage.size() * 4 : 0);
-
- beginCommand(Command::SET_CLIENT_TARGET, length);
- write(slot);
- writeHandle(target, true);
- writeFence(acquireFence);
- writeSigned(dataspace);
- // When there are too many rectangles in the damage region and doWrite
- // is false, we write no rectangle at all which means the entire
- // client target is damaged.
- if (doWrite) {
- writeRegion(damage);
- }
- endCommand();
- }
-
- void setLayerDataspaceInternal(int32_t dataspace) {
- beginCommand(Command::SET_LAYER_DATASPACE, kSetLayerDataspaceLength);
- writeSigned(dataspace);
- endCommand();
- }
-
- void beginCommandBase(Command command, uint16_t length) {
- if (mCommandEnd) {
- LOG_FATAL("endCommand was not called before command 0x%x", command);
- }
-
- growData(1 + length);
- write(static_cast<uint32_t>(command) | length);
-
- mCommandEnd = mDataWritten + length;
- }
-
- void endCommand() {
- if (!mCommandEnd) {
- LOG_FATAL("beginCommand was not called");
- } else if (mDataWritten > mCommandEnd) {
- LOG_FATAL("too much data written");
- mDataWritten = mCommandEnd;
- } else if (mDataWritten < mCommandEnd) {
- LOG_FATAL("too little data written");
- while (mDataWritten < mCommandEnd) {
- write(0);
- }
- }
-
- mCommandEnd = 0;
- }
-
- void write(uint32_t val) { mData[mDataWritten++] = val; }
-
- void writeSigned(int32_t val) { memcpy(&mData[mDataWritten++], &val, sizeof(val)); }
-
- void writeFloat(float val) { memcpy(&mData[mDataWritten++], &val, sizeof(val)); }
-
- void write64(uint64_t val) {
- uint32_t lo = static_cast<uint32_t>(val & 0xffffffff);
- uint32_t hi = static_cast<uint32_t>(val >> 32);
- write(lo);
- write(hi);
- }
-
- void writeRect(const Rect& rect) {
- writeSigned(rect.left);
- writeSigned(rect.top);
- writeSigned(rect.right);
- writeSigned(rect.bottom);
- }
-
- void writeRegion(const std::vector<Rect>& region) {
- for (const auto& rect : region) {
- writeRect(rect);
- }
- }
-
- void writeFRect(const FRect& rect) {
- writeFloat(rect.left);
- writeFloat(rect.top);
- writeFloat(rect.right);
- writeFloat(rect.bottom);
- }
-
- void writeColor(const Color& color) {
- write((color.r << 0) | (color.g << 8) | (color.b << 16) | (color.a << 24));
- }
-
- void writeFloatColor(const FloatColor& color) {
- writeFloat(color.r);
- writeFloat(color.g);
- writeFloat(color.b);
- writeFloat(color.a);
- }
-
- void writeBlob(uint32_t length, const unsigned char* blob) {
- memcpy(&mData[mDataWritten], blob, length);
- uint32_t numElements = length / 4;
- mDataWritten += numElements;
- mDataWritten += (length - (numElements * 4) > 0) ? 1 : 0;
- }
-
- // ownership of handle is not transferred
- void writeHandle(const native_handle_t* handle, bool useCache) {
- if (!handle) {
- writeSigned(
- static_cast<int32_t>((useCache) ? HandleIndex::CACHED : HandleIndex::EMPTY));
- return;
- }
-
- mDataHandles.push_back(::android::dupToAidl(handle));
- writeSigned(mDataHandles.size() - 1);
- }
-
- void writeHandle(const native_handle_t* handle) { writeHandle(handle, false); }
-
- // ownership of fence is transferred
- void writeFence(int fence) {
- native_handle_t* handle = nullptr;
- if (fence >= 0) {
- handle = getTemporaryHandle(1, 0);
- if (handle) {
- handle->data[0] = fence;
- } else {
- ALOGW("failed to get temporary handle for fence %d", fence);
- sync_wait(fence, -1);
- close(fence);
- }
- }
-
- writeHandle(handle);
- }
-
- native_handle_t* getTemporaryHandle(int numFds, int numInts) {
- native_handle_t* handle = native_handle_create(numFds, numInts);
- if (handle) {
- mTemporaryHandles.push_back(handle);
- }
- return handle;
- }
-
- static constexpr uint16_t kMaxLength = std::numeric_limits<uint16_t>::max();
-
- std::unique_ptr<int32_t[]> mData;
- uint32_t mDataWritten;
-
- private:
- void growData(uint32_t grow) {
- uint32_t newWritten = mDataWritten + grow;
- if (newWritten < mDataWritten) {
- LOG_ALWAYS_FATAL("buffer overflowed; data written %" PRIu32 ", growing by %" PRIu32,
- mDataWritten, grow);
- }
-
- if (newWritten <= mDataMaxSize) {
- return;
- }
-
- uint32_t newMaxSize = mDataMaxSize << 1;
- if (newMaxSize < newWritten) {
- newMaxSize = newWritten;
- }
-
- auto newData = std::make_unique<int32_t[]>(newMaxSize);
- std::copy_n(mData.get(), mDataWritten, newData.get());
- mDataMaxSize = newMaxSize;
- mData = std::move(newData);
- }
-
- uint32_t sizeToElements(uint32_t size) { return (size + 3) / 4; }
-
- uint32_t mDataMaxSize;
- // end offset of the current command
- uint32_t mCommandEnd;
-
- std::vector<NativeHandle> mDataHandles;
- std::vector<native_handle_t*> mTemporaryHandles;
-
- std::unique_ptr<CommandQueueType> mQueue;
-};
-
-// This class helps parse a command queue. Note that all sizes/lengths are in
-// units of uint32_t's.
-class CommandReaderBase {
- public:
- CommandReaderBase() : mDataMaxSize(0) { reset(); }
-
- bool setMQDescriptor(const DescriptorType& descriptor) {
- mQueue = std::make_unique<CommandQueueType>(descriptor, false);
- if (mQueue->isValid()) {
- return true;
- } else {
- mQueue = nullptr;
- return false;
- }
- }
-
- bool readQueue(int32_t commandLength, std::vector<NativeHandle> commandHandles) {
- if (!mQueue) {
- return false;
- }
-
- auto quantumCount = mQueue->getQuantumCount();
- if (mDataMaxSize < quantumCount) {
- mDataMaxSize = quantumCount;
- mData = std::make_unique<int32_t[]>(mDataMaxSize);
- }
-
- if (commandLength > mDataMaxSize || !mQueue->read(mData.get(), commandLength)) {
- ALOGE("failed to read commands from message queue");
- return false;
- }
-
- mDataSize = commandLength;
- mDataRead = 0;
- mCommandBegin = 0;
- mCommandEnd = 0;
- mDataHandles = std::move(commandHandles);
- return true;
- }
-
- void reset() {
- mDataSize = 0;
- mDataRead = 0;
- mCommandBegin = 0;
- mCommandEnd = 0;
- mDataHandles.clear();
- }
-
- protected:
- template <typename T>
- bool beginCommand(T* outCommand, uint16_t* outLength) {
- return beginCommandBase(reinterpret_cast<Command*>(outCommand), outLength);
- }
-
- bool isEmpty() const { return (mDataRead >= mDataSize); }
-
- bool beginCommandBase(Command* outCommand, uint16_t* outLength) {
- if (mCommandEnd) {
- LOG_FATAL("endCommand was not called for last command");
- }
-
- constexpr uint32_t opcode_mask = static_cast<uint32_t>(Command::OPCODE_MASK);
- constexpr uint32_t length_mask = static_cast<uint32_t>(Command::LENGTH_MASK);
-
- uint32_t val = read();
- *outCommand = static_cast<Command>(val & opcode_mask);
- *outLength = static_cast<uint16_t>(val & length_mask);
-
- if (mDataRead + *outLength > mDataSize) {
- ALOGE("command 0x%x has invalid command length %" PRIu16, *outCommand, *outLength);
- // undo the read() above
- mDataRead--;
- return false;
- }
-
- mCommandEnd = mDataRead + *outLength;
-
- return true;
- }
-
- void endCommand() {
- if (!mCommandEnd) {
- LOG_FATAL("beginCommand was not called");
- } else if (mDataRead > mCommandEnd) {
- LOG_FATAL("too much data read");
- mDataRead = mCommandEnd;
- } else if (mDataRead < mCommandEnd) {
- LOG_FATAL("too little data read");
- mDataRead = mCommandEnd;
- }
-
- mCommandBegin = mCommandEnd;
- mCommandEnd = 0;
- }
-
- uint32_t getCommandLoc() const { return mCommandBegin; }
-
- uint32_t read() { return mData[mDataRead++]; }
-
- int32_t readSigned() {
- int32_t val;
- memcpy(&val, &mData[mDataRead++], sizeof(val));
- return val;
- }
-
- float readFloat() {
- float val;
- memcpy(&val, &mData[mDataRead++], sizeof(val));
- return val;
- }
-
- uint64_t read64() {
- uint32_t lo = read();
- uint32_t hi = read();
- return (static_cast<uint64_t>(hi) << 32) | lo;
- }
-
- Color readColor() {
- uint32_t val = read();
- return Color{
- static_cast<int8_t>((val >> 0) & 0xff),
- static_cast<int8_t>((val >> 8) & 0xff),
- static_cast<int8_t>((val >> 16) & 0xff),
- static_cast<int8_t>((val >> 24) & 0xff),
- };
- }
-
- // ownership of handle is not transferred
- const native_handle_t* readHandle(bool* outUseCache) {
- const native_handle_t* handle = nullptr;
-
- int32_t index = readSigned();
- switch (index) {
- case static_cast<int32_t>(HandleIndex::EMPTY):
- *outUseCache = false;
- break;
- case static_cast<int32_t>(HandleIndex::CACHED):
- *outUseCache = true;
- break;
- default:
- if (static_cast<size_t>(index) < mDataHandles.size()) {
- handle = ::android::makeFromAidl(mDataHandles[index]);
- } else {
- ALOGE("invalid handle index %zu", static_cast<size_t>(index));
- }
- *outUseCache = false;
- break;
- }
-
- return handle;
- }
-
- const native_handle_t* readHandle() {
- bool useCache;
- return readHandle(&useCache);
- }
-
- // ownership of fence is transferred
- int readFence() {
- auto handle = readHandle();
- if (!handle || handle->numFds == 0) {
- return -1;
- }
-
- if (handle->numFds != 1) {
- ALOGE("invalid fence handle with %d fds", handle->numFds);
- return -1;
- }
-
- int fd = dup(handle->data[0]);
- if (fd < 0) {
- ALOGW("failed to dup fence %d", handle->data[0]);
- sync_wait(handle->data[0], -1);
- fd = -1;
- }
-
- return fd;
- }
-
- std::unique_ptr<int32_t[]> mData;
- uint32_t mDataRead;
-
- private:
- std::unique_ptr<CommandQueueType> mQueue;
- uint32_t mDataMaxSize;
-
- uint32_t mDataSize;
-
- // begin/end offsets of the current command
- uint32_t mCommandBegin;
- uint32_t mCommandEnd;
-
- std::vector<NativeHandle> mDataHandles;
-};
-
-} // namespace aidl::android::hardware::graphics::composer3
diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h
deleted file mode 100644
index c892863..0000000
--- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * Copyright (c) 2021, 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.
- */
-
-#pragma once
-
-#include <limits>
-#include "aidl/android/hardware/graphics/common/FRect.h"
-#include "aidl/android/hardware/graphics/common/Rect.h"
-#include "aidl/android/hardware/graphics/composer3/BlendMode.h"
-#include "aidl/android/hardware/graphics/composer3/Capability.h"
-#include "aidl/android/hardware/graphics/composer3/ClientTargetProperty.h"
-#include "aidl/android/hardware/graphics/composer3/Color.h"
-#include "aidl/android/hardware/graphics/composer3/Command.h"
-#include "aidl/android/hardware/graphics/composer3/Composition.h"
-#include "aidl/android/hardware/graphics/composer3/ContentType.h"
-#include "aidl/android/hardware/graphics/composer3/DisplayAttribute.h"
-#include "aidl/android/hardware/graphics/composer3/DisplayCapability.h"
-#include "aidl/android/hardware/graphics/composer3/DisplayConnectionType.h"
-#include "aidl/android/hardware/graphics/composer3/DisplayRequest.h"
-#include "aidl/android/hardware/graphics/composer3/FloatColor.h"
-#include "aidl/android/hardware/graphics/composer3/FormatColorComponent.h"
-#include "aidl/android/hardware/graphics/composer3/HandleIndex.h"
-#include "aidl/android/hardware/graphics/composer3/IComposer.h"
-#include "aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.h"
-#include "aidl/android/hardware/graphics/composer3/LayerRequest.h"
-#include "aidl/android/hardware/graphics/composer3/PerFrameMetadata.h"
-#include "aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h"
-#include "aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.h"
-#include "aidl/android/hardware/graphics/composer3/PowerMode.h"
-#include "aidl/android/hardware/graphics/composer3/VsyncPeriodChangeConstraints.h"
-#include "aidl/android/hardware/graphics/composer3/VsyncPeriodChangeTimeline.h"
-#include "android/hardware/graphics/composer/2.1/IComposer.h"
-#include "android/hardware/graphics/composer/2.1/IComposerCallback.h"
-#include "android/hardware/graphics/composer/2.1/IComposerClient.h"
-#include "android/hardware/graphics/composer/2.2/IComposerClient.h"
-#include "android/hardware/graphics/composer/2.3/IComposerClient.h"
-#include "android/hardware/graphics/composer/2.4/IComposerClient.h"
-#include "android/hardware/graphics/composer/2.4/types.h"
-
-namespace android::h2a {
-
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_4::VsyncPeriodChangeTimeline& in,
- aidl::android::hardware::graphics::composer3::VsyncPeriodChangeTimeline* out);
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_1::IComposerClient::Rect& in,
- aidl::android::hardware::graphics::common::Rect* out);
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_1::IComposerClient::FRect& in,
- aidl::android::hardware::graphics::common::FRect* out);
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_1::IComposerClient::Color& in,
- aidl::android::hardware::graphics::composer3::Color* out);
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_3::IComposerClient::PerFrameMetadata& in,
- aidl::android::hardware::graphics::composer3::PerFrameMetadata* out);
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_2::IComposerClient::FloatColor& in,
- aidl::android::hardware::graphics::composer3::FloatColor* out);
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_3::IComposerClient::PerFrameMetadataBlob&
- in,
- aidl::android::hardware::graphics::composer3::PerFrameMetadataBlob* out);
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_4::IComposerClient::
- VsyncPeriodChangeConstraints& in,
- aidl::android::hardware::graphics::composer3::VsyncPeriodChangeConstraints* out);
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_4::IComposerClient::ClientTargetProperty&
- in,
- aidl::android::hardware::graphics::composer3::ClientTargetProperty* out);
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_4::IComposerClient::
- LayerGenericMetadataKey& in,
- aidl::android::hardware::graphics::composer3::LayerGenericMetadataKey* out);
-
-} // namespace android::h2a
diff --git a/health/aidl/vts/functional/Android.bp b/health/aidl/vts/functional/Android.bp
index 434f565..d315c60 100644
--- a/health/aidl/vts/functional/Android.bp
+++ b/health/aidl/vts/functional/Android.bp
@@ -43,6 +43,7 @@
"libhealthtest_headers",
],
test_suites: [
+ "general-tests",
"vts",
],
}
diff --git a/identity/aidl/default/service.cpp b/identity/aidl/default/service.cpp
index c290c08..78f4fbc 100644
--- a/identity/aidl/default/service.cpp
+++ b/identity/aidl/default/service.cpp
@@ -43,7 +43,7 @@
const std::string instance = std::string() + IdentityCredentialStore::descriptor + "/default";
binder_status_t status = AServiceManager_addService(store->asBinder().get(), instance.c_str());
- CHECK(status == STATUS_OK);
+ CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
diff --git a/input/classifier/1.0/vts/functional/Android.bp b/input/classifier/1.0/vts/functional/Android.bp
index 58945d3..5ff1457 100644
--- a/input/classifier/1.0/vts/functional/Android.bp
+++ b/input/classifier/1.0/vts/functional/Android.bp
@@ -30,7 +30,10 @@
":inputconstants_aidl",
"VtsHalInputClassifierV1_0TargetTest.cpp",
],
- header_libs: ["jni_headers"],
+ header_libs: [
+ "jni_headers",
+ "libbinder_headers",
+ ],
static_libs: [
"android.hardware.input.classifier@1.0",
"android.hardware.input.common@1.0",
diff --git a/ir/OWNERS b/ir/OWNERS
new file mode 100644
index 0000000..04de9ef
--- /dev/null
+++ b/ir/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 163905
+connoro@google.com
diff --git a/ir/aidl/Android.bp b/ir/aidl/Android.bp
new file mode 100644
index 0000000..8741157
--- /dev/null
+++ b/ir/aidl/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2021 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.
+
+aidl_interface {
+ name: "android.hardware.ir",
+ vendor_available: true,
+ srcs: ["android/hardware/ir/*.aidl"],
+ stability: "vintf",
+ backend: {
+ cpp: {
+ enabled: false,
+ },
+ java: {
+ sdk_version: "module_current",
+ },
+ ndk: {
+ separate_platform_variant: false,
+ vndk: {
+ // TODO(b/206116595) enable this
+ enabled: false,
+ },
+ },
+ },
+}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/ConsumerIrFreqRange.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/ConsumerIrFreqRange.aidl
index cfafc50..4a0d286 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/ConsumerIrFreqRange.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,9 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.ir;
+@VintfStability
+parcelable ConsumerIrFreqRange {
+ int minHz;
+ int maxHz;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/IConsumerIr.aidl
similarity index 84%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
copy to ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/IConsumerIr.aidl
index 41a1afe..056a8b1 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/IConsumerIr.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,10 +31,9 @@
// 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.graphics.composer3;
+package android.hardware.ir;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+interface IConsumerIr {
+ android.hardware.ir.ConsumerIrFreqRange[] getCarrierFreqs();
+ void transmit(in int carrierFreq, in int[] pattern);
}
diff --git a/ir/aidl/android/hardware/ir/ConsumerIrFreqRange.aidl b/ir/aidl/android/hardware/ir/ConsumerIrFreqRange.aidl
new file mode 100644
index 0000000..ab0276a
--- /dev/null
+++ b/ir/aidl/android/hardware/ir/ConsumerIrFreqRange.aidl
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2021 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.ir;
+
+@VintfStability
+parcelable ConsumerIrFreqRange {
+ int minHz;
+ int maxHz;
+}
diff --git a/ir/aidl/android/hardware/ir/IConsumerIr.aidl b/ir/aidl/android/hardware/ir/IConsumerIr.aidl
new file mode 100644
index 0000000..d14fa56
--- /dev/null
+++ b/ir/aidl/android/hardware/ir/IConsumerIr.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2021 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.ir;
+
+import android.hardware.ir.ConsumerIrFreqRange;
+
+@VintfStability
+interface IConsumerIr {
+ /**
+ * Enumerates which frequencies the IR transmitter supports.
+ *
+ * Status OK (EX_NONE) on success.
+ *
+ * @return - an array of all supported frequency ranges.
+ */
+ ConsumerIrFreqRange[] getCarrierFreqs();
+
+ /**
+ * Sends an IR pattern at a given frequency in HZ.
+ *
+ * The pattern is alternating series of carrier on and off periods measured in
+ * microseconds. The carrier should be turned off at the end of a transmit
+ * even if there are and odd number of entries in the pattern array.
+ *
+ * This call must return when the transmit is complete or encounters an error.
+ *
+ * Status OK (EX_NONE) on success.
+ * EX_UNSUPPORTED_OPERATION when the frequency is not supported.
+ */
+ void transmit(in int carrierFreq, in int[] pattern);
+}
diff --git a/ir/aidl/default/Android.bp b/ir/aidl/default/Android.bp
new file mode 100644
index 0000000..6519664
--- /dev/null
+++ b/ir/aidl/default/Android.bp
@@ -0,0 +1,33 @@
+// Copyright (C) 2021 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.
+
+// Example binder service of the ir HAL.
+cc_binary {
+ name: "android.hardware.ir-service.example",
+ relative_install_path: "hw",
+ init_rc: ["android.hardware.ir-service.example.rc"],
+ vendor: true,
+ vintf_fragments: ["android.hardware.ir-service.example.xml"],
+
+ shared_libs: [
+ "libbase",
+ "libbinder_ndk",
+ "libcutils",
+ "liblog",
+ "libutils",
+ "android.hardware.ir-V1-ndk",
+ ],
+
+ srcs: ["main.cpp"],
+}
diff --git a/ir/aidl/default/android.hardware.ir-service.example.rc b/ir/aidl/default/android.hardware.ir-service.example.rc
new file mode 100644
index 0000000..56def64
--- /dev/null
+++ b/ir/aidl/default/android.hardware.ir-service.example.rc
@@ -0,0 +1,4 @@
+service vendor.ir-default /vendor/bin/hw/android.hardware.ir-service.example
+ class hal
+ user nobody
+ group nobody
diff --git a/ir/aidl/default/android.hardware.ir-service.example.xml b/ir/aidl/default/android.hardware.ir-service.example.xml
new file mode 100644
index 0000000..1a63520
--- /dev/null
+++ b/ir/aidl/default/android.hardware.ir-service.example.xml
@@ -0,0 +1,7 @@
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.ir</name>
+ <version>1</version>
+ <fqname>IConsumerIr/default</fqname>
+ </hal>
+</manifest>
diff --git a/ir/aidl/default/main.cpp b/ir/aidl/default/main.cpp
new file mode 100644
index 0000000..764aeaf
--- /dev/null
+++ b/ir/aidl/default/main.cpp
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/android/hardware/ir/BnConsumerIr.h>
+#include <android-base/logging.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <numeric>
+
+namespace aidl::android::hardware::ir {
+
+const std::vector<ConsumerIrFreqRange> kSupportedFreqs = {
+ {2000, 4000},
+ {10000, 30000},
+};
+
+class ConsumerIr : public BnConsumerIr {
+ ::ndk::ScopedAStatus getCarrierFreqs(std::vector<ConsumerIrFreqRange>* _aidl_return) override;
+ ::ndk::ScopedAStatus transmit(int32_t in_carrierFreq,
+ const std::vector<int32_t>& in_pattern) override;
+};
+
+::ndk::ScopedAStatus ConsumerIr::getCarrierFreqs(std::vector<ConsumerIrFreqRange>* _aidl_return) {
+ *_aidl_return = kSupportedFreqs;
+ return ::ndk::ScopedAStatus::ok();
+}
+
+bool isSupportedFreq(int32_t freq) {
+ for (const auto& range : kSupportedFreqs) {
+ if (freq >= range.minHz && freq <= range.maxHz) return true;
+ }
+ return false;
+}
+
+::ndk::ScopedAStatus ConsumerIr::transmit(int32_t in_carrierFreq,
+ const std::vector<int32_t>& in_pattern) {
+ if (isSupportedFreq(in_carrierFreq)) {
+ // trasmit the pattern, each integer is number of microseconds in an
+ // alternating on/off state.
+ usleep(std::accumulate(in_pattern.begin(), in_pattern.end(), 0));
+ return ::ndk::ScopedAStatus::ok();
+ } else {
+ // unsupported operation
+ return ::ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+ }
+ return ::ndk::ScopedAStatus::ok();
+}
+
+} // namespace aidl::android::hardware::ir
+
+using aidl::android::hardware::ir::ConsumerIr;
+
+int main() {
+ auto binder = ::ndk::SharedRefBase::make<ConsumerIr>();
+ const std::string name = std::string() + ConsumerIr::descriptor + "/default";
+ CHECK_EQ(STATUS_OK, AServiceManager_addService(binder->asBinder().get(), name.c_str()))
+ << "Failed to register " << name;
+
+ ABinderProcess_setThreadPoolMaxThreadCount(0);
+ ABinderProcess_joinThreadPool();
+
+ return EXIT_FAILURE; // should not reached
+}
diff --git a/ir/aidl/vts/Android.bp b/ir/aidl/vts/Android.bp
new file mode 100644
index 0000000..c2491b8
--- /dev/null
+++ b/ir/aidl/vts/Android.bp
@@ -0,0 +1,43 @@
+//
+// Copyright (C) 2021 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 {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_test {
+ name: "VtsHalIrTargetTest",
+ defaults: [
+ "VtsHalTargetTestDefaults",
+ "use_libaidlvintf_gtest_helper_static",
+ ],
+ srcs: ["VtsHalIrTargetTest.cpp"],
+ shared_libs: [
+ "libbinder_ndk",
+ ],
+ static_libs: [
+ "android.hardware.ir-V1-ndk",
+ ],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
+}
diff --git a/ir/aidl/vts/VtsHalIrTargetTest.cpp b/ir/aidl/vts/VtsHalIrTargetTest.cpp
new file mode 100644
index 0000000..3527625
--- /dev/null
+++ b/ir/aidl/vts/VtsHalIrTargetTest.cpp
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#define LOG_TAG "ir_aidl_hal_test"
+
+#include <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/ir/IConsumerIr.h>
+#include <android-base/logging.h>
+#include <android/binder_auto_utils.h>
+#include <android/binder_manager.h>
+#include <gtest/gtest.h>
+#include <algorithm>
+#include <vector>
+
+using ::aidl::android::hardware::ir::ConsumerIrFreqRange;
+using ::aidl::android::hardware::ir::IConsumerIr;
+using ::ndk::SpAIBinder;
+
+class ConsumerIrTest : public ::testing::TestWithParam<std::string> {
+ public:
+ virtual void SetUp() override {
+ mIr = IConsumerIr::fromBinder(
+ SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
+ ASSERT_NE(mIr, nullptr);
+ }
+
+ std::shared_ptr<IConsumerIr> mIr;
+};
+
+// Test transmit() for the min and max frequency of every available range
+TEST_P(ConsumerIrTest, TransmitTest) {
+ std::vector<ConsumerIrFreqRange> ranges;
+ const auto& ret = mIr->getCarrierFreqs(&ranges);
+ ASSERT_TRUE(ret.isOk());
+
+ if (ranges.size() > 0) {
+ uint32_t len = 16;
+ std::vector<int32_t> vec;
+ vec.resize(len);
+ std::fill(vec.begin(), vec.end(), 1000);
+ for (auto range = ranges.begin(); range != ranges.end(); range++) {
+ EXPECT_TRUE(mIr->transmit(range->minHz, vec).isOk());
+ EXPECT_TRUE(mIr->transmit(range->maxHz, vec).isOk());
+ }
+ }
+}
+
+// Test transmit() when called with invalid frequencies
+TEST_P(ConsumerIrTest, BadFreqTest) {
+ uint32_t len = 16;
+ std::vector<int32_t> vec;
+ vec.resize(len);
+ std::fill(vec.begin(), vec.end(), 1);
+ const auto& res = mIr->transmit(-1, vec);
+ EXPECT_FALSE(res.isOk());
+ EXPECT_EQ(res.getExceptionCode(), EX_UNSUPPORTED_OPERATION);
+}
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ConsumerIrTest);
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, ConsumerIrTest,
+ testing::ValuesIn(android::getAidlHalInstanceNames(IConsumerIr::descriptor)),
+ ::android::PrintInstanceNameToString);
diff --git a/light/aidl/default/main.cpp b/light/aidl/default/main.cpp
index a860bf4..54e1316 100644
--- a/light/aidl/default/main.cpp
+++ b/light/aidl/default/main.cpp
@@ -28,7 +28,7 @@
const std::string instance = std::string() + Lights::descriptor + "/default";
binder_status_t status = AServiceManager_addService(lights->asBinder().get(), instance.c_str());
- CHECK(status == STATUS_OK);
+ CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reached
diff --git a/memtrack/OWNERS b/memtrack/OWNERS
new file mode 100644
index 0000000..a182ed9
--- /dev/null
+++ b/memtrack/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 30545
+connoro@google.com
diff --git a/memtrack/aidl/default/main.cpp b/memtrack/aidl/default/main.cpp
index d063d2a..5cf5f94 100644
--- a/memtrack/aidl/default/main.cpp
+++ b/memtrack/aidl/default/main.cpp
@@ -29,7 +29,7 @@
const std::string instance = std::string() + Memtrack::descriptor + "/default";
binder_status_t status =
AServiceManager_addService(memtrack->asBinder().get(), instance.c_str());
- CHECK(status == STATUS_OK);
+ CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // Unreachable
diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl
index aebe8d9..0ad254d 100644
--- a/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl
+++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/OperationType.aidl
@@ -5385,7 +5385,7 @@
* must be in the range [0, n).
*
* Outputs:
- * * 0: The reversed tensor.
+ * * 0: The reversed tensor of the same shape as the input tensor.
* For {@link OperandType::TENSOR_QUANT8_ASYMM} and
* {@link OperandType::TENSOR_QUANT8_ASYMM_SIGNED} tensors,
* the scales and zeroPoint must be the same as input0.
diff --git a/oemlock/aidl/default/service.cpp b/oemlock/aidl/default/service.cpp
index af828a0..9fa7d63 100644
--- a/oemlock/aidl/default/service.cpp
+++ b/oemlock/aidl/default/service.cpp
@@ -28,7 +28,7 @@
const std::string instance = std::string() + OemLock::descriptor + "/default";
binder_status_t status = AServiceManager_addService(oemlock->asBinder().get(), instance.c_str());
- CHECK(status == STATUS_OK);
+ CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return -1; // Should never be reached
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Mode.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Mode.aidl
index 8920c01..ba444a7 100644
--- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Mode.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Mode.aidl
@@ -49,4 +49,5 @@
CAMERA_STREAMING_LOW = 12,
CAMERA_STREAMING_MID = 13,
CAMERA_STREAMING_HIGH = 14,
+ GAME_LOADING = 15,
}
diff --git a/power/aidl/android/hardware/power/Mode.aidl b/power/aidl/android/hardware/power/Mode.aidl
index ae113e3..2ebace1 100644
--- a/power/aidl/android/hardware/power/Mode.aidl
+++ b/power/aidl/android/hardware/power/Mode.aidl
@@ -162,4 +162,9 @@
* This hint indicates that camera high resolution stream is being started.
*/
CAMERA_STREAMING_HIGH,
+
+ /**
+ * This mode indicates that the user is waiting for loading in a game.
+ */
+ GAME_LOADING,
}
diff --git a/power/aidl/default/Android.bp b/power/aidl/default/Android.bp
index 9acb9e0..223b9d5 100644
--- a/power/aidl/default/Android.bp
+++ b/power/aidl/default/Android.bp
@@ -30,7 +30,7 @@
shared_libs: [
"libbase",
"libbinder_ndk",
- "android.hardware.power-V2-ndk",
+ "android.hardware.power-V3-ndk",
],
srcs: [
"main.cpp",
diff --git a/power/aidl/default/main.cpp b/power/aidl/default/main.cpp
index 964bd96..306b91b 100644
--- a/power/aidl/default/main.cpp
+++ b/power/aidl/default/main.cpp
@@ -28,7 +28,7 @@
const std::string instance = std::string() + Power::descriptor + "/default";
binder_status_t status = AServiceManager_addService(vib->asBinder().get(), instance.c_str());
- CHECK(status == STATUS_OK);
+ CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
diff --git a/power/aidl/default/power-default.xml b/power/aidl/default/power-default.xml
index 9f56deb..927ba22 100644
--- a/power/aidl/default/power-default.xml
+++ b/power/aidl/default/power-default.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.power</name>
- <version>2</version>
+ <version>3</version>
<fqname>IPower/default</fqname>
</hal>
</manifest>
diff --git a/power/stats/aidl/default/main.cpp b/power/stats/aidl/default/main.cpp
index 2fe3d2e..9e78247 100644
--- a/power/stats/aidl/default/main.cpp
+++ b/power/stats/aidl/default/main.cpp
@@ -73,7 +73,7 @@
const std::string instance = std::string() + PowerStats::descriptor + "/default";
binder_status_t status = AServiceManager_addService(p->asBinder().get(), instance.c_str());
- CHECK(status == STATUS_OK);
+ CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl
index 9df687c..3342619 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl
@@ -53,6 +53,7 @@
boolean preferred;
boolean persistent;
boolean alwaysOn;
+ @nullable android.hardware.radio.data.TrafficDescriptor trafficDescriptor;
const int ID_DEFAULT = 0;
const int ID_TETHERED = 1;
const int ID_IMS = 2;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl
index a648675..dc6092a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl
@@ -46,7 +46,7 @@
oneway void setDataThrottling(in int serial, in android.hardware.radio.data.DataThrottlingAction dataThrottlingAction, in long completionDurationMillis);
oneway void setInitialAttachApn(in int serial, in android.hardware.radio.data.DataProfileInfo dataProfileInfo);
oneway void setResponseFunctions(in android.hardware.radio.data.IRadioDataResponse radioDataResponse, in android.hardware.radio.data.IRadioDataIndication radioDataIndication);
- oneway void setupDataCall(in int serial, in android.hardware.radio.AccessNetwork accessNetwork, in android.hardware.radio.data.DataProfileInfo dataProfileInfo, in boolean roamingAllowed, in android.hardware.radio.data.DataRequestReason reason, in android.hardware.radio.data.LinkAddress[] addresses, in String[] dnses, in int pduSessionId, in @nullable android.hardware.radio.data.SliceInfo sliceInfo, in @nullable android.hardware.radio.data.TrafficDescriptor trafficDescriptor, in boolean matchAllRuleAllowed);
+ oneway void setupDataCall(in int serial, in android.hardware.radio.AccessNetwork accessNetwork, in android.hardware.radio.data.DataProfileInfo dataProfileInfo, in boolean roamingAllowed, in android.hardware.radio.data.DataRequestReason reason, in android.hardware.radio.data.LinkAddress[] addresses, in String[] dnses, in int pduSessionId, in @nullable android.hardware.radio.data.SliceInfo sliceInfo, in boolean matchAllRuleAllowed);
oneway void startHandover(in int serial, in int callId);
oneway void startKeepalive(in int serial, in android.hardware.radio.data.KeepaliveRequest keepalive);
oneway void stopKeepalive(in int serial, in int sessionHandle);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataIndication.aidl
index e496c7b..b0cc1eb 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataIndication.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataIndication.aidl
@@ -37,5 +37,5 @@
oneway void dataCallListChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.SetupDataCallResult[] dcList);
oneway void keepaliveStatus(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.KeepaliveStatus status);
oneway void pcoData(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.PcoDataInfo pco);
- oneway void unthrottleApn(in android.hardware.radio.RadioIndicationType type, in String apn);
+ oneway void unthrottleApn(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.DataProfileInfo dataProfileInfo);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsInfo.aidl
index 2da0167..93940fd 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsInfo.aidl
@@ -36,6 +36,5 @@
parcelable ActivityStatsInfo {
int sleepModeTimeMs;
int idleModeTimeMs;
- int[] txmModetimeMs;
- int rxModeTimeMs;
+ android.hardware.radio.modem.ActivityStatsTechSpecificInfo[] techSpecificInfo;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl
similarity index 75%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl
index cfafc50..798ec36 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,16 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.radio.modem;
+@VintfStability
+parcelable ActivityStatsTechSpecificInfo {
+ android.hardware.radio.AccessNetwork rat;
+ int frequencyRange;
+ int[] txmModetimeMs;
+ int rxModeTimeMs;
+ const int FREQUENCY_RANGE_UNKNOWN = 0;
+ const int FREQUENCY_RANGE_LOW = 1;
+ const int FREQUENCY_RANGE_MID = 2;
+ const int FREQUENCY_RANGE_HIGH = 3;
+ const int FREQUENCY_RANGE_MMWAVE = 4;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl
index 16433be..c618791 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl
@@ -68,4 +68,6 @@
oneway void startNetworkScan(in int serial, in android.hardware.radio.network.NetworkScanRequest request);
oneway void stopNetworkScan(in int serial);
oneway void supplyNetworkDepersonalization(in int serial, in String netPin);
+ oneway void setUsageSetting(in int serial, in android.hardware.radio.network.UsageSetting usageSetting);
+ oneway void getUsageSetting(in int serial);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl
index ff95396..8cf4c31 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl
@@ -67,4 +67,6 @@
oneway void startNetworkScanResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void stopNetworkScanResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void supplyNetworkDepersonalizationResponse(in android.hardware.radio.RadioResponseInfo info, in int remainingRetries);
+ oneway void setUsageSettingResponse(in android.hardware.radio.RadioResponseInfo info);
+ oneway void getUsageSettingResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.network.UsageSetting usageSetting);
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UsageSetting.aidl
similarity index 87%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UsageSetting.aidl
index cfafc50..7fdf831 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UsageSetting.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,9 @@
// 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.graphics.composer3;
+package android.hardware.radio.network;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum UsageSetting {
+ VOICE_CENTRIC = 1,
+ DATA_CENTRIC = 2,
}
diff --git a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl
index a14963f..0f06119 100644
--- a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl
+++ b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl
@@ -20,6 +20,7 @@
import android.hardware.radio.data.ApnAuthType;
import android.hardware.radio.data.ApnTypes;
import android.hardware.radio.data.PdpProtocolType;
+import android.hardware.radio.data.TrafficDescriptor;
@VintfStability
parcelable DataProfileInfo {
@@ -122,4 +123,12 @@
* See 3GPP TS 23.501 section 5.6.13 for the details.
*/
boolean alwaysOn;
+ /**
+ * TrafficDescriptor for which data connection needs to be established.
+ * It is used for URSP traffic matching as described in TS 24.526 Section 4.2.2.
+ * It includes an optional DNN which, if present, must be used for traffic matching --
+ * it does not specify the end point to be used for the data call. The end point is specified by
+ * apn; apn must be used as the end point if one is not specified through URSP rules.
+ */
+ @nullable TrafficDescriptor trafficDescriptor;
}
diff --git a/radio/aidl/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/android/hardware/radio/data/IRadioData.aidl
index 9f5ba4c..54a045c 100644
--- a/radio/aidl/android/hardware/radio/data/IRadioData.aidl
+++ b/radio/aidl/android/hardware/radio/data/IRadioData.aidl
@@ -219,12 +219,6 @@
* EPDG to 5G. It is valid only when accessNetwork is AccessNetwork:NGRAN. If the slice
* passed from EPDG is rejected, then the data failure cause must be
* DataCallFailCause:SLICE_REJECTED.
- * @param trafficDescriptor TrafficDescriptor for which data connection needs to be established.
- * It is used for URSP traffic matching as described in TS 24.526 Section 4.2.2.
- * It includes an optional DNN which, if present, must be used for traffic matching --
- * it does not specify the end point to be used for the data call. The end point is
- * specified by DataProfileInfo.apn; DataProfileInfo.apn must be used as the end point if
- * one is not specified through URSP rules.
* @param matchAllRuleAllowed bool to indicate if using default match-all URSP rule for this
* request is allowed. If false, this request must not use the match-all URSP rule and if
* a non-match-all rule is not found (or if URSP rules are not available) it should
@@ -238,7 +232,6 @@
in DataProfileInfo dataProfileInfo, in boolean roamingAllowed,
in DataRequestReason reason, in LinkAddress[] addresses, in String[] dnses,
in int pduSessionId, in @nullable SliceInfo sliceInfo,
- in @nullable TrafficDescriptor trafficDescriptor,
in boolean matchAllRuleAllowed);
/**
diff --git a/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl b/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl
index 8e73ee3..1772c88 100644
--- a/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl
+++ b/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl
@@ -17,6 +17,7 @@
package android.hardware.radio.data;
import android.hardware.radio.RadioIndicationType;
+import android.hardware.radio.data.DataProfileInfo;
import android.hardware.radio.data.KeepaliveStatus;
import android.hardware.radio.data.PcoDataInfo;
import android.hardware.radio.data.SetupDataCallResult;
@@ -68,7 +69,7 @@
* is sent, AOSP will no longer throttle calls to IRadioData.SetupDataCall for the given APN.
*
* @param type Type of radio indication
- * @param apn Apn to unthrottle
+ * @param dataProfileInfo Data profile info.
*/
- void unthrottleApn(in RadioIndicationType type, in String apn);
+ void unthrottleApn(in RadioIndicationType type, in DataProfileInfo dataProfileInfo);
}
diff --git a/radio/aidl/android/hardware/radio/modem/ActivityStatsInfo.aidl b/radio/aidl/android/hardware/radio/modem/ActivityStatsInfo.aidl
index 764a86d..d0aa695 100644
--- a/radio/aidl/android/hardware/radio/modem/ActivityStatsInfo.aidl
+++ b/radio/aidl/android/hardware/radio/modem/ActivityStatsInfo.aidl
@@ -16,6 +16,8 @@
package android.hardware.radio.modem;
+import android.hardware.radio.modem.ActivityStatsTechSpecificInfo;
+
@VintfStability
parcelable ActivityStatsInfo {
/**
@@ -28,17 +30,10 @@
*/
int idleModeTimeMs;
/**
- * Each index represent total time (in ms) during which the transmitter is active/awake for a
- * particular power range as shown below.
- * index 0 = tx_power < 0dBm
- * index 1 = 0dBm < tx_power < 5dBm
- * index 2 = 5dBm < tx_power < 15dBm
- * index 3 = 15dBm < tx_power < 20dBm
- * index 4 = tx_power > 20dBm
+ * Technology specific activity stats info.
+ * List of the activity stats for each RATs (2G, 3G, 4G and 5G) and frequency ranges (HIGH for
+ * sub6 and MMWAVE) in case of 5G. In case implementation doesn't have RAT specific activity
+ * stats then send only one activity stats info with RAT unknown.
*/
- int[] txmModetimeMs;
- /**
- * Total time (in ms) for which receiver is active/awake and the transmitter is inactive
- */
- int rxModeTimeMs;
+ ActivityStatsTechSpecificInfo[] techSpecificInfo;
}
diff --git a/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl b/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl
new file mode 100644
index 0000000..fb14223
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2021 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.radio.modem;
+
+import android.hardware.radio.AccessNetwork;
+
+@VintfStability
+parcelable ActivityStatsTechSpecificInfo {
+ /** Indicates the frequency range is unknown. */
+ const int FREQUENCY_RANGE_UNKNOWN = 0;
+ /** Indicates the frequency range is below 1GHz. */
+ const int FREQUENCY_RANGE_LOW = 1;
+ /** Indicates the frequency range is between 1GHz and 3GHz. */
+ const int FREQUENCY_RANGE_MID = 2;
+ /** Indicates the frequency range is between 3GHz and 6GHz. */
+ const int FREQUENCY_RANGE_HIGH = 3;
+ /** Indicates the frequency range is above 6GHz (millimeter wave frequency). */
+ const int FREQUENCY_RANGE_MMWAVE = 4;
+ /**
+ * Radio access technology. Set UNKNOWN if the Activity statistics
+ * is RAT independent.
+ */
+ AccessNetwork rat;
+ /**
+ * Frequency range. Values are FREQUENCY_RANGE_
+ * Set FREQUENCY_RANGE_UNKNOWN if the Activity statistics when frequency range
+ * is not applicable.
+ */
+ int frequencyRange;
+ /**
+ * Each index represent total time (in ms) during which the transmitter is active/awake for a
+ * particular power range as shown below.
+ * index 0 = tx_power <= 0dBm
+ * index 1 = 0dBm < tx_power <= 5dBm
+ * index 2 = 5dBm < tx_power <= 15dBm
+ * index 3 = 15dBm < tx_power <= 20dBm
+ * index 4 = tx_power > 20dBm
+ */
+ int[] txmModetimeMs;
+ /**
+ * Total time (in ms) for which receiver is active/awake and the transmitter is inactive
+ */
+ int rxModeTimeMs;
+}
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
index 1081a75..aaf432a 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
@@ -27,6 +27,7 @@
import android.hardware.radio.network.RadioAccessSpecifier;
import android.hardware.radio.network.RadioBandMode;
import android.hardware.radio.network.SignalThresholdInfo;
+import android.hardware.radio.network.UsageSetting;
/**
* This interface is used by telephony and telecom to talk to cellular radio for network APIs.
@@ -416,4 +417,25 @@
* Response function is IRadioNetworkResponse.supplyNetworkDepersonalizationResponse()
*/
void supplyNetworkDepersonalization(in int serial, in String netPin);
+
+ /**
+ * Set the UE usage setting for data/voice centric usage.
+ *
+ * <p>Sets the usage setting in accordance with 3gpp 24.301 sec 4.3 and 3gpp 24.501 sec 4.3.
+ * <p>This value must be independently preserved for each SIM; (setting the value is not a
+ * "global" override).
+ *
+ * @param serial Serial number of request.
+ * @param usageSetting the usage setting for the current SIM.
+ */
+ oneway void setUsageSetting(in int serial, in UsageSetting usageSetting);
+
+ /**
+ * Get the UE usage setting for data/voice centric usage.
+ *
+ * <p>Gets the usage setting in accordance with 3gpp 24.301 sec 4.3 and 3gpp 24.501 sec 4.3.
+ *
+ * @param serial Serial number of request.
+ */
+ oneway void getUsageSetting(in int serial);
}
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
index 429b5a8..30f4221 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
@@ -31,6 +31,7 @@
import android.hardware.radio.network.RadioBandMode;
import android.hardware.radio.network.RegStateResult;
import android.hardware.radio.network.SignalStrength;
+import android.hardware.radio.network.UsageSetting;
/**
* Interface declaring response functions to solicited radio requests for network APIs.
@@ -549,4 +550,30 @@
* RadioError:SIM_ABSENT
*/
void supplyNetworkDepersonalizationResponse(in RadioResponseInfo info, in int remainingRetries);
+
+ /**
+ * @param info Response info struct containing response type, serial no. and error.
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_STATE
+ * RadioError:INVALID_ARGUMENTS
+ * RadioError:INTERNAL_ERR
+ * RadioError:SIM_ABSENT
+ */
+ oneway void setUsageSettingResponse(in RadioResponseInfo info);
+
+ /**
+ * @param info Response info struct containing response type, serial no. and error.
+ * @param usageSetting the usage setting for the current SIM.
+ *
+ * Valid errors returned:
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INVALID_STATE
+ * RadioError:INTERNAL_ERR
+ * RadioError:SIM_ABSENT
+ */
+ oneway void getUsageSettingResponse(in RadioResponseInfo info, in UsageSetting usageSetting);
}
diff --git a/radio/aidl/android/hardware/radio/network/UsageSetting.aidl b/radio/aidl/android/hardware/radio/network/UsageSetting.aidl
new file mode 100644
index 0000000..ba8fe93
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/network/UsageSetting.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2021 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.radio.network;
+
+/**
+ * Cellular usage setting with values according to 3gpp 24.301 sec 4.3 and 3gpp 24.501 sec 4.3.
+ *
+ * <p>Also refer to "UE's usage setting" as defined in 3gpp 24.301 section 3.1 and 3gpp 23.221
+ * Annex A.
+ */
+@VintfStability
+@Backing(type="int")
+enum UsageSetting {
+ /**
+ * UE operates in voice-centric mode. Generally speaking, in this mode of operation, the UE
+ * will not remain camped on a cell or attached to a network unless that cell/network provides
+ * voice service.
+ */
+ VOICE_CENTRIC = 1,
+
+ /**
+ * UE operates in data-centric mode. Generally speaking, in this mode of operation, the UE
+ * will not reselect away from a cell/network that only provides data services.
+ */
+ DATA_CENTRIC = 2,
+}
diff --git a/radio/aidl/compat/OWNERS b/radio/aidl/compat/OWNERS
new file mode 100644
index 0000000..471d806
--- /dev/null
+++ b/radio/aidl/compat/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 20868
+include ../../1.0/vts/OWNERS
+twasilczyk@google.com
diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp
index 43d9378..487d91b 100644
--- a/radio/aidl/compat/libradiocompat/Android.bp
+++ b/radio/aidl/compat/libradiocompat/Android.bp
@@ -28,7 +28,6 @@
cflags: [
"-Wall",
"-Wextra",
- //"-Wold-style-cast", // TODO(b/203699028) enable after aosp/1900880 gets merged
"-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION",
],
shared_libs: [
@@ -56,7 +55,10 @@
"libutils",
],
srcs: [
+ "CallbackManager.cpp",
+ "DriverContext.cpp",
"RadioCompatBase.cpp",
+ "RadioIndication.cpp",
"RadioResponse.cpp",
"commonStructs.cpp",
"config/RadioConfig.cpp",
diff --git a/radio/aidl/compat/libradiocompat/CallbackManager.cpp b/radio/aidl/compat/libradiocompat/CallbackManager.cpp
new file mode 100644
index 0000000..c2eaed1
--- /dev/null
+++ b/radio/aidl/compat/libradiocompat/CallbackManager.cpp
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <libradiocompat/CallbackManager.h>
+
+#include <android-base/logging.h>
+
+using namespace std::literals::chrono_literals;
+
+namespace android::hardware::radio::compat {
+
+/**
+ * How much setter thread will wait with setting response functions after the last
+ * setResponseFunctions call from the framework. Subsequent calls from the framework reset the
+ * clock, so this number should be larger than the longest time between setResponseFunctions calls
+ * from the framework.
+ *
+ * Real world measurements with Cuttlefish give <10ms delay between Modem and Data and <2ms delays
+ * between all others.
+ */
+static constexpr auto kDelayedSetterDelay = 100ms;
+
+CallbackManager::CallbackManager(std::shared_ptr<DriverContext> context, sp<V1_5::IRadio> hidlHal)
+ : mHidlHal(hidlHal),
+ mRadioResponse(sp<compat::RadioResponse>::make(context)),
+ mRadioIndication(sp<compat::RadioIndication>::make(context)),
+ mDelayedSetterThread(&CallbackManager::delayedSetterThread, this) {}
+
+CallbackManager::~CallbackManager() {
+ {
+ std::unique_lock<std::mutex> lock(mDelayedSetterGuard);
+ mDelayedSetterDeadline = std::nullopt;
+ mDestroy = true;
+ mDelayedSetterCv.notify_all();
+ }
+ mDelayedSetterThread.join();
+}
+
+RadioResponse& CallbackManager::response() const {
+ return *mRadioResponse;
+}
+
+void CallbackManager::setResponseFunctionsDelayed() {
+ std::unique_lock<std::mutex> lock(mDelayedSetterGuard);
+ mDelayedSetterDeadline = std::chrono::steady_clock::now() + kDelayedSetterDelay;
+ mDelayedSetterCv.notify_all();
+}
+
+void CallbackManager::delayedSetterThread() {
+ while (!mDestroy) {
+ std::unique_lock<std::mutex> lock(mDelayedSetterGuard);
+ auto deadline = mDelayedSetterDeadline;
+
+ // not waiting to set response functions
+ if (!deadline) {
+ mDelayedSetterCv.wait(lock);
+ continue;
+ }
+
+ // waiting to set response functions, but not yet
+ if (*deadline > std::chrono::steady_clock::now()) {
+ mDelayedSetterCv.wait_until(lock, *deadline);
+ continue;
+ }
+
+ mHidlHal->setResponseFunctions(mRadioResponse, mRadioIndication).assertOk();
+ mDelayedSetterDeadline = std::nullopt;
+ }
+}
+
+} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/DriverContext.cpp b/radio/aidl/compat/libradiocompat/DriverContext.cpp
new file mode 100644
index 0000000..a07173e
--- /dev/null
+++ b/radio/aidl/compat/libradiocompat/DriverContext.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <libradiocompat/DriverContext.h>
+
+namespace android::hardware::radio::compat {
+
+namespace aidl = ::aidl::android::hardware::radio;
+
+void DriverContext::addDataProfile(const aidl::data::DataProfileInfo& profile) {
+ mDataProfiles[profile.apn] = profile;
+}
+
+aidl::data::DataProfileInfo DriverContext::getDataProfile(const std::string& apn) {
+ const auto it = mDataProfiles.find(apn);
+ if (it != mDataProfiles.end()) return it->second;
+
+ // if not found in cache, return a made up default
+ return {
+ .apn = apn,
+ };
+}
+
+} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp b/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp
index a9eac68..2a2d7a3 100644
--- a/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp
+++ b/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp
@@ -20,16 +20,11 @@
namespace android::hardware::radio::compat {
-RadioCompatBase::RadioCompatBase(sp<V1_5::IRadio> hidlHal, sp<RadioResponse> radioResponse,
- sp<RadioIndication> radioIndication)
- : mHal1_5(hidlHal),
+RadioCompatBase::RadioCompatBase(std::shared_ptr<DriverContext> context, sp<V1_5::IRadio> hidlHal,
+ std::shared_ptr<CallbackManager> cbMgr)
+ : mContext(context),
+ mHal1_5(hidlHal),
mHal1_6(V1_6::IRadio::castFrom(hidlHal)),
- mRadioResponse(radioResponse),
- mRadioIndication(radioIndication) {}
-
-V1_6::IRadioResponse& RadioCompatBase::respond() {
- CHECK(mRadioResponse) << "This shouldn't happen (response functions are passed in constructor)";
- return *mRadioResponse;
-}
+ mCallbackManager(cbMgr) {}
} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/RadioIndication.cpp b/radio/aidl/compat/libradiocompat/RadioIndication.cpp
new file mode 100644
index 0000000..30ef6a0
--- /dev/null
+++ b/radio/aidl/compat/libradiocompat/RadioIndication.cpp
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <libradiocompat/RadioIndication.h>
+
+namespace android::hardware::radio::compat {
+
+RadioIndication::RadioIndication(std::shared_ptr<DriverContext> context) : mContext(context) {}
+
+} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/RadioResponse.cpp b/radio/aidl/compat/libradiocompat/RadioResponse.cpp
index 35b0ac1..dbeb68a 100644
--- a/radio/aidl/compat/libradiocompat/RadioResponse.cpp
+++ b/radio/aidl/compat/libradiocompat/RadioResponse.cpp
@@ -22,15 +22,17 @@
namespace android::hardware::radio::compat {
+RadioResponse::RadioResponse(std::shared_ptr<DriverContext> context) : mContext(context) {}
+
Return<void> RadioResponse::acknowledgeRequest(int32_t serial) {
LOG_CALL << serial;
// TODO(b/203699028): send to correct requestor or confirm if spam is not a problem
- if (mDataCb) mDataCb->acknowledgeRequest(serial);
- if (mMessagingCb) mMessagingCb->acknowledgeRequest(serial);
- if (mModemCb) mModemCb->acknowledgeRequest(serial);
- if (mNetworkCb) mNetworkCb->acknowledgeRequest(serial);
- if (mSimCb) mSimCb->acknowledgeRequest(serial);
- if (mVoiceCb) mVoiceCb->acknowledgeRequest(serial);
+ if (mDataCb) mDataCb.get()->acknowledgeRequest(serial);
+ if (mMessagingCb) mMessagingCb.get()->acknowledgeRequest(serial);
+ if (mModemCb) mModemCb.get()->acknowledgeRequest(serial);
+ if (mNetworkCb) mNetworkCb.get()->acknowledgeRequest(serial);
+ if (mSimCb) mSimCb.get()->acknowledgeRequest(serial);
+ if (mVoiceCb) mVoiceCb.get()->acknowledgeRequest(serial);
return {};
}
diff --git a/radio/aidl/compat/libradiocompat/commonStructs.cpp b/radio/aidl/compat/libradiocompat/commonStructs.cpp
index c25768d..6e4c873 100644
--- a/radio/aidl/compat/libradiocompat/commonStructs.cpp
+++ b/radio/aidl/compat/libradiocompat/commonStructs.cpp
@@ -20,11 +20,11 @@
namespace aidl = ::aidl::android::hardware::radio;
-V1_6::RadioResponseInfo notSupported(int32_t serial) {
+aidl::RadioResponseInfo notSupported(int32_t serial) {
return {
- .type = V1_0::RadioResponseType::SOLICITED,
+ .type = aidl::RadioResponseType::SOLICITED,
.serial = serial,
- .error = V1_6::RadioError::REQUEST_NOT_SUPPORTED,
+ .error = aidl::RadioError::REQUEST_NOT_SUPPORTED,
};
}
diff --git a/radio/aidl/compat/libradiocompat/commonStructs.h b/radio/aidl/compat/libradiocompat/commonStructs.h
index b859916..a4a4869 100644
--- a/radio/aidl/compat/libradiocompat/commonStructs.h
+++ b/radio/aidl/compat/libradiocompat/commonStructs.h
@@ -21,7 +21,7 @@
namespace android::hardware::radio::compat {
-V1_6::RadioResponseInfo notSupported(int32_t serial);
+aidl::android::hardware::radio::RadioResponseInfo notSupported(int32_t serial);
std::string toAidl(const hidl_string& str);
hidl_string toHidl(const std::string& str);
diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp b/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp
index d0d6f7a..5b22dbe 100644
--- a/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp
+++ b/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp
@@ -16,8 +16,6 @@
#include <libradiocompat/RadioConfig.h>
-#include "RadioConfigIndication.h"
-#include "RadioConfigResponse.h"
#include "commonStructs.h"
#include "debug.h"
#include "structs.h"
@@ -31,11 +29,13 @@
constexpr auto ok = &ScopedAStatus::ok;
RadioConfig::RadioConfig(sp<config::V1_1::IRadioConfig> hidlHal)
- : mHal1_1(hidlHal), mHal1_3(config::V1_3::IRadioConfig::castFrom(hidlHal)) {}
+ : mHal1_1(hidlHal),
+ mHal1_3(config::V1_3::IRadioConfig::castFrom(hidlHal)),
+ mRadioConfigResponse(sp<RadioConfigResponse>::make()),
+ mRadioConfigIndication(sp<RadioConfigIndication>::make()) {}
-config::V1_3::IRadioConfigResponse& RadioConfig::respond() {
- CHECK(mRadioConfigResponse) << "setResponseFunctions was not called yet";
- return *mRadioConfigResponse;
+std::shared_ptr<aidl::IRadioConfigResponse> RadioConfig::respond() {
+ return mRadioConfigResponse->respond();
}
ScopedAStatus RadioConfig::getHalDeviceCapabilities(int32_t serial) {
@@ -43,7 +43,7 @@
if (mHal1_3) {
mHal1_3->getHalDeviceCapabilities(serial);
} else {
- respond().getHalDeviceCapabilitiesResponse(notSupported(serial), false);
+ respond()->getHalDeviceCapabilitiesResponse(notSupported(serial), false);
}
return ok();
}
@@ -86,9 +86,9 @@
CHECK(radioConfigResponse);
CHECK(radioConfigIndication);
- mRadioConfigResponse = sp<RadioConfigResponse>::make(radioConfigResponse);
- mRadioConfigIndication = sp<RadioConfigIndication>::make(radioConfigIndication);
- mHal1_1->setResponseFunctions(mRadioConfigResponse, mRadioConfigIndication);
+ mRadioConfigResponse->setResponseFunction(radioConfigResponse);
+ mRadioConfigIndication->setResponseFunction(radioConfigIndication);
+ mHal1_1->setResponseFunctions(mRadioConfigResponse, mRadioConfigIndication).assertOk();
return ok();
}
diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.cpp b/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.cpp
index 0320ad7..c1e32c1 100644
--- a/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.cpp
+++ b/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "RadioConfigIndication.h"
+#include <libradiocompat/RadioConfigIndication.h>
#include "commonStructs.h"
#include "debug.h"
@@ -28,20 +28,26 @@
namespace aidl = ::aidl::android::hardware::radio::config;
-RadioConfigIndication::RadioConfigIndication(std::shared_ptr<aidl::IRadioConfigIndication> callback)
- : mCallback(callback) {}
+void RadioConfigIndication::setResponseFunction(
+ std::shared_ptr<aidl::IRadioConfigIndication> callback) {
+ mCallback = callback;
+}
+
+std::shared_ptr<aidl::IRadioConfigIndication> RadioConfigIndication::indicate() {
+ return mCallback.get();
+}
Return<void> RadioConfigIndication::simSlotsStatusChanged(
V1_0::RadioIndicationType type, const hidl_vec<config::V1_0::SimSlotStatus>& slotStatus) {
LOG_CALL << type;
- mCallback->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus));
+ indicate()->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus));
return {};
}
Return<void> RadioConfigIndication::simSlotsStatusChanged_1_2(
V1_0::RadioIndicationType type, const hidl_vec<config::V1_2::SimSlotStatus>& slotStatus) {
LOG_CALL << type;
- mCallback->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus));
+ indicate()->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus));
return {};
}
diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.cpp b/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.cpp
index 7066ae4..523c504 100644
--- a/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.cpp
+++ b/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "RadioConfigResponse.h"
+#include <libradiocompat/RadioConfigResponse.h>
#include "commonStructs.h"
#include "debug.h"
@@ -28,14 +28,20 @@
namespace aidl = ::aidl::android::hardware::radio::config;
-RadioConfigResponse::RadioConfigResponse(std::shared_ptr<aidl::IRadioConfigResponse> callback)
- : mCallback(callback) {}
+void RadioConfigResponse::setResponseFunction(
+ std::shared_ptr<aidl::IRadioConfigResponse> callback) {
+ mCallback = callback;
+}
+
+std::shared_ptr<aidl::IRadioConfigResponse> RadioConfigResponse::respond() {
+ return mCallback.get();
+}
Return<void> RadioConfigResponse::getSimSlotsStatusResponse(
const V1_0::RadioResponseInfo& info,
const hidl_vec<config::V1_0::SimSlotStatus>& slotStatus) {
LOG_CALL << info.serial;
- mCallback->getSimSlotsStatusResponse(toAidl(info), toAidl(slotStatus));
+ respond()->getSimSlotsStatusResponse(toAidl(info), toAidl(slotStatus));
return {};
};
@@ -43,47 +49,47 @@
const V1_0::RadioResponseInfo& info,
const hidl_vec<config::V1_2::SimSlotStatus>& slotStatus) {
LOG_CALL << info.serial;
- mCallback->getSimSlotsStatusResponse(toAidl(info), toAidl(slotStatus));
+ respond()->getSimSlotsStatusResponse(toAidl(info), toAidl(slotStatus));
return {};
};
Return<void> RadioConfigResponse::setSimSlotsMappingResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- mCallback->setSimSlotsMappingResponse(toAidl(info));
+ respond()->setSimSlotsMappingResponse(toAidl(info));
return {};
};
Return<void> RadioConfigResponse::getPhoneCapabilityResponse(
const V1_0::RadioResponseInfo& info, const config::V1_1::PhoneCapability& phoneCapability) {
LOG_CALL << info.serial;
- mCallback->getPhoneCapabilityResponse(toAidl(info), toAidl(phoneCapability));
+ respond()->getPhoneCapabilityResponse(toAidl(info), toAidl(phoneCapability));
return {};
};
Return<void> RadioConfigResponse::setPreferredDataModemResponse(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- mCallback->setPreferredDataModemResponse(toAidl(info));
+ respond()->setPreferredDataModemResponse(toAidl(info));
return {};
};
Return<void> RadioConfigResponse::setModemsConfigResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- mCallback->setNumOfLiveModemsResponse(toAidl(info));
+ respond()->setNumOfLiveModemsResponse(toAidl(info));
return {};
};
Return<void> RadioConfigResponse::getModemsConfigResponse(
const V1_0::RadioResponseInfo& info, const config::V1_1::ModemsConfig& modemsConfig) {
LOG_CALL << info.serial;
- mCallback->getNumOfLiveModemsResponse(toAidl(info), modemsConfig.numOfLiveModems);
+ respond()->getNumOfLiveModemsResponse(toAidl(info), modemsConfig.numOfLiveModems);
return {};
};
Return<void> RadioConfigResponse::getHalDeviceCapabilitiesResponse(
const V1_6::RadioResponseInfo& info, bool modemReducedFeatureSet1) {
LOG_CALL << info.serial;
- mCallback->getHalDeviceCapabilitiesResponse(toAidl(info), modemReducedFeatureSet1);
+ respond()->getHalDeviceCapabilitiesResponse(toAidl(info), modemReducedFeatureSet1);
return {};
};
diff --git a/radio/aidl/compat/libradiocompat/data/RadioData.cpp b/radio/aidl/compat/libradiocompat/data/RadioData.cpp
index fdb1273..d2f3687 100644
--- a/radio/aidl/compat/libradiocompat/data/RadioData.cpp
+++ b/radio/aidl/compat/libradiocompat/data/RadioData.cpp
@@ -31,12 +31,16 @@
namespace aidlCommon = ::aidl::android::hardware::radio;
constexpr auto ok = &ScopedAStatus::ok;
+std::shared_ptr<aidl::IRadioDataResponse> RadioData::respond() {
+ return mCallbackManager->response().dataCb();
+}
+
ScopedAStatus RadioData::allocatePduSessionId(int32_t serial) {
LOG_CALL << serial;
if (mHal1_6) {
mHal1_6->allocatePduSessionId(serial);
} else {
- respond().allocatePduSessionIdResponse(notSupported(serial), 0);
+ respond()->allocatePduSessionIdResponse(notSupported(serial), 0);
}
return ok();
}
@@ -46,7 +50,7 @@
if (mHal1_6) {
mHal1_6->cancelHandover(serial, callId);
} else {
- respond().cancelHandoverResponse(notSupported(serial));
+ respond()->cancelHandoverResponse(notSupported(serial));
}
return ok();
}
@@ -60,7 +64,11 @@
ScopedAStatus RadioData::getDataCallList(int32_t serial) {
LOG_CALL << serial;
- mHal1_5->getDataCallList(serial);
+ if (mHal1_6) {
+ mHal1_6->getDataCallList_1_6(serial);
+ } else {
+ mHal1_5->getDataCallList(serial);
+ }
return ok();
}
@@ -69,7 +77,7 @@
if (mHal1_6) {
mHal1_6->getSlicingConfig(serial);
} else {
- respond().getSlicingConfigResponse(notSupported(serial), {});
+ respond()->getSlicingConfigResponse(notSupported(serial), {});
}
return ok();
}
@@ -79,7 +87,7 @@
if (mHal1_6) {
mHal1_6->releasePduSessionId(serial, id);
} else {
- respond().releasePduSessionIdResponse(notSupported(serial));
+ respond()->releasePduSessionIdResponse(notSupported(serial));
}
return ok();
}
@@ -109,7 +117,7 @@
if (mHal1_6) {
mHal1_6->setDataThrottling(serial, V1_6::DataThrottlingAction(dta), completionDurationMs);
} else {
- respond().setDataThrottlingResponse(notSupported(serial));
+ respond()->setDataThrottlingResponse(notSupported(serial));
}
return ok();
}
@@ -121,16 +129,10 @@
}
ScopedAStatus RadioData::setResponseFunctions(
- const std::shared_ptr<aidl::IRadioDataResponse>& dataResponse,
- const std::shared_ptr<aidl::IRadioDataIndication>& dataIndication) {
- LOG_CALL << dataResponse << ' ' << dataIndication;
-
- CHECK(dataResponse);
- CHECK(dataIndication);
-
- mRadioResponse->setResponseFunction(dataResponse);
- mRadioIndication->setResponseFunction(dataIndication);
-
+ const std::shared_ptr<aidl::IRadioDataResponse>& response,
+ const std::shared_ptr<aidl::IRadioDataIndication>& indication) {
+ LOG_CALL << response << ' ' << indication;
+ mCallbackManager->setResponseFunctions(response, indication);
return ok();
}
@@ -139,14 +141,15 @@
const aidl::DataProfileInfo& dataProfileInfo, bool roamingAllowed,
aidl::DataRequestReason reason, const std::vector<aidl::LinkAddress>& addresses,
const std::vector<std::string>& dnses, int32_t pduSessId,
- const std::optional<aidl::SliceInfo>& sliceInfo,
- const std::optional<aidl::TrafficDescriptor>& trDesc, bool matchAllRuleAllowed) {
+ const std::optional<aidl::SliceInfo>& sliceInfo, bool matchAllRuleAllowed) {
if (mHal1_6) {
mHal1_6->setupDataCall_1_6( //
serial, V1_5::AccessNetwork(accessNetwork), toHidl(dataProfileInfo), roamingAllowed,
V1_2::DataRequestReason(reason), toHidl(addresses), toHidl(dnses), pduSessId,
toHidl<V1_6::OptionalSliceInfo>(sliceInfo),
- toHidl<V1_6::OptionalTrafficDescriptor>(trDesc), matchAllRuleAllowed);
+ toHidl<V1_6::OptionalTrafficDescriptor>(dataProfileInfo.trafficDescriptor),
+ matchAllRuleAllowed);
+ mContext->addDataProfile(dataProfileInfo);
} else {
mHal1_5->setupDataCall_1_5( //
serial, V1_5::AccessNetwork(accessNetwork), toHidl(dataProfileInfo), roamingAllowed,
@@ -160,7 +163,7 @@
if (mHal1_6) {
mHal1_6->startHandover(serial, callId);
} else {
- respond().startHandoverResponse(notSupported(serial));
+ respond()->startHandoverResponse(notSupported(serial));
}
return ok();
}
diff --git a/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp b/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp
index f51d1a8..1d367d2 100644
--- a/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp
+++ b/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp
@@ -29,10 +29,13 @@
namespace aidl = ::aidl::android::hardware::radio::data;
void RadioIndication::setResponseFunction(std::shared_ptr<aidl::IRadioDataIndication> dataCb) {
- CHECK(dataCb);
mDataCb = dataCb;
}
+std::shared_ptr<aidl::IRadioDataIndication> RadioIndication::dataCb() {
+ return mDataCb.get();
+}
+
Return<void> RadioIndication::dataCallListChanged(V1_0::RadioIndicationType type,
const hidl_vec<V1_0::SetupDataCallResult>&) {
LOG_CALL << type;
@@ -50,40 +53,35 @@
Return<void> RadioIndication::dataCallListChanged_1_5(
V1_0::RadioIndicationType type, const hidl_vec<V1_5::SetupDataCallResult>& dcList) {
LOG_CALL << type;
- CHECK_CB(mDataCb);
- mDataCb->dataCallListChanged(toAidl(type), toAidl(dcList));
+ dataCb()->dataCallListChanged(toAidl(type), toAidl(dcList));
return {};
}
Return<void> RadioIndication::dataCallListChanged_1_6(
V1_0::RadioIndicationType type, const hidl_vec<V1_6::SetupDataCallResult>& dcList) {
LOG_CALL << type;
- CHECK_CB(mDataCb);
- mDataCb->dataCallListChanged(toAidl(type), toAidl(dcList));
+ dataCb()->dataCallListChanged(toAidl(type), toAidl(dcList));
return {};
}
Return<void> RadioIndication::keepaliveStatus(V1_0::RadioIndicationType type,
const V1_1::KeepaliveStatus& status) {
LOG_CALL << type;
- CHECK_CB(mDataCb);
- mDataCb->keepaliveStatus(toAidl(type), toAidl(status));
+ dataCb()->keepaliveStatus(toAidl(type), toAidl(status));
return {};
}
Return<void> RadioIndication::pcoData(V1_0::RadioIndicationType type,
const V1_0::PcoDataInfo& pco) {
LOG_CALL << type;
- CHECK_CB(mDataCb);
- mDataCb->pcoData(toAidl(type), toAidl(pco));
+ dataCb()->pcoData(toAidl(type), toAidl(pco));
return {};
}
Return<void> RadioIndication::unthrottleApn(V1_0::RadioIndicationType type,
const hidl_string& apn) {
LOG_CALL << type;
- CHECK_CB(mDataCb);
- mDataCb->unthrottleApn(toAidl(type), apn);
+ dataCb()->unthrottleApn(toAidl(type), mContext->getDataProfile(apn));
return {};
}
diff --git a/radio/aidl/compat/libradiocompat/data/RadioResponse-data.cpp b/radio/aidl/compat/libradiocompat/data/RadioResponse-data.cpp
index 171f692..0bfa2df 100644
--- a/radio/aidl/compat/libradiocompat/data/RadioResponse-data.cpp
+++ b/radio/aidl/compat/libradiocompat/data/RadioResponse-data.cpp
@@ -29,29 +29,29 @@
namespace aidl = ::aidl::android::hardware::radio::data;
void RadioResponse::setResponseFunction(std::shared_ptr<aidl::IRadioDataResponse> dataCb) {
- CHECK(dataCb);
mDataCb = dataCb;
}
+std::shared_ptr<aidl::IRadioDataResponse> RadioResponse::dataCb() {
+ return mDataCb.get();
+}
+
Return<void> RadioResponse::allocatePduSessionIdResponse(const V1_6::RadioResponseInfo& info,
int32_t id) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->allocatePduSessionIdResponse(toAidl(info), id);
+ dataCb()->allocatePduSessionIdResponse(toAidl(info), id);
return {};
}
Return<void> RadioResponse::cancelHandoverResponse(const V1_6::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->cancelHandoverResponse(toAidl(info));
+ dataCb()->cancelHandoverResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::deactivateDataCallResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->deactivateDataCallResponse(toAidl(info));
+ dataCb()->deactivateDataCallResponse(toAidl(info));
return {};
}
@@ -73,8 +73,7 @@
const V1_0::RadioResponseInfo& info,
const hidl_vec<V1_5::SetupDataCallResult>& dcResponse) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->getDataCallListResponse(toAidl(info), toAidl(dcResponse));
+ dataCb()->getDataCallListResponse(toAidl(info), toAidl(dcResponse));
return {};
}
@@ -82,65 +81,56 @@
const V1_6::RadioResponseInfo& info,
const hidl_vec<V1_6::SetupDataCallResult>& dcResponse) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->getDataCallListResponse(toAidl(info), toAidl(dcResponse));
+ dataCb()->getDataCallListResponse(toAidl(info), toAidl(dcResponse));
return {};
}
Return<void> RadioResponse::getSlicingConfigResponse(const V1_6::RadioResponseInfo& info,
const V1_6::SlicingConfig& slicingConfig) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->getSlicingConfigResponse(toAidl(info), toAidl(slicingConfig));
+ dataCb()->getSlicingConfigResponse(toAidl(info), toAidl(slicingConfig));
return {};
}
Return<void> RadioResponse::releasePduSessionIdResponse(const V1_6::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->releasePduSessionIdResponse(toAidl(info));
+ dataCb()->releasePduSessionIdResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setDataAllowedResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->setDataAllowedResponse(toAidl(info));
+ dataCb()->setDataAllowedResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setDataProfileResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->setDataProfileResponse(toAidl(info));
+ dataCb()->setDataProfileResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setDataProfileResponse_1_5(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->setDataProfileResponse(toAidl(info));
+ dataCb()->setDataProfileResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setDataThrottlingResponse(const V1_6::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->setDataThrottlingResponse(toAidl(info));
+ dataCb()->setDataThrottlingResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setInitialAttachApnResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->setInitialAttachApnResponse(toAidl(info));
+ dataCb()->setInitialAttachApnResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setInitialAttachApnResponse_1_5(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->setInitialAttachApnResponse(toAidl(info));
+ dataCb()->setInitialAttachApnResponse(toAidl(info));
return {};
}
@@ -161,38 +151,33 @@
Return<void> RadioResponse::setupDataCallResponse_1_5(const V1_0::RadioResponseInfo& info,
const V1_5::SetupDataCallResult& dcResponse) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->setupDataCallResponse(toAidl(info), toAidl(dcResponse));
+ dataCb()->setupDataCallResponse(toAidl(info), toAidl(dcResponse));
return {};
}
Return<void> RadioResponse::setupDataCallResponse_1_6(const V1_6::RadioResponseInfo& info,
const V1_6::SetupDataCallResult& dcResponse) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->setupDataCallResponse(toAidl(info), toAidl(dcResponse));
+ dataCb()->setupDataCallResponse(toAidl(info), toAidl(dcResponse));
return {};
}
Return<void> RadioResponse::startHandoverResponse(const V1_6::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->startHandoverResponse(toAidl(info));
+ dataCb()->startHandoverResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::startKeepaliveResponse(const V1_0::RadioResponseInfo& info,
const V1_1::KeepaliveStatus& status) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->startKeepaliveResponse(toAidl(info), toAidl(status));
+ dataCb()->startKeepaliveResponse(toAidl(info), toAidl(status));
return {};
}
Return<void> RadioResponse::stopKeepaliveResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mDataCb);
- mDataCb->stopKeepaliveResponse(toAidl(info));
+ dataCb()->stopKeepaliveResponse(toAidl(info));
return {};
}
diff --git a/radio/aidl/compat/libradiocompat/debug.h b/radio/aidl/compat/libradiocompat/debug.h
index 4158059..cb773bf 100644
--- a/radio/aidl/compat/libradiocompat/debug.h
+++ b/radio/aidl/compat/libradiocompat/debug.h
@@ -26,12 +26,6 @@
#define LOG_CALL \
if constexpr (debug::kSuperVerbose) LOG(VERBOSE) << (RADIO_MODULE ".") << __func__ << ' '
-#define CHECK_CB(field) \
- if (!field) { \
- LOG(WARNING) << "Callback not set"; \
- return {}; \
- }
-
} // namespace debug
inline std::ostream& operator<<(std::ostream& os, const V1_0::RadioIndicationType& type) {
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/CallbackManager.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/CallbackManager.h
new file mode 100644
index 0000000..f1a7b49
--- /dev/null
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/CallbackManager.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+#pragma once
+
+#include "DriverContext.h"
+#include "RadioIndication.h"
+#include "RadioResponse.h"
+
+#include <android-base/logging.h>
+#include <android/hardware/radio/1.6/IRadio.h>
+
+#include <thread>
+
+namespace android::hardware::radio::compat {
+
+class CallbackManager {
+ sp<V1_5::IRadio> mHidlHal;
+ sp<RadioResponse> mRadioResponse;
+ sp<RadioIndication> mRadioIndication;
+
+ std::thread mDelayedSetterThread;
+ std::mutex mDelayedSetterGuard;
+ std::optional<std::chrono::time_point<std::chrono::steady_clock>> mDelayedSetterDeadline
+ GUARDED_BY(mDelayedSetterGuard);
+ std::condition_variable mDelayedSetterCv GUARDED_BY(mDelayedSetterGuard);
+ bool mDestroy GUARDED_BY(mDelayedSetterGuard) = false;
+
+ void setResponseFunctionsDelayed();
+ void delayedSetterThread();
+
+ public:
+ CallbackManager(std::shared_ptr<DriverContext> context, sp<V1_5::IRadio> hidlHal);
+ ~CallbackManager();
+
+ RadioResponse& response() const;
+
+ template <typename ResponseType, typename IndicationType>
+ void setResponseFunctions(const std::shared_ptr<ResponseType>& response,
+ const std::shared_ptr<IndicationType>& indication) {
+ CHECK(response);
+ CHECK(indication);
+
+ mRadioResponse->setResponseFunction(response);
+ mRadioIndication->setResponseFunction(indication);
+ setResponseFunctionsDelayed();
+ }
+};
+
+} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/DriverContext.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/DriverContext.h
new file mode 100644
index 0000000..6833aca
--- /dev/null
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/DriverContext.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+#pragma once
+
+#include <aidl/android/hardware/radio/data/DataProfileInfo.h>
+
+#include <map>
+
+namespace android::hardware::radio::compat {
+
+class DriverContext {
+ std::map<std::string, ::aidl::android::hardware::radio::data::DataProfileInfo> mDataProfiles;
+
+ public:
+ void addDataProfile(const ::aidl::android::hardware::radio::data::DataProfileInfo& profile);
+ ::aidl::android::hardware::radio::data::DataProfileInfo getDataProfile(const std::string& apn);
+};
+
+} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/GuaranteedCallback.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/GuaranteedCallback.h
new file mode 100644
index 0000000..0b6ee11
--- /dev/null
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/GuaranteedCallback.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+#pragma once
+
+#include <android-base/logging.h>
+#include <android/binder_interface_utils.h>
+#include <utils/Mutex.h>
+
+namespace android::hardware::radio::compat {
+
+template <typename Interface, typename DefaultImplementation, bool isIndication = false>
+class GuaranteedCallback {
+ mutable std::mutex mCallbackGuard;
+ std::shared_ptr<Interface> mCallback GUARDED_BY(mCallbackGuard);
+
+ public:
+ GuaranteedCallback<Interface, DefaultImplementation, isIndication>& operator=(
+ const std::shared_ptr<Interface>& callback) {
+ CHECK(callback);
+ const std::lock_guard<std::mutex> lock(mCallbackGuard);
+ mCallback = callback;
+ return *this;
+ }
+
+ std::shared_ptr<Interface> get() {
+ if (mCallback) return mCallback;
+ const std::lock_guard<std::mutex> lock(mCallbackGuard);
+ if (mCallback) return mCallback;
+
+ LOG(isIndication ? WARNING : ERROR) << "Callback is not set";
+ return mCallback = ndk::SharedRefBase::make<DefaultImplementation>();
+ }
+
+ operator bool() const { return mCallback != nullptr; }
+};
+
+} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h
index a412c34..eb22fff 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h
@@ -15,8 +15,8 @@
*/
#pragma once
-#include "RadioIndication.h"
-#include "RadioResponse.h"
+#include "CallbackManager.h"
+#include "DriverContext.h"
#include <android/hardware/radio/1.6/IRadio.h>
@@ -24,17 +24,16 @@
class RadioCompatBase {
protected:
+ std::shared_ptr<DriverContext> mContext;
+
sp<V1_5::IRadio> mHal1_5;
sp<V1_6::IRadio> mHal1_6;
- sp<RadioResponse> mRadioResponse;
- sp<RadioIndication> mRadioIndication;
-
- V1_6::IRadioResponse& respond();
+ std::shared_ptr<CallbackManager> mCallbackManager;
public:
- RadioCompatBase(sp<V1_5::IRadio> hidlHal, sp<RadioResponse> radioResponse,
- sp<RadioIndication> radioIndication);
+ RadioCompatBase(std::shared_ptr<DriverContext> context, sp<V1_5::IRadio> hidlHal,
+ std::shared_ptr<CallbackManager> cbMgr);
};
} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h
index 31ad207..bbfff61 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h
@@ -15,6 +15,9 @@
*/
#pragma once
+#include "RadioConfigIndication.h"
+#include "RadioConfigResponse.h"
+
#include <aidl/android/hardware/radio/config/BnRadioConfig.h>
#include <android/hardware/radio/config/1.2/IRadioConfigIndication.h>
#include <android/hardware/radio/config/1.3/IRadioConfig.h>
@@ -30,11 +33,13 @@
* fetch source implementation and publish resulting HAL instance.
*/
class RadioConfig : public aidl::android::hardware::radio::config::BnRadioConfig {
- sp<config::V1_1::IRadioConfig> mHal1_1;
- sp<config::V1_3::IRadioConfig> mHal1_3;
+ const sp<config::V1_1::IRadioConfig> mHal1_1;
+ const sp<config::V1_3::IRadioConfig> mHal1_3;
- sp<config::V1_3::IRadioConfigResponse> mRadioConfigResponse;
- sp<config::V1_2::IRadioConfigIndication> mRadioConfigIndication;
+ const sp<RadioConfigResponse> mRadioConfigResponse;
+ const sp<RadioConfigIndication> mRadioConfigIndication;
+
+ std::shared_ptr<::aidl::android::hardware::radio::config::IRadioConfigResponse> respond();
::ndk::ScopedAStatus getHalDeviceCapabilities(int32_t serial) override;
::ndk::ScopedAStatus getNumOfLiveModems(int32_t serial) override;
@@ -52,8 +57,6 @@
const std::vector<aidl::android::hardware::radio::config::SlotPortMapping>& slotMap)
override;
- config::V1_3::IRadioConfigResponse& respond();
-
public:
/**
* Constructs AIDL IRadioConfig instance wrapping existing HIDL IRadioConfig instance.
diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfigIndication.h
similarity index 82%
rename from radio/aidl/compat/libradiocompat/config/RadioConfigIndication.h
rename to radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfigIndication.h
index 3d8d971..d256a87 100644
--- a/radio/aidl/compat/libradiocompat/config/RadioConfigIndication.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfigIndication.h
@@ -15,13 +15,17 @@
*/
#pragma once
+#include "GuaranteedCallback.h"
+
#include <aidl/android/hardware/radio/config/IRadioConfigIndication.h>
#include <android/hardware/radio/config/1.2/IRadioConfigIndication.h>
namespace android::hardware::radio::compat {
class RadioConfigIndication : public config::V1_2::IRadioConfigIndication {
- std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfigIndication> mCallback;
+ GuaranteedCallback<aidl::android::hardware::radio::config::IRadioConfigIndication,
+ aidl::android::hardware::radio::config::IRadioConfigIndicationDefault, true>
+ mCallback;
Return<void> simSlotsStatusChanged(
V1_0::RadioIndicationType type,
@@ -31,8 +35,10 @@
const hidl_vec<config::V1_2::SimSlotStatus>& slotStatus) override;
public:
- RadioConfigIndication(
+ void setResponseFunction(
std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfigIndication> cb);
+
+ std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfigIndication> indicate();
};
} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfigResponse.h
similarity index 88%
rename from radio/aidl/compat/libradiocompat/config/RadioConfigResponse.h
rename to radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfigResponse.h
index 1461dd2..dc86da2 100644
--- a/radio/aidl/compat/libradiocompat/config/RadioConfigResponse.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfigResponse.h
@@ -15,13 +15,17 @@
*/
#pragma once
+#include "GuaranteedCallback.h"
+
#include <aidl/android/hardware/radio/config/IRadioConfigResponse.h>
#include <android/hardware/radio/config/1.3/IRadioConfigResponse.h>
namespace android::hardware::radio::compat {
class RadioConfigResponse : public config::V1_3::IRadioConfigResponse {
- std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfigResponse> mCallback;
+ GuaranteedCallback<aidl::android::hardware::radio::config::IRadioConfigResponse,
+ aidl::android::hardware::radio::config::IRadioConfigResponseDefault>
+ mCallback;
Return<void> getSimSlotsStatusResponse(
const V1_0::RadioResponseInfo& info,
@@ -41,8 +45,10 @@
bool modemReducedFeatureSet1) override;
public:
- RadioConfigResponse(
+ void setResponseFunction(
std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfigResponse> callback);
+
+ std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfigResponse> respond();
};
} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h
index 900a669..c617ec2 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h
@@ -22,6 +22,8 @@
namespace android::hardware::radio::compat {
class RadioData : public RadioCompatBase, public aidl::android::hardware::radio::data::BnRadioData {
+ std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> respond();
+
::ndk::ScopedAStatus allocatePduSessionId(int32_t serial) override;
::ndk::ScopedAStatus cancelHandover(int32_t serial, int32_t callId) override;
::ndk::ScopedAStatus deactivateDataCall(
@@ -55,7 +57,6 @@
const std::vector<::aidl::android::hardware::radio::data::LinkAddress>& addresses,
const std::vector<std::string>& dnses, int32_t pduSessionId,
const std::optional<::aidl::android::hardware::radio::data::SliceInfo>& sliceInfo,
- const std::optional<::aidl::android::hardware::radio::data::TrafficDescriptor>& trDescr,
bool matchAllRuleAllowed) override;
::ndk::ScopedAStatus startHandover(int32_t serial, int32_t callId) override;
::ndk::ScopedAStatus startKeepalive(
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h
index 20e0973..c668af5 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h
@@ -15,6 +15,9 @@
*/
#pragma once
+#include "DriverContext.h"
+#include "GuaranteedCallback.h"
+
#include <aidl/android/hardware/radio/data/IRadioDataIndication.h>
#include <aidl/android/hardware/radio/messaging/IRadioMessagingIndication.h>
#include <aidl/android/hardware/radio/modem/IRadioModemIndication.h>
@@ -26,13 +29,32 @@
namespace android::hardware::radio::compat {
class RadioIndication : public V1_6::IRadioIndication {
- std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> mDataCb;
- std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication>
+ std::shared_ptr<DriverContext> mContext;
+
+ GuaranteedCallback< //
+ ::aidl::android::hardware::radio::data::IRadioDataIndication,
+ ::aidl::android::hardware::radio::data::IRadioDataIndicationDefault, true>
+ mDataCb;
+ GuaranteedCallback< //
+ ::aidl::android::hardware::radio::messaging::IRadioMessagingIndication,
+ ::aidl::android::hardware::radio::messaging::IRadioMessagingIndicationDefault, true>
mMessagingCb;
- std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemIndication> mModemCb;
- std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkIndication> mNetworkCb;
- std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> mSimCb;
- std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> mVoiceCb;
+ GuaranteedCallback< //
+ ::aidl::android::hardware::radio::modem::IRadioModemIndication,
+ ::aidl::android::hardware::radio::modem::IRadioModemIndicationDefault, true>
+ mModemCb;
+ GuaranteedCallback< //
+ ::aidl::android::hardware::radio::network::IRadioNetworkIndication,
+ ::aidl::android::hardware::radio::network::IRadioNetworkIndicationDefault, true>
+ mNetworkCb;
+ GuaranteedCallback< //
+ ::aidl::android::hardware::radio::sim::IRadioSimIndication,
+ ::aidl::android::hardware::radio::sim::IRadioSimIndicationDefault, true>
+ mSimCb;
+ GuaranteedCallback< //
+ ::aidl::android::hardware::radio::voice::IRadioVoiceIndication,
+ ::aidl::android::hardware::radio::voice::IRadioVoiceIndicationDefault, true>
+ mVoiceCb;
// IRadioIndication @ 1.0
Return<void> radioStateChanged(V1_0::RadioIndicationType type,
@@ -181,6 +203,8 @@
const hidl_vec<V1_6::PhonebookRecordInfo>& records) override;
public:
+ RadioIndication(std::shared_ptr<DriverContext> context);
+
void setResponseFunction(
std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> dataCb);
void setResponseFunction(
@@ -194,6 +218,14 @@
std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> simCb);
void setResponseFunction(
std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> voicCb);
+
+ std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> dataCb();
+ std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication>
+ messagingCb();
+ std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemIndication> modemCb();
+ std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkIndication> networkCb();
+ std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> simCb();
+ std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> voiceCb();
};
} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h
index 0cd3381..419e9fb 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioMessaging.h
@@ -23,6 +23,8 @@
class RadioMessaging : public RadioCompatBase,
public aidl::android::hardware::radio::messaging::BnRadioMessaging {
+ std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> respond();
+
::ndk::ScopedAStatus acknowledgeIncomingGsmSmsWithPdu(int32_t serial, bool success,
const std::string& ackPdu) override;
::ndk::ScopedAStatus acknowledgeLastIncomingCdmaSms(
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h
index 666ff47..fdca124 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioModem.h
@@ -23,6 +23,8 @@
class RadioModem : public RadioCompatBase,
public aidl::android::hardware::radio::modem::BnRadioModem {
+ std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse> respond();
+
::ndk::ScopedAStatus enableModem(int32_t serial, bool on) override;
::ndk::ScopedAStatus getBasebandVersion(int32_t serial) override;
::ndk::ScopedAStatus getDeviceIdentity(int32_t serial) override;
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h
index c776fd1..ec76300 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h
@@ -23,6 +23,8 @@
class RadioNetwork : public RadioCompatBase,
public aidl::android::hardware::radio::network::BnRadioNetwork {
+ std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> respond();
+
::ndk::ScopedAStatus getAllowedNetworkTypesBitmap(int32_t serial) override;
::ndk::ScopedAStatus getAvailableBandModes(int32_t serial) override;
::ndk::ScopedAStatus getAvailableNetworks(int32_t serial) override;
@@ -88,6 +90,10 @@
::ndk::ScopedAStatus stopNetworkScan(int32_t serial) override;
::ndk::ScopedAStatus supplyNetworkDepersonalization(int32_t serial,
const std::string& netPin) override;
+ ::ndk::ScopedAStatus setUsageSetting(
+ int32_t serial,
+ ::aidl::android::hardware::radio::network::UsageSetting usageSetting) override;
+ ::ndk::ScopedAStatus getUsageSetting(int32_t serial) override;
public:
using RadioCompatBase::RadioCompatBase;
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h
index 5db963f..1f82dd1 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h
@@ -15,6 +15,9 @@
*/
#pragma once
+#include "DriverContext.h"
+#include "GuaranteedCallback.h"
+
#include <aidl/android/hardware/radio/data/IRadioDataResponse.h>
#include <aidl/android/hardware/radio/messaging/IRadioMessagingResponse.h>
#include <aidl/android/hardware/radio/modem/IRadioModemResponse.h>
@@ -26,13 +29,26 @@
namespace android::hardware::radio::compat {
class RadioResponse : public V1_6::IRadioResponse {
- std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> mDataCb;
- std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse>
+ std::shared_ptr<DriverContext> mContext;
+
+ GuaranteedCallback<::aidl::android::hardware::radio::data::IRadioDataResponse,
+ ::aidl::android::hardware::radio::data::IRadioDataResponseDefault>
+ mDataCb;
+ GuaranteedCallback<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse,
+ ::aidl::android::hardware::radio::messaging::IRadioMessagingResponseDefault>
mMessagingCb;
- std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse> mModemCb;
- std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> mNetworkCb;
- std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> mSimCb;
- std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> mVoiceCb;
+ GuaranteedCallback<::aidl::android::hardware::radio::modem::IRadioModemResponse,
+ ::aidl::android::hardware::radio::modem::IRadioModemResponseDefault>
+ mModemCb;
+ GuaranteedCallback<::aidl::android::hardware::radio::network::IRadioNetworkResponse,
+ ::aidl::android::hardware::radio::network::IRadioNetworkResponseDefault>
+ mNetworkCb;
+ GuaranteedCallback<::aidl::android::hardware::radio::sim::IRadioSimResponse,
+ ::aidl::android::hardware::radio::sim::IRadioSimResponseDefault>
+ mSimCb;
+ GuaranteedCallback<::aidl::android::hardware::radio::voice::IRadioVoiceResponse,
+ ::aidl::android::hardware::radio::voice::IRadioVoiceResponseDefault>
+ mVoiceCb;
// IRadioResponse @ 1.0
Return<void> getIccCardStatusResponse(const V1_0::RadioResponseInfo& info,
@@ -409,6 +425,8 @@
int32_t updatedRecordIndex) override;
public:
+ RadioResponse(std::shared_ptr<DriverContext> context);
+
void setResponseFunction(
std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> dataCb);
void setResponseFunction(
@@ -422,6 +440,14 @@
std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> simCb);
void setResponseFunction(
std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> voiceCb);
+
+ std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> dataCb();
+ std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse>
+ messagingCb();
+ std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse> modemCb();
+ std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> networkCb();
+ std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> simCb();
+ std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> voiceCb();
};
} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h
index a6b77fd..84bb68b 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSim.h
@@ -22,6 +22,8 @@
namespace android::hardware::radio::compat {
class RadioSim : public RadioCompatBase, public aidl::android::hardware::radio::sim::BnRadioSim {
+ std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> respond();
+
::ndk::ScopedAStatus areUiccApplicationsEnabled(int32_t serial) override;
::ndk::ScopedAStatus changeIccPin2ForApp(int32_t serial, const std::string& oldPin2,
const std::string& newPin2,
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h
index 5bf93e0..5839e3a 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioVoice.h
@@ -23,6 +23,8 @@
class RadioVoice : public RadioCompatBase,
public aidl::android::hardware::radio::voice::BnRadioVoice {
+ std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> respond();
+
::ndk::ScopedAStatus acceptCall(int32_t serial) override;
::ndk::ScopedAStatus conference(int32_t serial) override;
::ndk::ScopedAStatus dial(
diff --git a/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp b/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp
index c7342b1..e5c33b3 100644
--- a/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp
+++ b/radio/aidl/compat/libradiocompat/messaging/RadioIndication-messaging.cpp
@@ -27,67 +27,62 @@
namespace aidl = ::aidl::android::hardware::radio::messaging;
void RadioIndication::setResponseFunction(std::shared_ptr<aidl::IRadioMessagingIndication> rmiCb) {
- CHECK(rmiCb);
mMessagingCb = rmiCb;
}
+std::shared_ptr<aidl::IRadioMessagingIndication> RadioIndication::messagingCb() {
+ return mMessagingCb.get();
+}
+
Return<void> RadioIndication::cdmaNewSms(V1_0::RadioIndicationType type,
const V1_0::CdmaSmsMessage& msg) {
LOG_CALL << type;
- CHECK_CB(mMessagingCb);
- mMessagingCb->cdmaNewSms(toAidl(type), toAidl(msg));
+ messagingCb()->cdmaNewSms(toAidl(type), toAidl(msg));
return {};
}
Return<void> RadioIndication::cdmaRuimSmsStorageFull(V1_0::RadioIndicationType type) {
LOG_CALL << type;
- CHECK_CB(mMessagingCb);
- mMessagingCb->cdmaRuimSmsStorageFull(toAidl(type));
+ messagingCb()->cdmaRuimSmsStorageFull(toAidl(type));
return {};
}
Return<void> RadioIndication::newBroadcastSms(V1_0::RadioIndicationType type,
const hidl_vec<uint8_t>& data) {
LOG_CALL << type;
- CHECK_CB(mMessagingCb);
- mMessagingCb->newBroadcastSms(toAidl(type), data);
+ messagingCb()->newBroadcastSms(toAidl(type), data);
return {};
}
Return<void> RadioIndication::newSms(V1_0::RadioIndicationType type, const hidl_vec<uint8_t>& pdu) {
LOG_CALL << type;
- CHECK_CB(mMessagingCb);
- mMessagingCb->newSms(toAidl(type), pdu);
+ messagingCb()->newSms(toAidl(type), pdu);
return {};
}
Return<void> RadioIndication::newSmsOnSim(V1_0::RadioIndicationType type, int32_t recordNumber) {
LOG_CALL << type;
- CHECK_CB(mMessagingCb);
- mMessagingCb->newSmsOnSim(toAidl(type), recordNumber);
+ messagingCb()->newSmsOnSim(toAidl(type), recordNumber);
return {};
}
Return<void> RadioIndication::newSmsStatusReport(V1_0::RadioIndicationType type,
const hidl_vec<uint8_t>& pdu) {
LOG_CALL << type;
- CHECK_CB(mMessagingCb);
- mMessagingCb->newSmsStatusReport(toAidl(type), pdu);
+ messagingCb()->newSmsStatusReport(toAidl(type), pdu);
return {};
}
Return<void> RadioIndication::onUssd(V1_0::RadioIndicationType type, V1_0::UssdModeType modeType,
const hidl_string& msg) {
LOG_CALL << type;
- CHECK_CB(mMessagingCb);
- mMessagingCb->onUssd(toAidl(type), aidl::UssdModeType(modeType), msg);
+ messagingCb()->onUssd(toAidl(type), aidl::UssdModeType(modeType), msg);
return {};
}
Return<void> RadioIndication::simSmsStorageFull(V1_0::RadioIndicationType type) {
LOG_CALL << type;
- CHECK_CB(mMessagingCb);
- mMessagingCb->simSmsStorageFull(toAidl(type));
+ messagingCb()->simSmsStorageFull(toAidl(type));
return {};
}
diff --git a/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp b/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp
index c1a82b5..4d94e17 100644
--- a/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp
+++ b/radio/aidl/compat/libradiocompat/messaging/RadioMessaging.cpp
@@ -29,6 +29,10 @@
namespace aidl = ::aidl::android::hardware::radio::messaging;
constexpr auto ok = &ScopedAStatus::ok;
+std::shared_ptr<aidl::IRadioMessagingResponse> RadioMessaging::respond() {
+ return mCallbackManager->response().messagingCb();
+}
+
ScopedAStatus RadioMessaging::acknowledgeIncomingGsmSmsWithPdu( //
int32_t serial, bool success, const std::string& ackPdu) {
LOG_CALL << serial << ' ' << success << ' ' << ackPdu;
@@ -100,13 +104,21 @@
ScopedAStatus RadioMessaging::sendCdmaSms(int32_t serial, const aidl::CdmaSmsMessage& sms) {
LOG_CALL << serial;
- mHal1_5->sendCdmaSms(serial, toHidl(sms));
+ if (mHal1_6) {
+ mHal1_6->sendCdmaSms_1_6(serial, toHidl(sms));
+ } else {
+ mHal1_5->sendCdmaSms(serial, toHidl(sms));
+ }
return ok();
}
ScopedAStatus RadioMessaging::sendCdmaSmsExpectMore(int32_t serial, const aidl::CdmaSmsMessage& m) {
LOG_CALL << serial;
- mHal1_5->sendCdmaSmsExpectMore(serial, toHidl(m));
+ if (mHal1_6) {
+ mHal1_6->sendCdmaSmsExpectMore_1_6(serial, toHidl(m));
+ } else {
+ mHal1_5->sendCdmaSmsExpectMore(serial, toHidl(m));
+ }
return ok();
}
@@ -118,13 +130,21 @@
ScopedAStatus RadioMessaging::sendSms(int32_t serial, const aidl::GsmSmsMessage& message) {
LOG_CALL << serial;
- mHal1_5->sendSms(serial, toHidl(message));
+ if (mHal1_6) {
+ mHal1_6->sendSms_1_6(serial, toHidl(message));
+ } else {
+ mHal1_5->sendSms(serial, toHidl(message));
+ }
return ok();
}
ScopedAStatus RadioMessaging::sendSmsExpectMore(int32_t serial, const aidl::GsmSmsMessage& msg) {
LOG_CALL << serial;
- mHal1_5->sendSMSExpectMore(serial, toHidl(msg));
+ if (mHal1_6) {
+ mHal1_6->sendSmsExpectMore_1_6(serial, toHidl(msg));
+ } else {
+ mHal1_5->sendSMSExpectMore(serial, toHidl(msg));
+ }
return ok();
}
@@ -161,16 +181,10 @@
}
ScopedAStatus RadioMessaging::setResponseFunctions(
- const std::shared_ptr<aidl::IRadioMessagingResponse>& messagingResponse,
- const std::shared_ptr<aidl::IRadioMessagingIndication>& messagingIndication) {
- LOG_CALL << messagingResponse << ' ' << messagingIndication;
-
- CHECK(messagingResponse);
- CHECK(messagingIndication);
-
- mRadioResponse->setResponseFunction(messagingResponse);
- mRadioIndication->setResponseFunction(messagingIndication);
-
+ const std::shared_ptr<aidl::IRadioMessagingResponse>& response,
+ const std::shared_ptr<aidl::IRadioMessagingIndication>& indication) {
+ LOG_CALL << response << ' ' << indication;
+ mCallbackManager->setResponseFunctions(response, indication);
return ok();
}
diff --git a/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp b/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp
index 379e463..24ad3d7 100644
--- a/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp
+++ b/radio/aidl/compat/libradiocompat/messaging/RadioResponse-messaging.cpp
@@ -29,52 +29,49 @@
namespace aidl = ::aidl::android::hardware::radio::messaging;
void RadioResponse::setResponseFunction(std::shared_ptr<aidl::IRadioMessagingResponse> rmrCb) {
- CHECK(rmrCb);
mMessagingCb = rmrCb;
}
+std::shared_ptr<aidl::IRadioMessagingResponse> RadioResponse::messagingCb() {
+ return mMessagingCb.get();
+}
+
Return<void> RadioResponse::acknowledgeIncomingGsmSmsWithPduResponse(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->acknowledgeIncomingGsmSmsWithPduResponse(toAidl(info));
+ messagingCb()->acknowledgeIncomingGsmSmsWithPduResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::acknowledgeLastIncomingCdmaSmsResponse(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->acknowledgeLastIncomingCdmaSmsResponse(toAidl(info));
+ messagingCb()->acknowledgeLastIncomingCdmaSmsResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::acknowledgeLastIncomingGsmSmsResponse(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->acknowledgeLastIncomingGsmSmsResponse(toAidl(info));
+ messagingCb()->acknowledgeLastIncomingGsmSmsResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::cancelPendingUssdResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->cancelPendingUssdResponse(toAidl(info));
+ messagingCb()->cancelPendingUssdResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::deleteSmsOnRuimResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->deleteSmsOnRuimResponse(toAidl(info));
+ messagingCb()->deleteSmsOnRuimResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::deleteSmsOnSimResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->deleteSmsOnSimResponse(toAidl(info));
+ messagingCb()->deleteSmsOnSimResponse(toAidl(info));
return {};
}
@@ -82,162 +79,141 @@
const V1_0::RadioResponseInfo& info,
const hidl_vec<V1_0::CdmaBroadcastSmsConfigInfo>& configs) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->getCdmaBroadcastConfigResponse(toAidl(info), toAidl(configs));
+ messagingCb()->getCdmaBroadcastConfigResponse(toAidl(info), toAidl(configs));
return {};
}
Return<void> RadioResponse::getGsmBroadcastConfigResponse(
const V1_0::RadioResponseInfo& info, const hidl_vec<V1_0::GsmBroadcastSmsConfigInfo>& cfg) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->getGsmBroadcastConfigResponse(toAidl(info), toAidl(cfg));
+ messagingCb()->getGsmBroadcastConfigResponse(toAidl(info), toAidl(cfg));
return {};
}
Return<void> RadioResponse::getSmscAddressResponse(const V1_0::RadioResponseInfo& info,
const hidl_string& smsc) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->getSmscAddressResponse(toAidl(info), smsc);
+ messagingCb()->getSmscAddressResponse(toAidl(info), smsc);
return {};
}
Return<void> RadioResponse::reportSmsMemoryStatusResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->reportSmsMemoryStatusResponse(toAidl(info));
+ messagingCb()->reportSmsMemoryStatusResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::sendCdmaSmsExpectMoreResponse(const V1_0::RadioResponseInfo& info,
const V1_0::SendSmsResult& sms) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->sendCdmaSmsExpectMoreResponse(toAidl(info), toAidl(sms));
+ messagingCb()->sendCdmaSmsExpectMoreResponse(toAidl(info), toAidl(sms));
return {};
}
Return<void> RadioResponse::sendCdmaSmsExpectMoreResponse_1_6(const V1_6::RadioResponseInfo& info,
const V1_0::SendSmsResult& sms) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->sendCdmaSmsExpectMoreResponse(toAidl(info), toAidl(sms));
+ messagingCb()->sendCdmaSmsExpectMoreResponse(toAidl(info), toAidl(sms));
return {};
}
Return<void> RadioResponse::sendCdmaSmsResponse(const V1_0::RadioResponseInfo& info,
const V1_0::SendSmsResult& sms) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->sendCdmaSmsResponse(toAidl(info), toAidl(sms));
+ messagingCb()->sendCdmaSmsResponse(toAidl(info), toAidl(sms));
return {};
}
Return<void> RadioResponse::sendCdmaSmsResponse_1_6(const V1_6::RadioResponseInfo& info,
const V1_0::SendSmsResult& sms) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->sendCdmaSmsResponse(toAidl(info), toAidl(sms));
+ messagingCb()->sendCdmaSmsResponse(toAidl(info), toAidl(sms));
return {};
}
Return<void> RadioResponse::sendImsSmsResponse(const V1_0::RadioResponseInfo& info,
const V1_0::SendSmsResult& sms) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->sendImsSmsResponse(toAidl(info), toAidl(sms));
+ messagingCb()->sendImsSmsResponse(toAidl(info), toAidl(sms));
return {};
}
Return<void> RadioResponse::sendSMSExpectMoreResponse(const V1_0::RadioResponseInfo& info,
const V1_0::SendSmsResult& sms) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->sendSmsExpectMoreResponse(toAidl(info), toAidl(sms));
+ messagingCb()->sendSmsExpectMoreResponse(toAidl(info), toAidl(sms));
return {};
}
Return<void> RadioResponse::sendSmsExpectMoreResponse_1_6(const V1_6::RadioResponseInfo& info,
const V1_0::SendSmsResult& sms) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->sendSmsExpectMoreResponse(toAidl(info), toAidl(sms));
+ messagingCb()->sendSmsExpectMoreResponse(toAidl(info), toAidl(sms));
return {};
}
Return<void> RadioResponse::sendSmsResponse(const V1_0::RadioResponseInfo& info,
const V1_0::SendSmsResult& sms) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->sendSmsResponse(toAidl(info), toAidl(sms));
+ messagingCb()->sendSmsResponse(toAidl(info), toAidl(sms));
return {};
}
Return<void> RadioResponse::sendSmsResponse_1_6(const V1_6::RadioResponseInfo& info,
const V1_0::SendSmsResult& sms) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->sendSmsResponse(toAidl(info), toAidl(sms));
+ messagingCb()->sendSmsResponse(toAidl(info), toAidl(sms));
return {};
}
Return<void> RadioResponse::sendUssdResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->sendUssdResponse(toAidl(info));
+ messagingCb()->sendUssdResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setCdmaBroadcastActivationResponse(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->setCdmaBroadcastActivationResponse(toAidl(info));
+ messagingCb()->setCdmaBroadcastActivationResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setCdmaBroadcastConfigResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->setCdmaBroadcastConfigResponse(toAidl(info));
+ messagingCb()->setCdmaBroadcastConfigResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setGsmBroadcastActivationResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->setGsmBroadcastActivationResponse(toAidl(info));
+ messagingCb()->setGsmBroadcastActivationResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setGsmBroadcastConfigResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->setGsmBroadcastConfigResponse(toAidl(info));
+ messagingCb()->setGsmBroadcastConfigResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setSmscAddressResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mMessagingCb);
- mMessagingCb->setSmscAddressResponse(toAidl(info));
+ messagingCb()->setSmscAddressResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::writeSmsToRuimResponse(const V1_0::RadioResponseInfo& info,
uint32_t index) {
LOG_CALL << info.serial << ' ' << index;
- CHECK_CB(mMessagingCb);
- mMessagingCb->writeSmsToRuimResponse(toAidl(info), index);
+ messagingCb()->writeSmsToRuimResponse(toAidl(info), index);
return {};
}
Return<void> RadioResponse::writeSmsToSimResponse(const V1_0::RadioResponseInfo& info,
int32_t index) {
LOG_CALL << info.serial << ' ' << index;
- CHECK_CB(mMessagingCb);
- mMessagingCb->writeSmsToSimResponse(toAidl(info), index);
+ messagingCb()->writeSmsToSimResponse(toAidl(info), index);
return {};
}
diff --git a/radio/aidl/compat/libradiocompat/modem/RadioIndication-modem.cpp b/radio/aidl/compat/libradiocompat/modem/RadioIndication-modem.cpp
index 8fc4da6..851c93b 100644
--- a/radio/aidl/compat/libradiocompat/modem/RadioIndication-modem.cpp
+++ b/radio/aidl/compat/libradiocompat/modem/RadioIndication-modem.cpp
@@ -29,44 +29,42 @@
namespace aidl = ::aidl::android::hardware::radio::modem;
void RadioIndication::setResponseFunction(std::shared_ptr<aidl::IRadioModemIndication> modemCb) {
- CHECK(modemCb);
mModemCb = modemCb;
}
+std::shared_ptr<aidl::IRadioModemIndication> RadioIndication::modemCb() {
+ return mModemCb.get();
+}
+
Return<void> RadioIndication::hardwareConfigChanged(V1_0::RadioIndicationType type,
const hidl_vec<V1_0::HardwareConfig>& configs) {
LOG_CALL << type;
- CHECK_CB(mModemCb);
- mModemCb->hardwareConfigChanged(toAidl(type), toAidl(configs));
+ modemCb()->hardwareConfigChanged(toAidl(type), toAidl(configs));
return {};
}
Return<void> RadioIndication::modemReset(V1_0::RadioIndicationType type, const hidl_string& reasn) {
LOG_CALL << type;
- CHECK_CB(mModemCb);
- mModemCb->modemReset(toAidl(type), reasn);
+ modemCb()->modemReset(toAidl(type), reasn);
return {};
}
Return<void> RadioIndication::radioCapabilityIndication(V1_0::RadioIndicationType type,
const V1_0::RadioCapability& rc) {
LOG_CALL << type;
- CHECK_CB(mModemCb);
- mModemCb->radioCapabilityIndication(toAidl(type), toAidl(rc));
+ modemCb()->radioCapabilityIndication(toAidl(type), toAidl(rc));
return {};
}
Return<void> RadioIndication::radioStateChanged(V1_0::RadioIndicationType t, V1_0::RadioState st) {
LOG_CALL << t;
- CHECK_CB(mModemCb);
- mModemCb->radioStateChanged(toAidl(t), aidl::RadioState(st));
+ modemCb()->radioStateChanged(toAidl(t), aidl::RadioState(st));
return {};
}
Return<void> RadioIndication::rilConnected(V1_0::RadioIndicationType type) {
LOG_CALL << type;
- CHECK_CB(mModemCb);
- mModemCb->rilConnected(toAidl(type));
+ modemCb()->rilConnected(toAidl(type));
return {};
}
diff --git a/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp b/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp
index 660ae9f..d28b940 100644
--- a/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp
+++ b/radio/aidl/compat/libradiocompat/modem/RadioModem.cpp
@@ -27,6 +27,10 @@
namespace aidl = ::aidl::android::hardware::radio::modem;
constexpr auto ok = &ScopedAStatus::ok;
+std::shared_ptr<aidl::IRadioModemResponse> RadioModem::respond() {
+ return mCallbackManager->response().modemCb();
+}
+
ScopedAStatus RadioModem::enableModem(int32_t serial, bool on) {
LOG_CALL << serial;
mHal1_5->enableModem(serial, on);
@@ -129,16 +133,10 @@
}
ScopedAStatus RadioModem::setResponseFunctions(
- const std::shared_ptr<aidl::IRadioModemResponse>& modemResponse,
- const std::shared_ptr<aidl::IRadioModemIndication>& modemIndication) {
- LOG_CALL << modemResponse << ' ' << modemIndication;
-
- CHECK(modemResponse);
- CHECK(modemIndication);
-
- mRadioResponse->setResponseFunction(modemResponse);
- mRadioIndication->setResponseFunction(modemIndication);
-
+ const std::shared_ptr<aidl::IRadioModemResponse>& response,
+ const std::shared_ptr<aidl::IRadioModemIndication>& indication) {
+ LOG_CALL << response << ' ' << indication;
+ mCallbackManager->setResponseFunctions(response, indication);
return ok();
}
diff --git a/radio/aidl/compat/libradiocompat/modem/RadioResponse-modem.cpp b/radio/aidl/compat/libradiocompat/modem/RadioResponse-modem.cpp
index 300627c..6e1a962 100644
--- a/radio/aidl/compat/libradiocompat/modem/RadioResponse-modem.cpp
+++ b/radio/aidl/compat/libradiocompat/modem/RadioResponse-modem.cpp
@@ -29,22 +29,23 @@
namespace aidl = ::aidl::android::hardware::radio::modem;
void RadioResponse::setResponseFunction(std::shared_ptr<aidl::IRadioModemResponse> modemCb) {
- CHECK(modemCb);
mModemCb = modemCb;
}
+std::shared_ptr<aidl::IRadioModemResponse> RadioResponse::modemCb() {
+ return mModemCb.get();
+}
+
Return<void> RadioResponse::enableModemResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mModemCb);
- mModemCb->enableModemResponse(toAidl(info));
+ modemCb()->enableModemResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::getBasebandVersionResponse(const V1_0::RadioResponseInfo& info,
const hidl_string& version) {
LOG_CALL << info.serial;
- CHECK_CB(mModemCb);
- mModemCb->getBasebandVersionResponse(toAidl(info), version);
+ modemCb()->getBasebandVersionResponse(toAidl(info), version);
return {};
}
@@ -52,112 +53,97 @@
const V1_0::RadioResponseInfo& info, const hidl_string& imei, const hidl_string& imeisv,
const hidl_string& esn, const hidl_string& meid) {
LOG_CALL << info.serial;
- CHECK_CB(mModemCb);
- mModemCb->getDeviceIdentityResponse(toAidl(info), imei, imeisv, esn, meid);
+ modemCb()->getDeviceIdentityResponse(toAidl(info), imei, imeisv, esn, meid);
return {};
}
Return<void> RadioResponse::getHardwareConfigResponse(
const V1_0::RadioResponseInfo& info, const hidl_vec<V1_0::HardwareConfig>& config) {
LOG_CALL << info.serial;
- CHECK_CB(mModemCb);
- mModemCb->getHardwareConfigResponse(toAidl(info), toAidl(config));
+ modemCb()->getHardwareConfigResponse(toAidl(info), toAidl(config));
return {};
}
Return<void> RadioResponse::getModemActivityInfoResponse(
const V1_0::RadioResponseInfo& info, const V1_0::ActivityStatsInfo& activityInfo) {
LOG_CALL << info.serial;
- CHECK_CB(mModemCb);
- mModemCb->getModemActivityInfoResponse(toAidl(info), toAidl(activityInfo));
+ modemCb()->getModemActivityInfoResponse(toAidl(info), toAidl(activityInfo));
return {};
}
Return<void> RadioResponse::getModemStackStatusResponse(const V1_0::RadioResponseInfo& info,
bool isEnabled) {
LOG_CALL << info.serial;
- CHECK_CB(mModemCb);
- mModemCb->getModemStackStatusResponse(toAidl(info), isEnabled);
+ modemCb()->getModemStackStatusResponse(toAidl(info), isEnabled);
return {};
}
Return<void> RadioResponse::getRadioCapabilityResponse(const V1_0::RadioResponseInfo& info,
const V1_0::RadioCapability& rc) {
LOG_CALL << info.serial;
- CHECK_CB(mModemCb);
- mModemCb->getRadioCapabilityResponse(toAidl(info), toAidl(rc));
+ modemCb()->getRadioCapabilityResponse(toAidl(info), toAidl(rc));
return {};
}
Return<void> RadioResponse::nvReadItemResponse(const V1_0::RadioResponseInfo& info,
const hidl_string& result) {
LOG_CALL << info.serial;
- CHECK_CB(mModemCb);
- mModemCb->nvReadItemResponse(toAidl(info), result);
+ modemCb()->nvReadItemResponse(toAidl(info), result);
return {};
}
Return<void> RadioResponse::nvResetConfigResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mModemCb);
- mModemCb->nvResetConfigResponse(toAidl(info));
+ modemCb()->nvResetConfigResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::nvWriteCdmaPrlResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mModemCb);
- mModemCb->nvWriteCdmaPrlResponse(toAidl(info));
+ modemCb()->nvWriteCdmaPrlResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::nvWriteItemResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mModemCb);
- mModemCb->nvWriteItemResponse(toAidl(info));
+ modemCb()->nvWriteItemResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::requestShutdownResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mModemCb);
- mModemCb->requestShutdownResponse(toAidl(info));
+ modemCb()->requestShutdownResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::sendDeviceStateResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mModemCb);
- mModemCb->sendDeviceStateResponse(toAidl(info));
+ modemCb()->sendDeviceStateResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setRadioCapabilityResponse(const V1_0::RadioResponseInfo& info,
const V1_0::RadioCapability& rc) {
LOG_CALL << info.serial;
- CHECK_CB(mModemCb);
- mModemCb->setRadioCapabilityResponse(toAidl(info), toAidl(rc));
+ modemCb()->setRadioCapabilityResponse(toAidl(info), toAidl(rc));
return {};
}
Return<void> RadioResponse::setRadioPowerResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mModemCb);
- mModemCb->setRadioPowerResponse(toAidl(info));
+ modemCb()->setRadioPowerResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setRadioPowerResponse_1_5(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mModemCb);
- mModemCb->setRadioPowerResponse(toAidl(info));
+ modemCb()->setRadioPowerResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setRadioPowerResponse_1_6(const V1_6::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mModemCb);
- mModemCb->setRadioPowerResponse(toAidl(info));
+ modemCb()->setRadioPowerResponse(toAidl(info));
return {};
}
diff --git a/radio/aidl/compat/libradiocompat/modem/structs.cpp b/radio/aidl/compat/libradiocompat/modem/structs.cpp
index c1cd64c..53d5753 100644
--- a/radio/aidl/compat/libradiocompat/modem/structs.cpp
+++ b/radio/aidl/compat/libradiocompat/modem/structs.cpp
@@ -24,6 +24,7 @@
namespace android::hardware::radio::compat {
+using ::aidl::android::hardware::radio::AccessNetwork;
using ::aidl::android::hardware::radio::RadioAccessFamily;
using ::aidl::android::hardware::radio::RadioTechnology;
namespace aidl = ::aidl::android::hardware::radio::modem;
@@ -82,11 +83,18 @@
}
aidl::ActivityStatsInfo toAidl(const V1_0::ActivityStatsInfo& info) {
+ const aidl::ActivityStatsTechSpecificInfo techSpecificInfo = {
+ .rat = AccessNetwork(AccessNetwork::UNKNOWN),
+ .frequencyRange = static_cast<int32_t>(
+ aidl::ActivityStatsTechSpecificInfo::FREQUENCY_RANGE_UNKNOWN),
+ .txmModetimeMs = toAidl(info.txmModetimeMs),
+ .rxModeTimeMs = static_cast<int32_t>(info.rxModeTimeMs),
+ };
+
return {
.sleepModeTimeMs = static_cast<int32_t>(info.sleepModeTimeMs),
.idleModeTimeMs = static_cast<int32_t>(info.idleModeTimeMs),
- .txmModetimeMs = toAidl(info.txmModetimeMs),
- .rxModeTimeMs = static_cast<int32_t>(info.rxModeTimeMs),
+ .techSpecificInfo = {techSpecificInfo},
};
}
diff --git a/radio/aidl/compat/libradiocompat/modem/structs.h b/radio/aidl/compat/libradiocompat/modem/structs.h
index 3ac1edb..af714c7 100644
--- a/radio/aidl/compat/libradiocompat/modem/structs.h
+++ b/radio/aidl/compat/libradiocompat/modem/structs.h
@@ -16,6 +16,7 @@
#pragma once
#include <aidl/android/hardware/radio/modem/ActivityStatsInfo.h>
+#include <aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.h>
#include <aidl/android/hardware/radio/modem/HardwareConfig.h>
#include <aidl/android/hardware/radio/modem/HardwareConfigModem.h>
#include <aidl/android/hardware/radio/modem/HardwareConfigSim.h>
diff --git a/radio/aidl/compat/libradiocompat/network/RadioIndication-network.cpp b/radio/aidl/compat/libradiocompat/network/RadioIndication-network.cpp
index 899b133..d4cbdbc 100644
--- a/radio/aidl/compat/libradiocompat/network/RadioIndication-network.cpp
+++ b/radio/aidl/compat/libradiocompat/network/RadioIndication-network.cpp
@@ -30,23 +30,24 @@
namespace aidl = ::aidl::android::hardware::radio::network;
void RadioIndication::setResponseFunction(std::shared_ptr<aidl::IRadioNetworkIndication> netCb) {
- CHECK(netCb);
mNetworkCb = netCb;
}
+std::shared_ptr<aidl::IRadioNetworkIndication> RadioIndication::networkCb() {
+ return mNetworkCb.get();
+}
+
Return<void> RadioIndication::barringInfoChanged(V1_0::RadioIndicationType type,
const V1_5::CellIdentity& cellIdentity,
const hidl_vec<V1_5::BarringInfo>& barringInfos) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->barringInfoChanged(toAidl(type), toAidl(cellIdentity), toAidl(barringInfos));
+ networkCb()->barringInfoChanged(toAidl(type), toAidl(cellIdentity), toAidl(barringInfos));
return {};
}
Return<void> RadioIndication::cdmaPrlChanged(V1_0::RadioIndicationType type, int32_t version) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->cdmaPrlChanged(toAidl(type), version);
+ networkCb()->cdmaPrlChanged(toAidl(type), version);
return {};
}
@@ -74,32 +75,28 @@
Return<void> RadioIndication::cellInfoList_1_5(V1_0::RadioIndicationType type,
const hidl_vec<V1_5::CellInfo>& records) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->cellInfoList(toAidl(type), toAidl(records));
+ networkCb()->cellInfoList(toAidl(type), toAidl(records));
return {};
}
Return<void> RadioIndication::cellInfoList_1_6(V1_0::RadioIndicationType type,
const hidl_vec<V1_6::CellInfo>& records) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->cellInfoList(toAidl(type), toAidl(records));
+ networkCb()->cellInfoList(toAidl(type), toAidl(records));
return {};
}
Return<void> RadioIndication::currentLinkCapacityEstimate(V1_0::RadioIndicationType type,
const V1_2::LinkCapacityEstimate& lce) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->currentLinkCapacityEstimate(toAidl(type), toAidl(lce));
+ networkCb()->currentLinkCapacityEstimate(toAidl(type), toAidl(lce));
return {};
}
Return<void> RadioIndication::currentLinkCapacityEstimate_1_6(
V1_0::RadioIndicationType type, const V1_6::LinkCapacityEstimate& lce) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->currentLinkCapacityEstimate(toAidl(type), toAidl(lce));
+ networkCb()->currentLinkCapacityEstimate(toAidl(type), toAidl(lce));
return {};
}
@@ -113,16 +110,14 @@
Return<void> RadioIndication::currentPhysicalChannelConfigs_1_4(
V1_0::RadioIndicationType type, const hidl_vec<V1_4::PhysicalChannelConfig>& configs) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->currentPhysicalChannelConfigs(toAidl(type), toAidl(configs));
+ networkCb()->currentPhysicalChannelConfigs(toAidl(type), toAidl(configs));
return {};
}
Return<void> RadioIndication::currentPhysicalChannelConfigs_1_6(
V1_0::RadioIndicationType type, const hidl_vec<V1_6::PhysicalChannelConfig>& configs) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->currentPhysicalChannelConfigs(toAidl(type), toAidl(configs));
+ networkCb()->currentPhysicalChannelConfigs(toAidl(type), toAidl(configs));
return {};
}
@@ -143,23 +138,20 @@
Return<void> RadioIndication::currentSignalStrength_1_4(
V1_0::RadioIndicationType type, const V1_4::SignalStrength& signalStrength) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->currentSignalStrength(toAidl(type), toAidl(signalStrength));
+ networkCb()->currentSignalStrength(toAidl(type), toAidl(signalStrength));
return {};
}
Return<void> RadioIndication::currentSignalStrength_1_6(
V1_0::RadioIndicationType type, const V1_6::SignalStrength& signalStrength) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->currentSignalStrength(toAidl(type), toAidl(signalStrength));
+ networkCb()->currentSignalStrength(toAidl(type), toAidl(signalStrength));
return {};
}
Return<void> RadioIndication::imsNetworkStateChanged(V1_0::RadioIndicationType type) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->imsNetworkStateChanged(toAidl(type));
+ networkCb()->imsNetworkStateChanged(toAidl(type));
return {};
}
@@ -187,31 +179,27 @@
Return<void> RadioIndication::networkScanResult_1_5(V1_0::RadioIndicationType type,
const V1_5::NetworkScanResult& result) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->networkScanResult(toAidl(type), toAidl(result));
+ networkCb()->networkScanResult(toAidl(type), toAidl(result));
return {};
}
Return<void> RadioIndication::networkScanResult_1_6(V1_0::RadioIndicationType type,
const V1_6::NetworkScanResult& result) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->networkScanResult(toAidl(type), toAidl(result));
+ networkCb()->networkScanResult(toAidl(type), toAidl(result));
return {};
}
Return<void> RadioIndication::networkStateChanged(V1_0::RadioIndicationType type) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->networkStateChanged(toAidl(type));
+ networkCb()->networkStateChanged(toAidl(type));
return {};
}
Return<void> RadioIndication::nitzTimeReceived(V1_0::RadioIndicationType type,
const hidl_string& nitzTime, uint64_t receivedTime) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->nitzTimeReceived(toAidl(type), nitzTime, receivedTime, 0);
+ networkCb()->nitzTimeReceived(toAidl(type), nitzTime, receivedTime, 0);
return {};
}
@@ -220,33 +208,29 @@
const hidl_string& chosenPlmn, hidl_bitfield<V1_5::Domain> domain, int32_t causeCode,
int32_t additionalCauseCode) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->registrationFailed(toAidl(type), toAidl(cellIdentity), chosenPlmn,
- aidl::Domain(domain), causeCode, additionalCauseCode);
+ networkCb()->registrationFailed(toAidl(type), toAidl(cellIdentity), chosenPlmn,
+ aidl::Domain(domain), causeCode, additionalCauseCode);
return {};
}
Return<void> RadioIndication::restrictedStateChanged(V1_0::RadioIndicationType type,
V1_0::PhoneRestrictedState state) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->restrictedStateChanged(toAidl(type), aidl::PhoneRestrictedState(state));
+ networkCb()->restrictedStateChanged(toAidl(type), aidl::PhoneRestrictedState(state));
return {};
}
Return<void> RadioIndication::suppSvcNotify(V1_0::RadioIndicationType type,
const V1_0::SuppSvcNotification& suppSvc) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->suppSvcNotify(toAidl(type), toAidl(suppSvc));
+ networkCb()->suppSvcNotify(toAidl(type), toAidl(suppSvc));
return {};
}
Return<void> RadioIndication::voiceRadioTechChanged(V1_0::RadioIndicationType type,
V1_0::RadioTechnology rat) {
LOG_CALL << type;
- CHECK_CB(mNetworkCb);
- mNetworkCb->voiceRadioTechChanged(toAidl(type), RadioTechnology(rat));
+ networkCb()->voiceRadioTechChanged(toAidl(type), RadioTechnology(rat));
return {};
}
diff --git a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp
index af0bc46..8bfa0bb 100644
--- a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp
+++ b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp
@@ -33,6 +33,10 @@
namespace aidl = ::aidl::android::hardware::radio::network;
constexpr auto ok = &ScopedAStatus::ok;
+std::shared_ptr<aidl::IRadioNetworkResponse> RadioNetwork::respond() {
+ return mCallbackManager->response().networkCb();
+}
+
ScopedAStatus RadioNetwork::getAllowedNetworkTypesBitmap(int32_t serial) {
LOG_CALL << serial;
if (mHal1_6) {
@@ -69,13 +73,21 @@
ScopedAStatus RadioNetwork::getCellInfoList(int32_t serial) {
LOG_CALL << serial;
- mHal1_5->getCellInfoList(serial);
+ if (mHal1_6) {
+ mHal1_6->getCellInfoList_1_6(serial);
+ } else {
+ mHal1_5->getCellInfoList(serial);
+ }
return ok();
}
ScopedAStatus RadioNetwork::getDataRegistrationState(int32_t serial) {
LOG_CALL << serial;
- mHal1_5->getDataRegistrationState(serial);
+ if (mHal1_6) {
+ mHal1_6->getDataRegistrationState_1_6(serial);
+ } else {
+ mHal1_5->getDataRegistrationState_1_5(serial);
+ }
return ok();
}
@@ -99,7 +111,11 @@
ScopedAStatus RadioNetwork::getSignalStrength(int32_t serial) {
LOG_CALL << serial;
- mHal1_5->getSignalStrength(serial);
+ if (mHal1_6) {
+ mHal1_6->getSignalStrength_1_6(serial);
+ } else {
+ mHal1_5->getSignalStrength_1_4(serial);
+ }
return ok();
}
@@ -108,7 +124,7 @@
if (mHal1_6) {
mHal1_6->getSystemSelectionChannels(serial);
} else {
- respond().getSystemSelectionChannelsResponse(notSupported(serial), {});
+ respond()->getSystemSelectionChannelsResponse(notSupported(serial), {});
}
return ok();
}
@@ -121,7 +137,11 @@
ScopedAStatus RadioNetwork::getVoiceRegistrationState(int32_t serial) {
LOG_CALL << serial;
- mHal1_5->getVoiceRegistrationState(serial);
+ if (mHal1_6) {
+ mHal1_6->getVoiceRegistrationState_1_6(serial);
+ } else {
+ mHal1_5->getVoiceRegistrationState_1_5(serial);
+ }
return ok();
}
@@ -130,7 +150,7 @@
if (mHal1_6) {
mHal1_6->isNrDualConnectivityEnabled(serial);
} else {
- respond().isNrDualConnectivityEnabledResponse(notSupported(serial), false);
+ respond()->isNrDualConnectivityEnabledResponse(notSupported(serial), false);
}
return ok();
}
@@ -179,7 +199,7 @@
ScopedAStatus RadioNetwork::setIndicationFilter(int32_t serial, aidl::IndicationFilter indFilter) {
LOG_CALL << serial;
- mHal1_5->setIndicationFilter(serial, toHidlBitfield<V1_0::IndicationFilter>(indFilter));
+ mHal1_5->setIndicationFilter_1_5(serial, toHidlBitfield<V1_5::IndicationFilter>(indFilter));
return ok();
}
@@ -188,9 +208,9 @@
const std::vector<int32_t>& thrDownlinkKbps, const std::vector<int32_t>& thrUplinkKbps,
AccessNetwork accessNetwork) {
LOG_CALL << serial;
- mHal1_5->setLinkCapacityReportingCriteria( //
+ mHal1_5->setLinkCapacityReportingCriteria_1_5( //
serial, hysteresisMs, hysteresisDlKbps, hysteresisUlKbps, thrDownlinkKbps,
- thrUplinkKbps, V1_2::AccessNetwork(accessNetwork));
+ thrUplinkKbps, V1_5::AccessNetwork(accessNetwork));
return ok();
}
@@ -219,22 +239,16 @@
if (mHal1_6) {
mHal1_6->setNrDualConnectivityState(serial, V1_6::NrDualConnectivityState(st));
} else {
- respond().setNrDualConnectivityStateResponse(notSupported(serial));
+ respond()->setNrDualConnectivityStateResponse(notSupported(serial));
}
return ok();
}
ScopedAStatus RadioNetwork::setResponseFunctions(
- const std::shared_ptr<aidl::IRadioNetworkResponse>& networkResponse,
- const std::shared_ptr<aidl::IRadioNetworkIndication>& networkIndication) {
- LOG_CALL << networkResponse << ' ' << networkIndication;
-
- CHECK(networkResponse);
- CHECK(networkIndication);
-
- mRadioResponse->setResponseFunction(networkResponse);
- mRadioIndication->setResponseFunction(networkIndication);
-
+ const std::shared_ptr<aidl::IRadioNetworkResponse>& response,
+ const std::shared_ptr<aidl::IRadioNetworkIndication>& indication) {
+ LOG_CALL << response << ' ' << indication;
+ mCallbackManager->setResponseFunctions(response, indication);
return ok();
}
@@ -278,4 +292,19 @@
return ok();
}
+// TODO(b/210498497): is there a cleaner way to send a response back to Android, even though these
+// methods must never be called?
+ScopedAStatus RadioNetwork::setUsageSetting(
+ int32_t ser, ::aidl::android::hardware::radio::network::UsageSetting) {
+ LOG_CALL << ser;
+ LOG(ERROR) << "setUsageSetting is unsupported by HIDL HALs";
+ return ok();
+}
+
+ScopedAStatus RadioNetwork::getUsageSetting(int32_t ser) {
+ LOG_CALL << ser;
+ LOG(ERROR) << "getUsageSetting is unsupported by HIDL HALs";
+ return ok();
+}
+
} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/network/RadioResponse-network.cpp b/radio/aidl/compat/libradiocompat/network/RadioResponse-network.cpp
index 81f7775..bab1d4a 100644
--- a/radio/aidl/compat/libradiocompat/network/RadioResponse-network.cpp
+++ b/radio/aidl/compat/libradiocompat/network/RadioResponse-network.cpp
@@ -33,25 +33,26 @@
namespace aidl = ::aidl::android::hardware::radio::network;
void RadioResponse::setResponseFunction(std::shared_ptr<aidl::IRadioNetworkResponse> netCb) {
- CHECK(netCb);
mNetworkCb = netCb;
}
+std::shared_ptr<aidl::IRadioNetworkResponse> RadioResponse::networkCb() {
+ return mNetworkCb.get();
+}
+
Return<void> RadioResponse::getAllowedNetworkTypesBitmapResponse(
const V1_6::RadioResponseInfo& info,
hidl_bitfield<V1_4::RadioAccessFamily> networkTypeBitmap) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getAllowedNetworkTypesBitmapResponse(toAidl(info),
- RadioAccessFamily(networkTypeBitmap));
+ networkCb()->getAllowedNetworkTypesBitmapResponse(toAidl(info),
+ RadioAccessFamily(networkTypeBitmap));
return {};
}
Return<void> RadioResponse::getPreferredNetworkTypeResponse(const V1_0::RadioResponseInfo& info,
V1_0::PreferredNetworkType nwType) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getAllowedNetworkTypesBitmapResponse( //
+ networkCb()->getAllowedNetworkTypesBitmapResponse( //
toAidl(info), RadioAccessFamily(getRafFromNetworkType(nwType)));
return {};
}
@@ -66,16 +67,14 @@
Return<void> RadioResponse::getAvailableBandModesResponse(
const V1_0::RadioResponseInfo& info, const hidl_vec<V1_0::RadioBandMode>& bandModes) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getAvailableBandModesResponse(toAidl(info), toAidl(bandModes));
+ networkCb()->getAvailableBandModesResponse(toAidl(info), toAidl(bandModes));
return {};
}
Return<void> RadioResponse::getAvailableNetworksResponse(
const V1_0::RadioResponseInfo& info, const hidl_vec<V1_0::OperatorInfo>& networkInfos) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getAvailableNetworksResponse(toAidl(info), toAidl(networkInfos));
+ networkCb()->getAvailableNetworksResponse(toAidl(info), toAidl(networkInfos));
return {};
}
@@ -83,16 +82,14 @@
const V1_0::RadioResponseInfo& info, const V1_5::CellIdentity& cellIdentity,
const hidl_vec<V1_5::BarringInfo>& barringInfos) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getBarringInfoResponse(toAidl(info), toAidl(cellIdentity), toAidl(barringInfos));
+ networkCb()->getBarringInfoResponse(toAidl(info), toAidl(cellIdentity), toAidl(barringInfos));
return {};
}
Return<void> RadioResponse::getCdmaRoamingPreferenceResponse(const V1_0::RadioResponseInfo& info,
V1_0::CdmaRoamingType type) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getCdmaRoamingPreferenceResponse(toAidl(info), aidl::CdmaRoamingType(type));
+ networkCb()->getCdmaRoamingPreferenceResponse(toAidl(info), aidl::CdmaRoamingType(type));
return {};
}
@@ -120,16 +117,14 @@
Return<void> RadioResponse::getCellInfoListResponse_1_5(const V1_0::RadioResponseInfo& info,
const hidl_vec<V1_5::CellInfo>& cellInfo) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getCellInfoListResponse(toAidl(info), toAidl(cellInfo));
+ networkCb()->getCellInfoListResponse(toAidl(info), toAidl(cellInfo));
return {};
}
Return<void> RadioResponse::getCellInfoListResponse_1_6(const V1_6::RadioResponseInfo& info,
const hidl_vec<V1_6::CellInfo>& cellInfo) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getCellInfoListResponse(toAidl(info), toAidl(cellInfo));
+ networkCb()->getCellInfoListResponse(toAidl(info), toAidl(cellInfo));
return {};
}
@@ -157,25 +152,22 @@
Return<void> RadioResponse::getDataRegistrationStateResponse_1_5(
const V1_0::RadioResponseInfo& info, const V1_5::RegStateResult& dataRegResponse) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getDataRegistrationStateResponse(toAidl(info), toAidl(dataRegResponse));
+ networkCb()->getDataRegistrationStateResponse(toAidl(info), toAidl(dataRegResponse));
return {};
}
Return<void> RadioResponse::getDataRegistrationStateResponse_1_6(
const V1_6::RadioResponseInfo& info, const V1_6::RegStateResult& dataRegResponse) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getDataRegistrationStateResponse(toAidl(info), toAidl(dataRegResponse));
+ networkCb()->getDataRegistrationStateResponse(toAidl(info), toAidl(dataRegResponse));
return {};
}
Return<void> RadioResponse::getImsRegistrationStateResponse( //
const V1_0::RadioResponseInfo& info, bool isRegd, V1_0::RadioTechnologyFamily ratFamily) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getImsRegistrationStateResponse(toAidl(info), isRegd,
- RadioTechnologyFamily(ratFamily));
+ networkCb()->getImsRegistrationStateResponse(toAidl(info), isRegd,
+ RadioTechnologyFamily(ratFamily));
return {};
}
@@ -189,8 +181,7 @@
Return<void> RadioResponse::getNetworkSelectionModeResponse(const V1_0::RadioResponseInfo& info,
bool manual) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getNetworkSelectionModeResponse(toAidl(info), manual);
+ networkCb()->getNetworkSelectionModeResponse(toAidl(info), manual);
return {};
}
@@ -198,8 +189,7 @@
const V1_0::RadioResponseInfo& info, const hidl_string& longName,
const hidl_string& shortName, const hidl_string& numeric) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getOperatorResponse(toAidl(info), longName, shortName, numeric);
+ networkCb()->getOperatorResponse(toAidl(info), longName, shortName, numeric);
return {};
}
@@ -220,16 +210,14 @@
Return<void> RadioResponse::getSignalStrengthResponse_1_4(
const V1_0::RadioResponseInfo& info, const V1_4::SignalStrength& signalStrength) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getSignalStrengthResponse(toAidl(info), toAidl(signalStrength));
+ networkCb()->getSignalStrengthResponse(toAidl(info), toAidl(signalStrength));
return {};
}
Return<void> RadioResponse::getSignalStrengthResponse_1_6(
const V1_6::RadioResponseInfo& info, const V1_6::SignalStrength& signalStrength) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getSignalStrengthResponse(toAidl(info), toAidl(signalStrength));
+ networkCb()->getSignalStrengthResponse(toAidl(info), toAidl(signalStrength));
return {};
}
@@ -237,16 +225,14 @@
const V1_6::RadioResponseInfo& info,
const hidl_vec<V1_5::RadioAccessSpecifier>& specifiers) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getSystemSelectionChannelsResponse(toAidl(info), toAidl(specifiers));
+ networkCb()->getSystemSelectionChannelsResponse(toAidl(info), toAidl(specifiers));
return {};
}
Return<void> RadioResponse::getVoiceRadioTechnologyResponse(const V1_0::RadioResponseInfo& info,
V1_0::RadioTechnology rat) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getVoiceRadioTechnologyResponse(toAidl(info), RadioTechnology(rat));
+ networkCb()->getVoiceRadioTechnologyResponse(toAidl(info), RadioTechnology(rat));
return {};
}
@@ -267,24 +253,21 @@
Return<void> RadioResponse::getVoiceRegistrationStateResponse_1_5(
const V1_0::RadioResponseInfo& info, const V1_5::RegStateResult& voiceRegResponse) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getVoiceRegistrationStateResponse(toAidl(info), toAidl(voiceRegResponse));
+ networkCb()->getVoiceRegistrationStateResponse(toAidl(info), toAidl(voiceRegResponse));
return {};
}
Return<void> RadioResponse::getVoiceRegistrationStateResponse_1_6(
const V1_6::RadioResponseInfo& info, const V1_6::RegStateResult& voiceRegResponse) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->getVoiceRegistrationStateResponse(toAidl(info), toAidl(voiceRegResponse));
+ networkCb()->getVoiceRegistrationStateResponse(toAidl(info), toAidl(voiceRegResponse));
return {};
}
Return<void> RadioResponse::isNrDualConnectivityEnabledResponse(const V1_6::RadioResponseInfo& info,
bool isEnabled) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->isNrDualConnectivityEnabledResponse(toAidl(info), isEnabled);
+ networkCb()->isNrDualConnectivityEnabledResponse(toAidl(info), isEnabled);
return {};
}
@@ -297,15 +280,13 @@
Return<void> RadioResponse::setAllowedNetworkTypesBitmapResponse(const V1_6::RadioResponseInfo& i) {
LOG_CALL << i.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setAllowedNetworkTypesBitmapResponse(toAidl(i));
+ networkCb()->setAllowedNetworkTypesBitmapResponse(toAidl(i));
return {};
}
Return<void> RadioResponse::setPreferredNetworkTypeResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setAllowedNetworkTypesBitmapResponse(toAidl(info));
+ networkCb()->setAllowedNetworkTypesBitmapResponse(toAidl(info));
return {};
}
@@ -318,174 +299,151 @@
Return<void> RadioResponse::setBandModeResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setBandModeResponse(toAidl(info));
+ networkCb()->setBandModeResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setBarringPasswordResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setBarringPasswordResponse(toAidl(info));
+ networkCb()->setBarringPasswordResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setCdmaRoamingPreferenceResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setCdmaRoamingPreferenceResponse(toAidl(info));
+ networkCb()->setCdmaRoamingPreferenceResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setCellInfoListRateResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setCellInfoListRateResponse(toAidl(info));
+ networkCb()->setCellInfoListRateResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setIndicationFilterResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setIndicationFilterResponse(toAidl(info));
+ networkCb()->setIndicationFilterResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setIndicationFilterResponse_1_5(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setIndicationFilterResponse(toAidl(info));
+ networkCb()->setIndicationFilterResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setLinkCapacityReportingCriteriaResponse(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setLinkCapacityReportingCriteriaResponse(toAidl(info));
+ networkCb()->setLinkCapacityReportingCriteriaResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setLinkCapacityReportingCriteriaResponse_1_5(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setLinkCapacityReportingCriteriaResponse(toAidl(info));
+ networkCb()->setLinkCapacityReportingCriteriaResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setLocationUpdatesResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setLocationUpdatesResponse(toAidl(info));
+ networkCb()->setLocationUpdatesResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setNetworkSelectionModeAutomaticResponse(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setNetworkSelectionModeAutomaticResponse(toAidl(info));
+ networkCb()->setNetworkSelectionModeAutomaticResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setNetworkSelectionModeManualResponse(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setNetworkSelectionModeManualResponse(toAidl(info));
+ networkCb()->setNetworkSelectionModeManualResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setNetworkSelectionModeManualResponse_1_5(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setNetworkSelectionModeManualResponse(toAidl(info));
+ networkCb()->setNetworkSelectionModeManualResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setNrDualConnectivityStateResponse(
const V1_6::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setNrDualConnectivityStateResponse(toAidl(info));
+ networkCb()->setNrDualConnectivityStateResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setSignalStrengthReportingCriteriaResponse(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setSignalStrengthReportingCriteriaResponse(toAidl(info));
+ networkCb()->setSignalStrengthReportingCriteriaResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setSignalStrengthReportingCriteriaResponse_1_5(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setSignalStrengthReportingCriteriaResponse(toAidl(info));
+ networkCb()->setSignalStrengthReportingCriteriaResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setSuppServiceNotificationsResponse(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setSuppServiceNotificationsResponse(toAidl(info));
+ networkCb()->setSuppServiceNotificationsResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setSystemSelectionChannelsResponse(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setSystemSelectionChannelsResponse(toAidl(info));
+ networkCb()->setSystemSelectionChannelsResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setSystemSelectionChannelsResponse_1_5(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->setSystemSelectionChannelsResponse(toAidl(info));
+ networkCb()->setSystemSelectionChannelsResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::startNetworkScanResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->startNetworkScanResponse(toAidl(info));
+ networkCb()->startNetworkScanResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::startNetworkScanResponse_1_4(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->startNetworkScanResponse(toAidl(info));
+ networkCb()->startNetworkScanResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::startNetworkScanResponse_1_5(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->startNetworkScanResponse(toAidl(info));
+ networkCb()->startNetworkScanResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::stopNetworkScanResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->stopNetworkScanResponse(toAidl(info));
+ networkCb()->stopNetworkScanResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::supplyNetworkDepersonalizationResponse(
const V1_0::RadioResponseInfo& info, int32_t remainingRetries) {
LOG_CALL << info.serial;
- CHECK_CB(mNetworkCb);
- mNetworkCb->supplyNetworkDepersonalizationResponse(toAidl(info), remainingRetries);
+ networkCb()->supplyNetworkDepersonalizationResponse(toAidl(info), remainingRetries);
return {};
}
diff --git a/radio/aidl/compat/libradiocompat/sim/RadioIndication-sim.cpp b/radio/aidl/compat/libradiocompat/sim/RadioIndication-sim.cpp
index 6b906c6..3938e00 100644
--- a/radio/aidl/compat/libradiocompat/sim/RadioIndication-sim.cpp
+++ b/radio/aidl/compat/libradiocompat/sim/RadioIndication-sim.cpp
@@ -29,29 +29,29 @@
namespace aidl = ::aidl::android::hardware::radio::sim;
void RadioIndication::setResponseFunction(std::shared_ptr<aidl::IRadioSimIndication> simCb) {
- CHECK(simCb);
mSimCb = simCb;
}
+std::shared_ptr<aidl::IRadioSimIndication> RadioIndication::simCb() {
+ return mSimCb.get();
+}
+
Return<void> RadioIndication::carrierInfoForImsiEncryption(V1_0::RadioIndicationType type) {
LOG_CALL << type;
- CHECK_CB(mSimCb);
- mSimCb->carrierInfoForImsiEncryption(toAidl(type));
+ simCb()->carrierInfoForImsiEncryption(toAidl(type));
return {};
}
Return<void> RadioIndication::cdmaSubscriptionSourceChanged(
V1_0::RadioIndicationType type, V1_0::CdmaSubscriptionSource cdmaSource) {
LOG_CALL << type;
- CHECK_CB(mSimCb);
- mSimCb->cdmaSubscriptionSourceChanged(toAidl(type), aidl::CdmaSubscriptionSource(cdmaSource));
+ simCb()->cdmaSubscriptionSourceChanged(toAidl(type), aidl::CdmaSubscriptionSource(cdmaSource));
return {};
}
Return<void> RadioIndication::simPhonebookChanged(V1_0::RadioIndicationType type) {
LOG_CALL << type;
- CHECK_CB(mSimCb);
- mSimCb->simPhonebookChanged(toAidl(type));
+ simCb()->simPhonebookChanged(toAidl(type));
return {};
}
@@ -59,62 +59,54 @@
V1_0::RadioIndicationType type, V1_6::PbReceivedStatus status,
const hidl_vec<V1_6::PhonebookRecordInfo>& rec) {
LOG_CALL << type;
- CHECK_CB(mSimCb);
- mSimCb->simPhonebookRecordsReceived(toAidl(type), aidl::PbReceivedStatus(status), toAidl(rec));
+ simCb()->simPhonebookRecordsReceived(toAidl(type), aidl::PbReceivedStatus(status), toAidl(rec));
return {};
}
Return<void> RadioIndication::simRefresh(V1_0::RadioIndicationType type,
const V1_0::SimRefreshResult& refreshResult) {
LOG_CALL << type;
- CHECK_CB(mSimCb);
- mSimCb->simRefresh(toAidl(type), toAidl(refreshResult));
+ simCb()->simRefresh(toAidl(type), toAidl(refreshResult));
return {};
}
Return<void> RadioIndication::simStatusChanged(V1_0::RadioIndicationType type) {
LOG_CALL << type;
- CHECK_CB(mSimCb);
- mSimCb->simStatusChanged(toAidl(type));
+ simCb()->simStatusChanged(toAidl(type));
return {};
}
Return<void> RadioIndication::stkEventNotify(V1_0::RadioIndicationType type,
const hidl_string& cmd) {
LOG_CALL << type;
- CHECK_CB(mSimCb);
- mSimCb->stkEventNotify(toAidl(type), cmd);
+ simCb()->stkEventNotify(toAidl(type), cmd);
return {};
}
Return<void> RadioIndication::stkProactiveCommand(V1_0::RadioIndicationType type,
const hidl_string& cmd) {
LOG_CALL << type;
- CHECK_CB(mSimCb);
- mSimCb->stkProactiveCommand(toAidl(type), cmd);
+ simCb()->stkProactiveCommand(toAidl(type), cmd);
return {};
}
Return<void> RadioIndication::stkSessionEnd(V1_0::RadioIndicationType type) {
LOG_CALL << type;
- CHECK_CB(mSimCb);
- mSimCb->stkSessionEnd(toAidl(type));
+ simCb()->stkSessionEnd(toAidl(type));
return {};
}
Return<void> RadioIndication::subscriptionStatusChanged(V1_0::RadioIndicationType type,
bool activate) {
LOG_CALL << type;
- CHECK_CB(mSimCb);
- mSimCb->subscriptionStatusChanged(toAidl(type), activate);
+ simCb()->subscriptionStatusChanged(toAidl(type), activate);
return {};
}
Return<void> RadioIndication::uiccApplicationsEnablementChanged(V1_0::RadioIndicationType type,
bool enabled) {
LOG_CALL << type;
- CHECK_CB(mSimCb);
- mSimCb->uiccApplicationsEnablementChanged(toAidl(type), enabled);
+ simCb()->uiccApplicationsEnablementChanged(toAidl(type), enabled);
return {};
}
diff --git a/radio/aidl/compat/libradiocompat/sim/RadioResponse-sim.cpp b/radio/aidl/compat/libradiocompat/sim/RadioResponse-sim.cpp
index 2dfbc50..3ad9130 100644
--- a/radio/aidl/compat/libradiocompat/sim/RadioResponse-sim.cpp
+++ b/radio/aidl/compat/libradiocompat/sim/RadioResponse-sim.cpp
@@ -29,48 +29,46 @@
namespace aidl = ::aidl::android::hardware::radio::sim;
void RadioResponse::setResponseFunction(std::shared_ptr<aidl::IRadioSimResponse> simCb) {
- CHECK(simCb);
mSimCb = simCb;
}
+std::shared_ptr<aidl::IRadioSimResponse> RadioResponse::simCb() {
+ return mSimCb.get();
+}
+
Return<void> RadioResponse::areUiccApplicationsEnabledResponse(const V1_0::RadioResponseInfo& info,
bool enabled) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->areUiccApplicationsEnabledResponse(toAidl(info), enabled);
+ simCb()->areUiccApplicationsEnabledResponse(toAidl(info), enabled);
return {};
}
Return<void> RadioResponse::changeIccPin2ForAppResponse(const V1_0::RadioResponseInfo& info,
int32_t remainingRetries) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->changeIccPin2ForAppResponse(toAidl(info), remainingRetries);
+ simCb()->changeIccPin2ForAppResponse(toAidl(info), remainingRetries);
return {};
}
Return<void> RadioResponse::changeIccPinForAppResponse(const V1_0::RadioResponseInfo& info,
int32_t remainingRetries) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->changeIccPinForAppResponse(toAidl(info), remainingRetries);
+ simCb()->changeIccPinForAppResponse(toAidl(info), remainingRetries);
return {};
}
Return<void> RadioResponse::enableUiccApplicationsResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->enableUiccApplicationsResponse(toAidl(info));
+ simCb()->enableUiccApplicationsResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::getAllowedCarriersResponse( //
const V1_0::RadioResponseInfo& info, bool allAllowed, const V1_0::CarrierRestrictions& cr) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
aidl::CarrierRestrictions aidlCr = toAidl(cr);
if (allAllowed) aidlCr = {};
- mSimCb->getAllowedCarriersResponse(toAidl(info), aidlCr, {});
+ simCb()->getAllowedCarriersResponse(toAidl(info), aidlCr, {});
return {};
}
@@ -78,9 +76,8 @@
const V1_0::RadioResponseInfo& info, const V1_4::CarrierRestrictionsWithPriority& carriers,
V1_4::SimLockMultiSimPolicy multiSimPolicy) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->getAllowedCarriersResponse(toAidl(info), toAidl(carriers),
- aidl::SimLockMultiSimPolicy(multiSimPolicy));
+ simCb()->getAllowedCarriersResponse(toAidl(info), toAidl(carriers),
+ aidl::SimLockMultiSimPolicy(multiSimPolicy));
return {};
}
@@ -88,133 +85,116 @@
const V1_0::RadioResponseInfo& info, const hidl_string& mdn, const hidl_string& hSid,
const hidl_string& hNid, const hidl_string& min, const hidl_string& prl) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->getCdmaSubscriptionResponse(toAidl(info), mdn, hSid, hNid, min, prl);
+ simCb()->getCdmaSubscriptionResponse(toAidl(info), mdn, hSid, hNid, min, prl);
return {};
}
Return<void> RadioResponse::getCdmaSubscriptionSourceResponse(const V1_0::RadioResponseInfo& info,
V1_0::CdmaSubscriptionSource s) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->getCdmaSubscriptionSourceResponse(toAidl(info), aidl::CdmaSubscriptionSource(s));
+ simCb()->getCdmaSubscriptionSourceResponse(toAidl(info), aidl::CdmaSubscriptionSource(s));
return {};
}
Return<void> RadioResponse::getFacilityLockForAppResponse(const V1_0::RadioResponseInfo& info,
int32_t response) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->getFacilityLockForAppResponse(toAidl(info), response);
+ simCb()->getFacilityLockForAppResponse(toAidl(info), response);
return {};
}
Return<void> RadioResponse::getIccCardStatusResponse(const V1_0::RadioResponseInfo& info,
const V1_0::CardStatus& cardStatus) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus));
+ simCb()->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus));
return {};
}
Return<void> RadioResponse::getIccCardStatusResponse_1_2(const V1_0::RadioResponseInfo& info,
const V1_2::CardStatus& cardStatus) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus));
+ simCb()->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus));
return {};
}
Return<void> RadioResponse::getIccCardStatusResponse_1_4(const V1_0::RadioResponseInfo& info,
const V1_4::CardStatus& cardStatus) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus));
+ simCb()->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus));
return {};
}
Return<void> RadioResponse::getIccCardStatusResponse_1_5(const V1_0::RadioResponseInfo& info,
const V1_5::CardStatus& cardStatus) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus));
+ simCb()->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus));
return {};
}
Return<void> RadioResponse::getIMSIForAppResponse(const V1_0::RadioResponseInfo& info,
const hidl_string& imsi) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->getImsiForAppResponse(toAidl(info), imsi);
+ simCb()->getImsiForAppResponse(toAidl(info), imsi);
return {};
}
Return<void> RadioResponse::getSimPhonebookCapacityResponse(
const V1_6::RadioResponseInfo& info, const V1_6::PhonebookCapacity& capacity) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->getSimPhonebookCapacityResponse(toAidl(info), toAidl(capacity));
+ simCb()->getSimPhonebookCapacityResponse(toAidl(info), toAidl(capacity));
return {};
}
Return<void> RadioResponse::getSimPhonebookRecordsResponse(const V1_6::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->getSimPhonebookRecordsResponse(toAidl(info));
+ simCb()->getSimPhonebookRecordsResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::iccCloseLogicalChannelResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->iccCloseLogicalChannelResponse(toAidl(info));
+ simCb()->iccCloseLogicalChannelResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::iccIOForAppResponse(const V1_0::RadioResponseInfo& info,
const V1_0::IccIoResult& iccIo) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->iccIoForAppResponse(toAidl(info), toAidl(iccIo));
+ simCb()->iccIoForAppResponse(toAidl(info), toAidl(iccIo));
return {};
}
Return<void> RadioResponse::iccOpenLogicalChannelResponse( //
const V1_0::RadioResponseInfo& info, int32_t chanId, const hidl_vec<int8_t>& selectResp) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->iccOpenLogicalChannelResponse(toAidl(info), chanId, toAidl(selectResp));
+ simCb()->iccOpenLogicalChannelResponse(toAidl(info), chanId, toAidl(selectResp));
return {};
}
Return<void> RadioResponse::iccTransmitApduBasicChannelResponse(const V1_0::RadioResponseInfo& info,
const V1_0::IccIoResult& result) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->iccTransmitApduBasicChannelResponse(toAidl(info), toAidl(result));
+ simCb()->iccTransmitApduBasicChannelResponse(toAidl(info), toAidl(result));
return {};
}
Return<void> RadioResponse::iccTransmitApduLogicalChannelResponse(
const V1_0::RadioResponseInfo& info, const V1_0::IccIoResult& result) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->iccTransmitApduLogicalChannelResponse(toAidl(info), toAidl(result));
+ simCb()->iccTransmitApduLogicalChannelResponse(toAidl(info), toAidl(result));
return {};
}
Return<void> RadioResponse::reportStkServiceIsRunningResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->reportStkServiceIsRunningResponse(toAidl(info));
+ simCb()->reportStkServiceIsRunningResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::requestIccSimAuthenticationResponse(const V1_0::RadioResponseInfo& info,
const V1_0::IccIoResult& result) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->requestIccSimAuthenticationResponse(toAidl(info), toAidl(result));
+ simCb()->requestIccSimAuthenticationResponse(toAidl(info), toAidl(result));
return {};
}
@@ -228,121 +208,105 @@
Return<void> RadioResponse::sendEnvelopeResponse(const V1_0::RadioResponseInfo& info,
const hidl_string& commandResponse) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->sendEnvelopeResponse(toAidl(info), commandResponse);
+ simCb()->sendEnvelopeResponse(toAidl(info), commandResponse);
return {};
}
Return<void> RadioResponse::sendEnvelopeWithStatusResponse(const V1_0::RadioResponseInfo& info,
const V1_0::IccIoResult& iccIo) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->sendEnvelopeWithStatusResponse(toAidl(info), toAidl(iccIo));
+ simCb()->sendEnvelopeWithStatusResponse(toAidl(info), toAidl(iccIo));
return {};
}
Return<void> RadioResponse::sendTerminalResponseToSimResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->sendTerminalResponseToSimResponse(toAidl(info));
+ simCb()->sendTerminalResponseToSimResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setAllowedCarriersResponse(const V1_0::RadioResponseInfo& info,
int32_t numAllowed) {
LOG_CALL << info.serial << ' ' << numAllowed;
- CHECK_CB(mSimCb);
- mSimCb->setAllowedCarriersResponse(toAidl(info));
+ simCb()->setAllowedCarriersResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setAllowedCarriersResponse_1_4(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->setAllowedCarriersResponse(toAidl(info));
+ simCb()->setAllowedCarriersResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setCarrierInfoForImsiEncryptionResponse(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->setCarrierInfoForImsiEncryptionResponse(toAidl(info));
+ simCb()->setCarrierInfoForImsiEncryptionResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setCdmaSubscriptionSourceResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->setCdmaSubscriptionSourceResponse(toAidl(info));
+ simCb()->setCdmaSubscriptionSourceResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setFacilityLockForAppResponse(const V1_0::RadioResponseInfo& info,
int32_t retry) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->setFacilityLockForAppResponse(toAidl(info), retry);
+ simCb()->setFacilityLockForAppResponse(toAidl(info), retry);
return {};
}
Return<void> RadioResponse::setSimCardPowerResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->setSimCardPowerResponse(toAidl(info));
+ simCb()->setSimCardPowerResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setSimCardPowerResponse_1_1(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->setSimCardPowerResponse(toAidl(info));
+ simCb()->setSimCardPowerResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setSimCardPowerResponse_1_6(const V1_6::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->setSimCardPowerResponse(toAidl(info));
+ simCb()->setSimCardPowerResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setUiccSubscriptionResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->setUiccSubscriptionResponse(toAidl(info));
+ simCb()->setUiccSubscriptionResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::supplyIccPin2ForAppResponse(const V1_0::RadioResponseInfo& info,
int32_t remainingRetries) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->supplyIccPin2ForAppResponse(toAidl(info), remainingRetries);
+ simCb()->supplyIccPin2ForAppResponse(toAidl(info), remainingRetries);
return {};
}
Return<void> RadioResponse::supplyIccPinForAppResponse(const V1_0::RadioResponseInfo& info,
int32_t remainingRetries) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->supplyIccPinForAppResponse(toAidl(info), remainingRetries);
+ simCb()->supplyIccPinForAppResponse(toAidl(info), remainingRetries);
return {};
}
Return<void> RadioResponse::supplyIccPuk2ForAppResponse(const V1_0::RadioResponseInfo& info,
int32_t remainingRetries) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->supplyIccPuk2ForAppResponse(toAidl(info), remainingRetries);
+ simCb()->supplyIccPuk2ForAppResponse(toAidl(info), remainingRetries);
return {};
}
Return<void> RadioResponse::supplyIccPukForAppResponse(const V1_0::RadioResponseInfo& info,
int32_t remainingRetries) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->supplyIccPukForAppResponse(toAidl(info), remainingRetries);
+ simCb()->supplyIccPukForAppResponse(toAidl(info), remainingRetries);
return {};
}
@@ -350,16 +314,14 @@
V1_5::PersoSubstate persoType,
int32_t rRet) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->supplySimDepersonalizationResponse(toAidl(info), aidl::PersoSubstate(persoType), rRet);
+ simCb()->supplySimDepersonalizationResponse(toAidl(info), aidl::PersoSubstate(persoType), rRet);
return {};
}
Return<void> RadioResponse::updateSimPhonebookRecordsResponse(const V1_6::RadioResponseInfo& info,
int32_t updatedRecordIndex) {
LOG_CALL << info.serial;
- CHECK_CB(mSimCb);
- mSimCb->updateSimPhonebookRecordsResponse(toAidl(info), updatedRecordIndex);
+ simCb()->updateSimPhonebookRecordsResponse(toAidl(info), updatedRecordIndex);
return {};
}
diff --git a/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp b/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp
index ca27918..b43f64f 100644
--- a/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp
+++ b/radio/aidl/compat/libradiocompat/sim/RadioSim.cpp
@@ -30,6 +30,10 @@
namespace aidl = ::aidl::android::hardware::radio::sim;
constexpr auto ok = &ScopedAStatus::ok;
+std::shared_ptr<aidl::IRadioSimResponse> RadioSim::respond() {
+ return mCallbackManager->response().simCb();
+}
+
ScopedAStatus RadioSim::areUiccApplicationsEnabled(int32_t serial) {
LOG_CALL << serial;
mHal1_5->areUiccApplicationsEnabled(serial);
@@ -58,7 +62,7 @@
ScopedAStatus RadioSim::getAllowedCarriers(int32_t serial) {
LOG_CALL << serial;
- mHal1_5->getAllowedCarriers(serial);
+ mHal1_5->getAllowedCarriers_1_4(serial);
return ok();
}
@@ -99,7 +103,7 @@
if (mHal1_6) {
mHal1_6->getSimPhonebookCapacity(serial);
} else {
- respond().getSimPhonebookCapacityResponse(notSupported(serial), {});
+ respond()->getSimPhonebookCapacityResponse(notSupported(serial), {});
}
return ok();
}
@@ -109,7 +113,7 @@
if (mHal1_6) {
mHal1_6->getSimPhonebookRecords(serial);
} else {
- respond().getSimPhonebookRecordsResponse(notSupported(serial));
+ respond()->getSimPhonebookRecordsResponse(notSupported(serial));
}
return ok();
}
@@ -217,16 +221,10 @@
}
ScopedAStatus RadioSim::setResponseFunctions(
- const std::shared_ptr<aidl::IRadioSimResponse>& simResponse,
- const std::shared_ptr<aidl::IRadioSimIndication>& simIndication) {
- LOG_CALL << simResponse << ' ' << simIndication;
-
- CHECK(simResponse);
- CHECK(simIndication);
-
- mRadioResponse->setResponseFunction(simResponse);
- mRadioIndication->setResponseFunction(simIndication);
-
+ const std::shared_ptr<aidl::IRadioSimResponse>& response,
+ const std::shared_ptr<aidl::IRadioSimIndication>& indication) {
+ LOG_CALL << response << ' ' << indication;
+ mCallbackManager->setResponseFunctions(response, indication);
return ok();
}
@@ -287,7 +285,7 @@
if (mHal1_6) {
mHal1_6->updateSimPhonebookRecords(serial, toHidl(recordInfo));
} else {
- respond().updateSimPhonebookRecordsResponse(notSupported(serial), 0);
+ respond()->updateSimPhonebookRecordsResponse(notSupported(serial), 0);
}
return ok();
}
diff --git a/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp
index 6d9bda8..359fce0 100644
--- a/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp
+++ b/radio/aidl/compat/libradiocompat/voice/RadioIndication-voice.cpp
@@ -29,113 +29,102 @@
namespace aidl = ::aidl::android::hardware::radio::voice;
void RadioIndication::setResponseFunction(std::shared_ptr<aidl::IRadioVoiceIndication> voiceCb) {
- CHECK(voiceCb);
mVoiceCb = voiceCb;
}
+std::shared_ptr<aidl::IRadioVoiceIndication> RadioIndication::voiceCb() {
+ return mVoiceCb.get();
+}
+
Return<void> RadioIndication::callRing(V1_0::RadioIndicationType type, bool isGsm,
const V1_0::CdmaSignalInfoRecord& record) {
LOG_CALL << type;
- CHECK_CB(mVoiceCb);
- mVoiceCb->callRing(toAidl(type), isGsm, toAidl(record));
+ voiceCb()->callRing(toAidl(type), isGsm, toAidl(record));
return {};
}
Return<void> RadioIndication::callStateChanged(V1_0::RadioIndicationType type) {
LOG_CALL << type;
- CHECK_CB(mVoiceCb);
- mVoiceCb->callStateChanged(toAidl(type));
+ voiceCb()->callStateChanged(toAidl(type));
return {};
}
Return<void> RadioIndication::cdmaCallWaiting(V1_0::RadioIndicationType type,
const V1_0::CdmaCallWaiting& callWaitingRecord) {
LOG_CALL << type;
- CHECK_CB(mVoiceCb);
- mVoiceCb->cdmaCallWaiting(toAidl(type), toAidl(callWaitingRecord));
+ voiceCb()->cdmaCallWaiting(toAidl(type), toAidl(callWaitingRecord));
return {};
}
Return<void> RadioIndication::cdmaInfoRec(V1_0::RadioIndicationType type,
const V1_0::CdmaInformationRecords& records) {
LOG_CALL << type;
- CHECK_CB(mVoiceCb);
- mVoiceCb->cdmaInfoRec(toAidl(type), toAidl(records.infoRec));
+ voiceCb()->cdmaInfoRec(toAidl(type), toAidl(records.infoRec));
return {};
}
Return<void> RadioIndication::cdmaOtaProvisionStatus(V1_0::RadioIndicationType type,
V1_0::CdmaOtaProvisionStatus status) {
LOG_CALL << type;
- CHECK_CB(mVoiceCb);
- mVoiceCb->cdmaOtaProvisionStatus(toAidl(type), aidl::CdmaOtaProvisionStatus(status));
+ voiceCb()->cdmaOtaProvisionStatus(toAidl(type), aidl::CdmaOtaProvisionStatus(status));
return {};
}
Return<void> RadioIndication::currentEmergencyNumberList(
V1_0::RadioIndicationType type, const hidl_vec<V1_4::EmergencyNumber>& emergencyNumbers) {
LOG_CALL << type;
- CHECK_CB(mVoiceCb);
- mVoiceCb->currentEmergencyNumberList(toAidl(type), toAidl(emergencyNumbers));
+ voiceCb()->currentEmergencyNumberList(toAidl(type), toAidl(emergencyNumbers));
return {};
}
Return<void> RadioIndication::enterEmergencyCallbackMode(V1_0::RadioIndicationType type) {
LOG_CALL << type;
- CHECK_CB(mVoiceCb);
- mVoiceCb->enterEmergencyCallbackMode(toAidl(type));
+ voiceCb()->enterEmergencyCallbackMode(toAidl(type));
return {};
}
Return<void> RadioIndication::exitEmergencyCallbackMode(V1_0::RadioIndicationType type) {
LOG_CALL << type;
- CHECK_CB(mVoiceCb);
- mVoiceCb->exitEmergencyCallbackMode(toAidl(type));
+ voiceCb()->exitEmergencyCallbackMode(toAidl(type));
return {};
}
Return<void> RadioIndication::indicateRingbackTone(V1_0::RadioIndicationType type, bool start) {
LOG_CALL << type;
- CHECK_CB(mVoiceCb);
- mVoiceCb->indicateRingbackTone(toAidl(type), start);
+ voiceCb()->indicateRingbackTone(toAidl(type), start);
return {};
}
Return<void> RadioIndication::onSupplementaryServiceIndication(V1_0::RadioIndicationType type,
const V1_0::StkCcUnsolSsResult& ss) {
LOG_CALL << type;
- CHECK_CB(mVoiceCb);
- mVoiceCb->onSupplementaryServiceIndication(toAidl(type), toAidl(ss));
+ voiceCb()->onSupplementaryServiceIndication(toAidl(type), toAidl(ss));
return {};
}
Return<void> RadioIndication::resendIncallMute(V1_0::RadioIndicationType type) {
LOG_CALL << type;
- CHECK_CB(mVoiceCb);
- mVoiceCb->resendIncallMute(toAidl(type));
+ voiceCb()->resendIncallMute(toAidl(type));
return {};
}
Return<void> RadioIndication::srvccStateNotify(V1_0::RadioIndicationType type,
V1_0::SrvccState state) {
LOG_CALL << type;
- CHECK_CB(mVoiceCb);
- mVoiceCb->srvccStateNotify(toAidl(type), aidl::SrvccState(state));
+ voiceCb()->srvccStateNotify(toAidl(type), aidl::SrvccState(state));
return {};
}
Return<void> RadioIndication::stkCallControlAlphaNotify(V1_0::RadioIndicationType type,
const hidl_string& alpha) {
LOG_CALL << type;
- CHECK_CB(mVoiceCb);
- mVoiceCb->stkCallControlAlphaNotify(toAidl(type), alpha);
+ voiceCb()->stkCallControlAlphaNotify(toAidl(type), alpha);
return {};
}
Return<void> RadioIndication::stkCallSetup(V1_0::RadioIndicationType type, int64_t timeout) {
LOG_CALL << type;
- CHECK_CB(mVoiceCb);
- mVoiceCb->stkCallSetup(toAidl(type), timeout);
+ voiceCb()->stkCallSetup(toAidl(type), timeout);
return {};
}
diff --git a/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp
index 0a64c56..d233548 100644
--- a/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp
+++ b/radio/aidl/compat/libradiocompat/voice/RadioResponse-voice.cpp
@@ -29,265 +29,233 @@
namespace aidl = ::aidl::android::hardware::radio::voice;
void RadioResponse::setResponseFunction(std::shared_ptr<aidl::IRadioVoiceResponse> voiceCb) {
- CHECK(voiceCb);
mVoiceCb = voiceCb;
}
+std::shared_ptr<aidl::IRadioVoiceResponse> RadioResponse::voiceCb() {
+ return mVoiceCb.get();
+}
+
Return<void> RadioResponse::acceptCallResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->acceptCallResponse(toAidl(info));
+ voiceCb()->acceptCallResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::conferenceResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->conferenceResponse(toAidl(info));
+ voiceCb()->conferenceResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::dialResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->dialResponse(toAidl(info));
+ voiceCb()->dialResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::emergencyDialResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->emergencyDialResponse(toAidl(info));
+ voiceCb()->emergencyDialResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::exitEmergencyCallbackModeResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->exitEmergencyCallbackModeResponse(toAidl(info));
+ voiceCb()->exitEmergencyCallbackModeResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::explicitCallTransferResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->explicitCallTransferResponse(toAidl(info));
+ voiceCb()->explicitCallTransferResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::getCallForwardStatusResponse(
const V1_0::RadioResponseInfo& info, const hidl_vec<V1_0::CallForwardInfo>& callFwdInfos) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->getCallForwardStatusResponse(toAidl(info), toAidl(callFwdInfos));
+ voiceCb()->getCallForwardStatusResponse(toAidl(info), toAidl(callFwdInfos));
return {};
}
Return<void> RadioResponse::getCallWaitingResponse(const V1_0::RadioResponseInfo& info, bool enable,
int32_t serviceClass) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->getCallWaitingResponse(toAidl(info), enable, serviceClass);
+ voiceCb()->getCallWaitingResponse(toAidl(info), enable, serviceClass);
return {};
}
Return<void> RadioResponse::getClipResponse(const V1_0::RadioResponseInfo& info,
V1_0::ClipStatus status) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->getClipResponse(toAidl(info), aidl::ClipStatus(status));
+ voiceCb()->getClipResponse(toAidl(info), aidl::ClipStatus(status));
return {};
}
Return<void> RadioResponse::getClirResponse(const V1_0::RadioResponseInfo& info, int32_t n,
int32_t m) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->getClirResponse(toAidl(info), n, m);
+ voiceCb()->getClirResponse(toAidl(info), n, m);
return {};
}
Return<void> RadioResponse::getCurrentCallsResponse(const V1_0::RadioResponseInfo& info,
const hidl_vec<V1_0::Call>& calls) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->getCurrentCallsResponse(toAidl(info), toAidl(calls));
+ voiceCb()->getCurrentCallsResponse(toAidl(info), toAidl(calls));
return {};
}
Return<void> RadioResponse::getCurrentCallsResponse_1_2(const V1_0::RadioResponseInfo& info,
const hidl_vec<V1_2::Call>& calls) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->getCurrentCallsResponse(toAidl(info), toAidl(calls));
+ voiceCb()->getCurrentCallsResponse(toAidl(info), toAidl(calls));
return {};
}
Return<void> RadioResponse::getCurrentCallsResponse_1_6(const V1_6::RadioResponseInfo& info,
const hidl_vec<V1_6::Call>& calls) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->getCurrentCallsResponse(toAidl(info), toAidl(calls));
+ voiceCb()->getCurrentCallsResponse(toAidl(info), toAidl(calls));
return {};
}
Return<void> RadioResponse::getLastCallFailCauseResponse(
const V1_0::RadioResponseInfo& info, const V1_0::LastCallFailCauseInfo& failCauseinfo) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->getLastCallFailCauseResponse(toAidl(info), toAidl(failCauseinfo));
+ voiceCb()->getLastCallFailCauseResponse(toAidl(info), toAidl(failCauseinfo));
return {};
}
Return<void> RadioResponse::getMuteResponse(const V1_0::RadioResponseInfo& info, bool enable) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->getMuteResponse(toAidl(info), enable);
+ voiceCb()->getMuteResponse(toAidl(info), enable);
return {};
}
Return<void> RadioResponse::getPreferredVoicePrivacyResponse(const V1_0::RadioResponseInfo& info,
bool enable) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->getPreferredVoicePrivacyResponse(toAidl(info), enable);
+ voiceCb()->getPreferredVoicePrivacyResponse(toAidl(info), enable);
return {};
}
Return<void> RadioResponse::getTTYModeResponse(const V1_0::RadioResponseInfo& info,
V1_0::TtyMode mode) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->getTtyModeResponse(toAidl(info), aidl::TtyMode(mode));
+ voiceCb()->getTtyModeResponse(toAidl(info), aidl::TtyMode(mode));
return {};
}
Return<void> RadioResponse::handleStkCallSetupRequestFromSimResponse(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->handleStkCallSetupRequestFromSimResponse(toAidl(info));
+ voiceCb()->handleStkCallSetupRequestFromSimResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::hangupConnectionResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->hangupConnectionResponse(toAidl(info));
+ voiceCb()->hangupConnectionResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::hangupForegroundResumeBackgroundResponse(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->hangupForegroundResumeBackgroundResponse(toAidl(info));
+ voiceCb()->hangupForegroundResumeBackgroundResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::hangupWaitingOrBackgroundResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->hangupWaitingOrBackgroundResponse(toAidl(info));
+ voiceCb()->hangupWaitingOrBackgroundResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::rejectCallResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->rejectCallResponse(toAidl(info));
+ voiceCb()->rejectCallResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::sendBurstDtmfResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->sendBurstDtmfResponse(toAidl(info));
+ voiceCb()->sendBurstDtmfResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::sendCDMAFeatureCodeResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->sendCdmaFeatureCodeResponse(toAidl(info));
+ voiceCb()->sendCdmaFeatureCodeResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::sendDtmfResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->sendDtmfResponse(toAidl(info));
+ voiceCb()->sendDtmfResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::separateConnectionResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->separateConnectionResponse(toAidl(info));
+ voiceCb()->separateConnectionResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setCallForwardResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->setCallForwardResponse(toAidl(info));
+ voiceCb()->setCallForwardResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setCallWaitingResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->setCallWaitingResponse(toAidl(info));
+ voiceCb()->setCallWaitingResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setClirResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->setClirResponse(toAidl(info));
+ voiceCb()->setClirResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setMuteResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->setMuteResponse(toAidl(info));
+ voiceCb()->setMuteResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setPreferredVoicePrivacyResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->setPreferredVoicePrivacyResponse(toAidl(info));
+ voiceCb()->setPreferredVoicePrivacyResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::setTTYModeResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->setTtyModeResponse(toAidl(info));
+ voiceCb()->setTtyModeResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::startDtmfResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->startDtmfResponse(toAidl(info));
+ voiceCb()->startDtmfResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::stopDtmfResponse(const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->stopDtmfResponse(toAidl(info));
+ voiceCb()->stopDtmfResponse(toAidl(info));
return {};
}
Return<void> RadioResponse::switchWaitingOrHoldingAndActiveResponse(
const V1_0::RadioResponseInfo& info) {
LOG_CALL << info.serial;
- CHECK_CB(mVoiceCb);
- mVoiceCb->switchWaitingOrHoldingAndActiveResponse(toAidl(info));
+ voiceCb()->switchWaitingOrHoldingAndActiveResponse(toAidl(info));
return {};
}
diff --git a/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp b/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp
index 16c6b14..7b1d1fa 100644
--- a/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp
+++ b/radio/aidl/compat/libradiocompat/voice/RadioVoice.cpp
@@ -30,6 +30,10 @@
namespace aidl = ::aidl::android::hardware::radio::voice;
constexpr auto ok = &ScopedAStatus::ok;
+std::shared_ptr<aidl::IRadioVoiceResponse> RadioVoice::respond() {
+ return mCallbackManager->response().voiceCb();
+}
+
ScopedAStatus RadioVoice::acceptCall(int32_t serial) {
LOG_CALL << serial;
mHal1_5->acceptCall(serial);
@@ -49,13 +53,19 @@
}
ScopedAStatus RadioVoice::emergencyDial( //
- int32_t serial, const aidl::Dial& dialInfo, aidl::EmergencyServiceCategory categories,
+ int32_t serial, const aidl::Dial& info, aidl::EmergencyServiceCategory categories,
const std::vector<std::string>& urns, aidl::EmergencyCallRouting routing,
- bool hasKnownUserIntentEmerg, bool isTesting) {
+ bool knownUserIntentEmerg, bool isTesting) {
LOG_CALL << serial;
- mHal1_5->emergencyDial(serial, toHidl(dialInfo),
- toHidlBitfield<V1_4::EmergencyServiceCategory>(categories), toHidl(urns),
- V1_4::EmergencyCallRouting(routing), hasKnownUserIntentEmerg, isTesting);
+ if (mHal1_6) {
+ mHal1_6->emergencyDial_1_6( //
+ serial, toHidl(info), toHidlBitfield<V1_4::EmergencyServiceCategory>(categories),
+ toHidl(urns), V1_4::EmergencyCallRouting(routing), knownUserIntentEmerg, isTesting);
+ } else {
+ mHal1_5->emergencyDial( //
+ serial, toHidl(info), toHidlBitfield<V1_4::EmergencyServiceCategory>(categories),
+ toHidl(urns), V1_4::EmergencyCallRouting(routing), knownUserIntentEmerg, isTesting);
+ }
return ok();
}
@@ -98,7 +108,11 @@
ScopedAStatus RadioVoice::getCurrentCalls(int32_t serial) {
LOG_CALL << serial;
- mHal1_5->getCurrentCalls(serial);
+ if (mHal1_6) {
+ mHal1_6->getCurrentCalls_1_6(serial);
+ } else {
+ mHal1_5->getCurrentCalls(serial);
+ }
return ok();
}
@@ -152,7 +166,7 @@
ScopedAStatus RadioVoice::isVoNrEnabled(int32_t serial) {
LOG_CALL << serial;
- // TODO(b/203699028): can't call isVoNrEnabledResponse with 1.6 callback
+ respond()->isVoNrEnabledResponse(notSupported(serial), false);
return ok();
}
@@ -224,16 +238,10 @@
}
ScopedAStatus RadioVoice::setResponseFunctions(
- const std::shared_ptr<aidl::IRadioVoiceResponse>& voiceResponse,
- const std::shared_ptr<aidl::IRadioVoiceIndication>& voiceIndication) {
- LOG_CALL << voiceResponse << ' ' << voiceIndication;
-
- CHECK(voiceResponse);
- CHECK(voiceIndication);
-
- mRadioResponse->setResponseFunction(voiceResponse);
- mRadioIndication->setResponseFunction(voiceIndication);
-
+ const std::shared_ptr<aidl::IRadioVoiceResponse>& response,
+ const std::shared_ptr<aidl::IRadioVoiceIndication>& indication) {
+ LOG_CALL << response << ' ' << indication;
+ mCallbackManager->setResponseFunctions(response, indication);
return ok();
}
@@ -245,7 +253,8 @@
ndk::ScopedAStatus RadioVoice::setVoNrEnabled(int32_t serial, [[maybe_unused]] bool enable) {
LOG_CALL << serial;
- // TODO(b/203699028): should set `persist.radio.is_vonr_enabled_` property instead
+ // Note: a workaround for older HALs could also be setting persist.radio.is_vonr_enabled_
+ respond()->setVoNrEnabledResponse(notSupported(serial));
return ok();
}
diff --git a/radio/aidl/compat/service/service.cpp b/radio/aidl/compat/service/service.cpp
index 2a67569..8af05de 100644
--- a/radio/aidl/compat/service/service.cpp
+++ b/radio/aidl/compat/service/service.cpp
@@ -19,13 +19,12 @@
#include <android-base/logging.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
+#include <libradiocompat/CallbackManager.h>
#include <libradiocompat/RadioConfig.h>
#include <libradiocompat/RadioData.h>
-#include <libradiocompat/RadioIndication.h>
#include <libradiocompat/RadioMessaging.h>
#include <libradiocompat/RadioModem.h>
#include <libradiocompat/RadioNetwork.h>
-#include <libradiocompat/RadioResponse.h>
#include <libradiocompat/RadioSim.h>
#include <libradiocompat/RadioVoice.h>
@@ -36,8 +35,8 @@
static std::vector<std::shared_ptr<ndk::ICInterface>> gPublishedHals;
template <typename T>
-static void publishRadioHal(sp<V1_5::IRadio> hidlHal, sp<compat::RadioResponse> responseCb,
- sp<compat::RadioIndication> indicationCb, const std::string& slot) {
+static void publishRadioHal(std::shared_ptr<compat::DriverContext> ctx, sp<V1_5::IRadio> hidlHal,
+ std::shared_ptr<compat::CallbackManager> cm, const std::string& slot) {
const auto instance = T::descriptor + "/"s + slot;
if (!AServiceManager_isDeclared(instance.c_str())) {
LOG(INFO) << instance << " is not declared in VINTF (this may be intentional)";
@@ -45,7 +44,7 @@
}
LOG(DEBUG) << "Publishing " << instance;
- auto aidlHal = ndk::SharedRefBase::make<T>(hidlHal, responseCb, indicationCb);
+ auto aidlHal = ndk::SharedRefBase::make<T>(ctx, hidlHal, cm);
gPublishedHals.push_back(aidlHal);
const auto status = AServiceManager_addService(aidlHal->asBinder().get(), instance.c_str());
CHECK_EQ(status, STATUS_OK);
@@ -57,16 +56,15 @@
hidl_utils::linkDeathToDeath(radioHidl);
- auto responseCb = sp<compat::RadioResponse>::make();
- auto indicationCb = sp<compat::RadioIndication>::make();
- radioHidl->setResponseFunctions(responseCb, indicationCb).assertOk();
+ auto context = std::make_shared<compat::DriverContext>();
+ auto callbackMgr = std::make_shared<compat::CallbackManager>(context, radioHidl);
- publishRadioHal<compat::RadioData>(radioHidl, responseCb, indicationCb, slot);
- publishRadioHal<compat::RadioMessaging>(radioHidl, responseCb, indicationCb, slot);
- publishRadioHal<compat::RadioModem>(radioHidl, responseCb, indicationCb, slot);
- publishRadioHal<compat::RadioNetwork>(radioHidl, responseCb, indicationCb, slot);
- publishRadioHal<compat::RadioSim>(radioHidl, responseCb, indicationCb, slot);
- publishRadioHal<compat::RadioVoice>(radioHidl, responseCb, indicationCb, slot);
+ publishRadioHal<compat::RadioData>(context, radioHidl, callbackMgr, slot);
+ publishRadioHal<compat::RadioMessaging>(context, radioHidl, callbackMgr, slot);
+ publishRadioHal<compat::RadioModem>(context, radioHidl, callbackMgr, slot);
+ publishRadioHal<compat::RadioNetwork>(context, radioHidl, callbackMgr, slot);
+ publishRadioHal<compat::RadioSim>(context, radioHidl, callbackMgr, slot);
+ publishRadioHal<compat::RadioVoice>(context, radioHidl, callbackMgr, slot);
}
static void publishRadioConfig() {
@@ -83,6 +81,7 @@
}
static void main() {
+ base::InitLogging(nullptr, base::LogdLogger(base::RADIO));
base::SetDefaultTag("radiocompat");
base::SetMinimumLogSeverity(base::VERBOSE);
LOG(DEBUG) << "Radio HAL compat service starting...";
diff --git a/radio/aidl/vts/Android.bp b/radio/aidl/vts/Android.bp
new file mode 100644
index 0000000..935d2e5
--- /dev/null
+++ b/radio/aidl/vts/Android.bp
@@ -0,0 +1,71 @@
+// Copyright 2021 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 {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_test {
+ name: "VtsHalRadioTargetTest",
+ defaults: [
+ "VtsHalTargetTestDefaults",
+ "use_libaidlvintf_gtest_helper_static",
+ ],
+ srcs: [
+ "radio_aidl_hal_utils.cpp",
+ "radio_data_indication.cpp",
+ "radio_data_response.cpp",
+ "radio_data_test.cpp",
+ "radio_messaging_indication.cpp",
+ "radio_messaging_response.cpp",
+ "radio_messaging_test.cpp",
+ "radio_modem_indication.cpp",
+ "radio_modem_response.cpp",
+ "radio_modem_test.cpp",
+ "radio_network_indication.cpp",
+ "radio_network_response.cpp",
+ "radio_network_test.cpp",
+ "radio_sim_indication.cpp",
+ "radio_sim_response.cpp",
+ "radio_sim_test.cpp",
+ "radio_voice_indication.cpp",
+ "radio_voice_response.cpp",
+ "radio_voice_test.cpp",
+ "VtsHalRadioTargetTest.cpp",
+ ],
+ shared_libs: [
+ "libbinder_ndk",
+ "libvintf",
+ ],
+ static_libs: [
+ "android.hardware.radio-V1-ndk",
+ "android.hardware.radio.config-V1-ndk",
+ "android.hardware.radio.data-V1-ndk",
+ "android.hardware.radio.messaging-V1-ndk",
+ "android.hardware.radio.modem-V1-ndk",
+ "android.hardware.radio.network-V1-ndk",
+ "android.hardware.radio.sim-V1-ndk",
+ "android.hardware.radio.voice-V1-ndk",
+ ],
+ // TODO(b/210712359): enable after b/207695009 is resolved.
+ //test_suites: [
+ // "general-tests",
+ // "vts",
+ //],
+}
diff --git a/radio/aidl/vts/VtsHalRadioTargetTest.cpp b/radio/aidl/vts/VtsHalRadioTargetTest.cpp
new file mode 100644
index 0000000..e829f8e
--- /dev/null
+++ b/radio/aidl/vts/VtsHalRadioTargetTest.cpp
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android/binder_process.h>
+
+#include "radio_data_utils.h"
+#include "radio_messaging_utils.h"
+#include "radio_modem_utils.h"
+#include "radio_network_utils.h"
+#include "radio_sim_utils.h"
+#include "radio_voice_utils.h"
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioDataTest);
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, RadioDataTest,
+ testing::ValuesIn(android::getAidlHalInstanceNames(IRadioData::descriptor)),
+ android::PrintInstanceNameToString);
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioMessagingTest);
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, RadioMessagingTest,
+ testing::ValuesIn(android::getAidlHalInstanceNames(IRadioMessaging::descriptor)),
+ android::PrintInstanceNameToString);
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioModemTest);
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, RadioModemTest,
+ testing::ValuesIn(android::getAidlHalInstanceNames(IRadioModem::descriptor)),
+ android::PrintInstanceNameToString);
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioNetworkTest);
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, RadioNetworkTest,
+ testing::ValuesIn(android::getAidlHalInstanceNames(IRadioNetwork::descriptor)),
+ android::PrintInstanceNameToString);
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioSimTest);
+INSTANTIATE_TEST_SUITE_P(PerInstance, RadioSimTest,
+ testing::ValuesIn(android::getAidlHalInstanceNames(IRadioSim::descriptor)),
+ android::PrintInstanceNameToString);
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioVoiceTest);
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, RadioVoiceTest,
+ testing::ValuesIn(android::getAidlHalInstanceNames(IRadioVoice::descriptor)),
+ android::PrintInstanceNameToString);
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ ABinderProcess_setThreadPoolMaxThreadCount(1);
+ ABinderProcess_startThreadPool();
+ return RUN_ALL_TESTS();
+}
diff --git a/radio/aidl/vts/radio_aidl_hal_utils.cpp b/radio/aidl/vts/radio_aidl_hal_utils.cpp
new file mode 100644
index 0000000..14a16c0
--- /dev/null
+++ b/radio/aidl/vts/radio_aidl_hal_utils.cpp
@@ -0,0 +1,176 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+#define LOG_TAG "RadioTest"
+
+#include "radio_aidl_hal_utils.h"
+#include <iostream>
+#include "VtsCoreUtil.h"
+
+using namespace aidl::android::hardware::radio::network;
+
+#define WAIT_TIMEOUT_PERIOD 75
+
+aidl::android::hardware::radio::sim::CardStatus cardStatus = {};
+
+int GetRandomSerialNumber() {
+ return rand();
+}
+
+::testing::AssertionResult CheckAnyOfErrors(RadioError err, std::vector<RadioError> errors,
+ CheckFlag flag) {
+ const static std::vector<RadioError> generalErrors = {
+ RadioError::RADIO_NOT_AVAILABLE, RadioError::NO_MEMORY,
+ RadioError::INTERNAL_ERR, RadioError::SYSTEM_ERR,
+ RadioError::REQUEST_NOT_SUPPORTED, RadioError::CANCELLED};
+ if (flag == CHECK_GENERAL_ERROR || flag == CHECK_OEM_AND_GENERAL_ERROR) {
+ for (size_t i = 0; i < generalErrors.size(); i++) {
+ if (err == generalErrors[i]) {
+ return testing::AssertionSuccess();
+ }
+ }
+ }
+ if (flag == CHECK_OEM_ERROR || flag == CHECK_OEM_AND_GENERAL_ERROR) {
+ if (err >= RadioError::OEM_ERROR_1 && err <= RadioError::OEM_ERROR_25) {
+ return testing::AssertionSuccess();
+ }
+ }
+ for (size_t i = 0; i < errors.size(); i++) {
+ if (err == errors[i]) {
+ return testing::AssertionSuccess();
+ }
+ }
+ return testing::AssertionFailure() << "RadioError:" + toString(err) + " is returned";
+}
+
+// Runs "pm list features" and attempts to find the specified feature in its output.
+bool deviceSupportsFeature(const char* feature) {
+ bool hasFeature = false;
+ FILE* p = popen("/system/bin/pm list features", "re");
+ if (p) {
+ char* line = NULL;
+ size_t len = 0;
+ while (getline(&line, &len, p) > 0) {
+ if (strstr(line, feature)) {
+ hasFeature = true;
+ break;
+ }
+ }
+ pclose(p);
+ } else {
+ __android_log_print(ANDROID_LOG_FATAL, LOG_TAG, "popen failed: %d", errno);
+ _exit(EXIT_FAILURE);
+ }
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "Feature %s: %ssupported", feature,
+ hasFeature ? "" : "not ");
+ return hasFeature;
+}
+
+bool isSsSsEnabled() {
+ // Do not use checkSubstringInCommandOutput("getprop persist.radio.multisim.config", "")
+ // until b/148904287 is fixed. We need exact matching instead of partial matching. (i.e.
+ // by definition the empty string "" is a substring of any string).
+ return !isDsDsEnabled() && !isTsTsEnabled();
+}
+
+bool isDsDsEnabled() {
+ return testing::checkSubstringInCommandOutput("getprop persist.radio.multisim.config", "dsds");
+}
+
+bool isTsTsEnabled() {
+ return testing::checkSubstringInCommandOutput("getprop persist.radio.multisim.config", "tsts");
+}
+
+bool isVoiceInService(RegState state) {
+ return RegState::REG_HOME == state || RegState::REG_ROAMING == state;
+}
+
+bool isVoiceEmergencyOnly(RegState state) {
+ return RegState::NOT_REG_MT_NOT_SEARCHING_OP_EM == state ||
+ RegState::NOT_REG_MT_SEARCHING_OP_EM == state || RegState::REG_DENIED_EM == state ||
+ RegState::UNKNOWN_EM == state;
+}
+
+bool isServiceValidForDeviceConfiguration(std::string& serviceName) {
+ if (isSsSsEnabled()) {
+ // Device is configured as SSSS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME) {
+ ALOGI("%s instance is not valid for SSSS device.", serviceName.c_str());
+ return false;
+ }
+ } else if (isDsDsEnabled()) {
+ // Device is configured as DSDS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME) {
+ ALOGI("%s instance is not valid for DSDS device.", serviceName.c_str());
+ return false;
+ }
+ } else if (isTsTsEnabled()) {
+ // Device is configured as TSTS.
+ if (serviceName != RADIO_SERVICE_SLOT1_NAME && serviceName != RADIO_SERVICE_SLOT2_NAME &&
+ serviceName != RADIO_SERVICE_SLOT3_NAME) {
+ ALOGI("%s instance is not valid for TSTS device.", serviceName.c_str());
+ return false;
+ }
+ }
+ return true;
+}
+
+/*
+ * Notify that the response message is received.
+ */
+void RadioResponseWaiter::notify(int receivedSerial) {
+ std::unique_lock<std::mutex> lock(mtx_);
+ if (serial == receivedSerial) {
+ count_++;
+ cv_.notify_one();
+ }
+}
+
+/*
+ * Wait till the response message is notified or till WAIT_TIMEOUT_PERIOD.
+ */
+std::cv_status RadioResponseWaiter::wait() {
+ std::unique_lock<std::mutex> lock(mtx_);
+ std::cv_status status = std::cv_status::no_timeout;
+ auto now = std::chrono::system_clock::now();
+ while (count_ == 0) {
+ status = cv_.wait_until(lock, now + std::chrono::seconds(WAIT_TIMEOUT_PERIOD));
+ if (status == std::cv_status::timeout) {
+ return status;
+ }
+ }
+ count_--;
+ return status;
+}
+
+/**
+ * Specific features on the Radio HAL rely on Radio HAL Capabilities.
+ * The VTS test related to those features must not run if the related capability is disabled.
+ * Typical usage within VTS: if (getRadioHalCapabilities()) return;
+ */
+bool RadioResponseWaiter::getRadioHalCapabilities() {
+ // TODO(b/210712359): implement after RadioConfig VTS is created
+ /**
+ // Get HalDeviceCapabilities from the radio config
+ std::shared_ptr<RadioConfigResponse> radioConfigRsp = new (std::nothrow)
+ RadioConfigResponse(*this); radioConfig->setResponseFunctions(radioConfigRsp, nullptr); serial =
+ GetRandomSerialNumber();
+
+ radioConfig->getHalDeviceCapabilities(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ return radioConfigRsp->modemReducedFeatureSet1;
+ **/
+ return true;
+}
\ No newline at end of file
diff --git a/radio/aidl/vts/radio_aidl_hal_utils.h b/radio/aidl/vts/radio_aidl_hal_utils.h
new file mode 100644
index 0000000..2f31fa8
--- /dev/null
+++ b/radio/aidl/vts/radio_aidl_hal_utils.h
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#pragma once
+
+#include <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/radio/RadioError.h>
+#include <aidl/android/hardware/radio/network/RegState.h>
+#include <aidl/android/hardware/radio/sim/CardStatus.h>
+#include <utils/Log.h>
+#include <vector>
+
+using namespace aidl::android::hardware::radio;
+using aidl::android::hardware::radio::sim::CardStatus;
+
+extern CardStatus cardStatus;
+
+/*
+ * MACRO used to skip test case when radio response return error REQUEST_NOT_SUPPORTED
+ * on HAL versions which has deprecated the request interfaces. The MACRO can only be used
+ * AFTER receiving radio response.
+ */
+#define SKIP_TEST_IF_REQUEST_NOT_SUPPORTED_WITH_HAL(__ver__, __radio__, __radioRsp__) \
+ do { \
+ sp<::android::hardware::radio::V##__ver__::IRadio> __radio = \
+ ::android::hardware::radio::V##__ver__::IRadio::castFrom(__radio__); \
+ if (__radio && __radioRsp__->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED) { \
+ GTEST_SKIP() << "REQUEST_NOT_SUPPORTED"; \
+ } \
+ } while (0)
+
+enum CheckFlag {
+ CHECK_DEFAULT = 0,
+ CHECK_GENERAL_ERROR = 1,
+ CHECK_OEM_ERROR = 2,
+ CHECK_OEM_AND_GENERAL_ERROR = 3,
+ CHECK_SAP_ERROR = 4,
+};
+
+static constexpr const char* FEATURE_VOICE_CALL = "android.software.connectionservice";
+
+static constexpr const char* FEATURE_TELEPHONY = "android.hardware.telephony";
+
+static constexpr const char* FEATURE_TELEPHONY_GSM = "android.hardware.telephony.gsm";
+
+static constexpr const char* FEATURE_TELEPHONY_CDMA = "android.hardware.telephony.cdma";
+
+#define MODEM_EMERGENCY_CALL_ESTABLISH_TIME 3
+#define MODEM_EMERGENCY_CALL_DISCONNECT_TIME 3
+#define MODEM_SET_SIM_POWER_DELAY_IN_SECONDS 2
+
+#define RADIO_SERVICE_SLOT1_NAME "slot1" // HAL instance name for SIM slot 1 or single SIM device
+#define RADIO_SERVICE_SLOT2_NAME "slot2" // HAL instance name for SIM slot 2 on dual SIM device
+#define RADIO_SERVICE_SLOT3_NAME "slot3" // HAL instance name for SIM slot 3 on triple SIM device
+
+/*
+ * Generate random serial number for radio test
+ */
+int GetRandomSerialNumber();
+
+/*
+ * Check multiple radio error codes which are possibly returned because of the different
+ * vendor/devices implementations. It allows optional checks for general errors or/and oem errors.
+ */
+::testing::AssertionResult CheckAnyOfErrors(RadioError err, std::vector<RadioError> generalError,
+ CheckFlag flag = CHECK_DEFAULT);
+
+/*
+ * Check if device supports feature.
+ */
+bool deviceSupportsFeature(const char* feature);
+
+/*
+ * Check if device is in SsSs (Single SIM Single Standby).
+ */
+bool isSsSsEnabled();
+
+/*
+ * Check if device is in DSDS (Dual SIM Dual Standby).
+ */
+bool isDsDsEnabled();
+
+/*
+ * Check if device is in TSTS (Triple SIM Triple Standby).
+ */
+bool isTsTsEnabled();
+
+/*
+ * Check if voice status is in emergency only.
+ */
+bool isVoiceEmergencyOnly(aidl::android::hardware::radio::network::RegState state);
+
+/*
+ * Check if voice status is in service.
+ */
+bool isVoiceInService(aidl::android::hardware::radio::network::RegState state);
+
+/*
+ * Check if service is valid for device configuration
+ */
+bool isServiceValidForDeviceConfiguration(std::string& serviceName);
+
+/**
+ * Used when waiting for an asynchronous response from the HAL.
+ */
+class RadioResponseWaiter {
+ protected:
+ std::mutex mtx_;
+ std::condition_variable cv_;
+ int count_;
+
+ public:
+ /* Serial number for radio request */
+ int serial;
+
+ /* Used as a mechanism to inform the test about data/event callback */
+ void notify(int receivedSerial);
+
+ /* Test code calls this function to wait for response */
+ std::cv_status wait();
+
+ // TODO(b/210712359): this probably isn't the best place to put this, but it works for now
+ // since all RadioXTest extend RadioResponseWaiter
+ /* Used to get the radio HAL capabilities */
+ bool getRadioHalCapabilities();
+};
diff --git a/radio/aidl/vts/radio_data_indication.cpp b/radio/aidl/vts/radio_data_indication.cpp
new file mode 100644
index 0000000..1e02fe1
--- /dev/null
+++ b/radio/aidl/vts/radio_data_indication.cpp
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "radio_data_utils.h"
+
+RadioDataIndication::RadioDataIndication(RadioDataTest& parent) : parent_data(parent) {}
+
+ndk::ScopedAStatus RadioDataIndication::dataCallListChanged(
+ RadioIndicationType /*type*/, const std::vector<SetupDataCallResult>& /*dcList*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioDataIndication::keepaliveStatus(RadioIndicationType /*type*/,
+ const KeepaliveStatus& /*status*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioDataIndication::pcoData(RadioIndicationType /*type*/,
+ const PcoDataInfo& /*pco*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioDataIndication::unthrottleApn(RadioIndicationType /*type*/,
+ const DataProfileInfo& /*dataProfileInfo*/) {
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_data_response.cpp b/radio/aidl/vts/radio_data_response.cpp
new file mode 100644
index 0000000..682ddfb
--- /dev/null
+++ b/radio/aidl/vts/radio_data_response.cpp
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "radio_data_utils.h"
+
+RadioDataResponse::RadioDataResponse(RadioResponseWaiter& parent) : parent_data(parent) {}
+
+ndk::ScopedAStatus RadioDataResponse::acknowledgeRequest(int32_t /*serial*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioDataResponse::allocatePduSessionIdResponse(const RadioResponseInfo& info,
+ int32_t id) {
+ rspInfo = info;
+ allocatedPduSessionId = id;
+ parent_data.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioDataResponse::cancelHandoverResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_data.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioDataResponse::deactivateDataCallResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioDataResponse::getDataCallListResponse(
+ const RadioResponseInfo& info, const std::vector<SetupDataCallResult>& /*dcResponse*/) {
+ rspInfo = info;
+ parent_data.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioDataResponse::getSlicingConfigResponse(
+ const RadioResponseInfo& info, const SlicingConfig& /*slicingConfig*/) {
+ rspInfo = info;
+ parent_data.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioDataResponse::releasePduSessionIdResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_data.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioDataResponse::setDataAllowedResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioDataResponse::setDataProfileResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioDataResponse::setDataThrottlingResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_data.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioDataResponse::setInitialAttachApnResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioDataResponse::setupDataCallResponse(const RadioResponseInfo& info,
+ const SetupDataCallResult& dcResponse) {
+ rspInfo = info;
+ setupDataCallResult = dcResponse;
+ parent_data.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioDataResponse::startHandoverResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_data.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioDataResponse::startKeepaliveResponse(const RadioResponseInfo& /*info*/,
+ const KeepaliveStatus& /*status*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioDataResponse::stopKeepaliveResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_data_test.cpp b/radio/aidl/vts/radio_data_test.cpp
new file mode 100644
index 0000000..dbf0eb7
--- /dev/null
+++ b/radio/aidl/vts/radio_data_test.cpp
@@ -0,0 +1,292 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/android/hardware/radio/config/IRadioConfig.h>
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <algorithm>
+
+#include "radio_data_utils.h"
+
+#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
+
+void RadioDataTest::SetUp() {
+ std::string serviceName = GetParam();
+
+ if (!isServiceValidForDeviceConfiguration(serviceName)) {
+ ALOGI("Skipped the test due to device configuration.");
+ GTEST_SKIP();
+ }
+
+ radio_data = IRadioData::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
+ ASSERT_NE(nullptr, radio_data.get());
+
+ radioRsp_data = ndk::SharedRefBase::make<RadioDataResponse>(*this);
+ ASSERT_NE(nullptr, radioRsp_data.get());
+
+ count_ = 0;
+
+ radioInd_data = ndk::SharedRefBase::make<RadioDataIndication>(*this);
+ ASSERT_NE(nullptr, radioInd_data.get());
+
+ radio_data->setResponseFunctions(radioRsp_data, radioInd_data);
+
+ // Assert IRadioConfig exists before testing
+ std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfig> radioConfig =
+ aidl::android::hardware::radio::config::IRadioConfig::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(
+ "android.hardware.radio.config.IRadioConfig/default")));
+ ASSERT_NE(nullptr, radioConfig.get());
+}
+
+ndk::ScopedAStatus RadioDataTest::getDataCallList() {
+ serial = GetRandomSerialNumber();
+ radio_data->getDataCallList(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ return ndk::ScopedAStatus::ok();
+}
+
+/*
+ * Test IRadioData.setupDataCall() for the response returned.
+ */
+TEST_P(RadioDataTest, setupDataCall) {
+ serial = GetRandomSerialNumber();
+
+ AccessNetwork accessNetwork = AccessNetwork::EUTRAN;
+
+ DataProfileInfo dataProfileInfo;
+ memset(&dataProfileInfo, 0, sizeof(dataProfileInfo));
+ dataProfileInfo.profileId = DataProfileInfo::ID_DEFAULT;
+ dataProfileInfo.apn = std::string("internet");
+ dataProfileInfo.protocol = PdpProtocolType::IP;
+ dataProfileInfo.roamingProtocol = PdpProtocolType::IP;
+ dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP;
+ dataProfileInfo.user = std::string("username");
+ dataProfileInfo.password = std::string("password");
+ dataProfileInfo.type = DataProfileInfo::TYPE_THREE_GPP;
+ dataProfileInfo.maxConnsTime = 300;
+ dataProfileInfo.maxConns = 20;
+ dataProfileInfo.waitTime = 0;
+ dataProfileInfo.enabled = true;
+ // TODO(b/210712359): 320 was the previous value; need to support bitmaps
+ dataProfileInfo.supportedApnTypesBitmap = ApnTypes::DEFAULT;
+ // TODO(b/210712359): 161543 was the previous value; need to support bitmaps
+ dataProfileInfo.bearerBitmap = RadioAccessFamily::LTE;
+ dataProfileInfo.mtuV4 = 0;
+ dataProfileInfo.mtuV6 = 0;
+ dataProfileInfo.preferred = true;
+ dataProfileInfo.persistent = false;
+
+ bool roamingAllowed = false;
+
+ std::vector<LinkAddress> addresses = {};
+ std::vector<std::string> dnses = {};
+
+ DataRequestReason reason = DataRequestReason::NORMAL;
+ SliceInfo sliceInfo;
+ bool matchAllRuleAllowed = true;
+
+ ndk::ScopedAStatus res =
+ radio_data->setupDataCall(serial, accessNetwork, dataProfileInfo, roamingAllowed,
+ reason, addresses, dnses, -1, sliceInfo, matchAllRuleAllowed);
+ ASSERT_OK(res);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_data->rspInfo.serial);
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::SIM_ABSENT, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW}));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW}));
+ }
+}
+
+/*
+ * Test IRadioData.setupDataCall() with osAppId for the response returned.
+ */
+TEST_P(RadioDataTest, setupDataCall_osAppId) {
+ serial = GetRandomSerialNumber();
+
+ AccessNetwork accessNetwork = AccessNetwork::EUTRAN;
+
+ TrafficDescriptor trafficDescriptor;
+ OsAppId osAppId;
+ std::string osAppIdString("osAppId");
+ // TODO(b/210712359): there should be a cleaner way to convert this
+ std::vector<unsigned char> output(osAppIdString.length());
+ std::transform(osAppIdString.begin(), osAppIdString.end(), output.begin(),
+ [](char c) { return static_cast<unsigned char>(c); });
+ osAppId.osAppId = output;
+ trafficDescriptor.osAppId = osAppId;
+
+ DataProfileInfo dataProfileInfo;
+ memset(&dataProfileInfo, 0, sizeof(dataProfileInfo));
+ dataProfileInfo.profileId = DataProfileInfo::ID_DEFAULT;
+ dataProfileInfo.apn = std::string("internet");
+ dataProfileInfo.protocol = PdpProtocolType::IP;
+ dataProfileInfo.roamingProtocol = PdpProtocolType::IP;
+ dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP;
+ dataProfileInfo.user = std::string("username");
+ dataProfileInfo.password = std::string("password");
+ dataProfileInfo.type = DataProfileInfo::TYPE_THREE_GPP;
+ dataProfileInfo.maxConnsTime = 300;
+ dataProfileInfo.maxConns = 20;
+ dataProfileInfo.waitTime = 0;
+ dataProfileInfo.enabled = true;
+ // TODO(b/210712359): 320 was the previous value; need to support bitmaps
+ dataProfileInfo.supportedApnTypesBitmap = ApnTypes::DEFAULT;
+ // TODO(b/210712359): 161543 was the previous value; need to support bitmaps
+ dataProfileInfo.bearerBitmap = RadioAccessFamily::LTE;
+ dataProfileInfo.mtuV4 = 0;
+ dataProfileInfo.mtuV6 = 0;
+ dataProfileInfo.preferred = true;
+ dataProfileInfo.persistent = false;
+ dataProfileInfo.trafficDescriptor = trafficDescriptor;
+
+ bool roamingAllowed = false;
+
+ std::vector<LinkAddress> addresses = {};
+ std::vector<std::string> dnses = {};
+
+ DataRequestReason reason = DataRequestReason::NORMAL;
+ SliceInfo sliceInfo;
+ bool matchAllRuleAllowed = true;
+
+ ndk::ScopedAStatus res =
+ radio_data->setupDataCall(serial, accessNetwork, dataProfileInfo, roamingAllowed,
+ reason, addresses, dnses, -1, sliceInfo, matchAllRuleAllowed);
+ ASSERT_OK(res);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_data->rspInfo.serial);
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::SIM_ABSENT, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW}));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW}));
+ if (radioRsp_data->setupDataCallResult.trafficDescriptors.size() <= 0) {
+ return;
+ }
+ EXPECT_EQ(trafficDescriptor.osAppId.value().osAppId,
+ radioRsp_data->setupDataCallResult.trafficDescriptors[0].osAppId.value().osAppId);
+ }
+}
+
+/*
+ * Test IRadioData.getSlicingConfig() for the response returned.
+ */
+TEST_P(RadioDataTest, getSlicingConfig) {
+ serial = GetRandomSerialNumber();
+ radio_data->getSlicingConfig(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_data->rspInfo.serial);
+ if (getRadioHalCapabilities()) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::REQUEST_NOT_SUPPORTED}));
+ } else {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::INTERNAL_ERR, RadioError::MODEM_ERR}));
+ }
+}
+
+/*
+ * Test IRadioData.setDataThrottling() for the response returned.
+ */
+TEST_P(RadioDataTest, setDataThrottling) {
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res = radio_data->setDataThrottling(
+ serial, DataThrottlingAction::THROTTLE_SECONDARY_CARRIER, 60000);
+ ASSERT_OK(res);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_data->rspInfo.serial);
+ if (getRadioHalCapabilities()) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::REQUEST_NOT_SUPPORTED, RadioError::NONE}));
+ } else {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR,
+ RadioError::NONE, RadioError::INVALID_ARGUMENTS}));
+ }
+
+ sleep(1);
+ serial = GetRandomSerialNumber();
+
+ res = radio_data->setDataThrottling(serial, DataThrottlingAction::THROTTLE_ANCHOR_CARRIER,
+ 60000);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_data->rspInfo.serial);
+ if (getRadioHalCapabilities()) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::REQUEST_NOT_SUPPORTED, RadioError::NONE}));
+ } else {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR,
+ RadioError::NONE, RadioError::INVALID_ARGUMENTS}));
+ }
+
+ sleep(1);
+ serial = GetRandomSerialNumber();
+
+ res = radio_data->setDataThrottling(serial, DataThrottlingAction::HOLD, 60000);
+ ASSERT_OK(res);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_data->rspInfo.serial);
+ if (getRadioHalCapabilities()) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::REQUEST_NOT_SUPPORTED, RadioError::NONE}));
+ } else {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR,
+ RadioError::NONE, RadioError::INVALID_ARGUMENTS}));
+ }
+
+ sleep(1);
+ serial = GetRandomSerialNumber();
+
+ res = radio_data->setDataThrottling(serial, DataThrottlingAction::NO_DATA_THROTTLING, 60000);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_data->rspInfo.serial);
+ if (getRadioHalCapabilities()) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::REQUEST_NOT_SUPPORTED, RadioError::NONE}));
+ } else {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR,
+ RadioError::NONE, RadioError::INVALID_ARGUMENTS}));
+ }
+
+ sleep(1);
+}
diff --git a/radio/aidl/vts/radio_data_utils.h b/radio/aidl/vts/radio_data_utils.h
new file mode 100644
index 0000000..ada8ac1
--- /dev/null
+++ b/radio/aidl/vts/radio_data_utils.h
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/radio/data/BnRadioDataIndication.h>
+#include <aidl/android/hardware/radio/data/BnRadioDataResponse.h>
+#include <aidl/android/hardware/radio/data/IRadioData.h>
+
+#include "radio_aidl_hal_utils.h"
+
+using namespace aidl::android::hardware::radio::data;
+using aidl::android::hardware::radio::sim::CardStatus;
+
+class RadioDataTest;
+
+/* Callback class for radio data response */
+class RadioDataResponse : public BnRadioDataResponse {
+ protected:
+ RadioResponseWaiter& parent_data;
+
+ public:
+ RadioDataResponse(RadioResponseWaiter& parent_data);
+ virtual ~RadioDataResponse() = default;
+
+ RadioResponseInfo rspInfo;
+ int32_t allocatedPduSessionId;
+ SetupDataCallResult setupDataCallResult;
+
+ virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override;
+
+ virtual ndk::ScopedAStatus allocatePduSessionIdResponse(const RadioResponseInfo& info,
+ int32_t id) override;
+
+ virtual ndk::ScopedAStatus cancelHandoverResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus deactivateDataCallResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus getDataCallListResponse(
+ const RadioResponseInfo& info,
+ const std::vector<SetupDataCallResult>& dcResponse) override;
+
+ virtual ndk::ScopedAStatus getSlicingConfigResponse(
+ const RadioResponseInfo& info, const SlicingConfig& slicingConfig) override;
+
+ virtual ndk::ScopedAStatus releasePduSessionIdResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setDataAllowedResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setDataProfileResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setDataThrottlingResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setInitialAttachApnResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setupDataCallResponse(
+ const RadioResponseInfo& info, const SetupDataCallResult& dcResponse) override;
+
+ virtual ndk::ScopedAStatus startHandoverResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus startKeepaliveResponse(const RadioResponseInfo& info,
+ const KeepaliveStatus& status) override;
+
+ virtual ndk::ScopedAStatus stopKeepaliveResponse(const RadioResponseInfo& info) override;
+};
+
+/* Callback class for radio data indication */
+class RadioDataIndication : public BnRadioDataIndication {
+ protected:
+ RadioDataTest& parent_data;
+
+ public:
+ RadioDataIndication(RadioDataTest& parent_data);
+ virtual ~RadioDataIndication() = default;
+
+ virtual ndk::ScopedAStatus dataCallListChanged(
+ RadioIndicationType type, const std::vector<SetupDataCallResult>& dcList) override;
+
+ virtual ndk::ScopedAStatus keepaliveStatus(RadioIndicationType type,
+ const KeepaliveStatus& status) override;
+
+ virtual ndk::ScopedAStatus pcoData(RadioIndicationType type, const PcoDataInfo& pco) override;
+
+ virtual ndk::ScopedAStatus unthrottleApn(RadioIndicationType type,
+ const DataProfileInfo& dataProfile) override;
+};
+
+// The main test class for Radio AIDL Data.
+class RadioDataTest : public ::testing::TestWithParam<std::string>, public RadioResponseWaiter {
+ protected:
+ /* Get current data call list */
+ ndk::ScopedAStatus getDataCallList();
+
+ public:
+ virtual void SetUp() override;
+
+ /* radio data service handle */
+ std::shared_ptr<IRadioData> radio_data;
+ /* radio data response handle */
+ std::shared_ptr<RadioDataResponse> radioRsp_data;
+ /* radio data indication handle */
+ std::shared_ptr<RadioDataIndication> radioInd_data;
+};
diff --git a/radio/aidl/vts/radio_messaging_indication.cpp b/radio/aidl/vts/radio_messaging_indication.cpp
new file mode 100644
index 0000000..7eeb266
--- /dev/null
+++ b/radio/aidl/vts/radio_messaging_indication.cpp
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "radio_messaging_utils.h"
+
+RadioMessagingIndication::RadioMessagingIndication(RadioMessagingTest& parent)
+ : parent_messaging(parent) {}
+
+ndk::ScopedAStatus RadioMessagingIndication::cdmaNewSms(RadioIndicationType /*type*/,
+ const CdmaSmsMessage& /*msg*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingIndication::cdmaRuimSmsStorageFull(RadioIndicationType /*type*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingIndication::newBroadcastSms(RadioIndicationType /*type*/,
+ const std::vector<uint8_t>& /*data*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingIndication::newSms(RadioIndicationType /*type*/,
+ const std::vector<uint8_t>& /*pdu*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingIndication::newSmsOnSim(RadioIndicationType /*type*/,
+ int32_t /*recordNumber*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingIndication::newSmsStatusReport(
+ RadioIndicationType /*type*/, const std::vector<uint8_t>& /*pdu*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingIndication::onUssd(RadioIndicationType /*type*/,
+ UssdModeType /*modeType*/,
+ const std::string& /*msg*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingIndication::simSmsStorageFull(RadioIndicationType /*type*/) {
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_messaging_response.cpp b/radio/aidl/vts/radio_messaging_response.cpp
new file mode 100644
index 0000000..d73278f
--- /dev/null
+++ b/radio/aidl/vts/radio_messaging_response.cpp
@@ -0,0 +1,152 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "radio_messaging_utils.h"
+
+RadioMessagingResponse::RadioMessagingResponse(RadioResponseWaiter& parent)
+ : parent_messaging(parent) {}
+
+ndk::ScopedAStatus RadioMessagingResponse::acknowledgeIncomingGsmSmsWithPduResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::acknowledgeLastIncomingCdmaSmsResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::acknowledgeLastIncomingGsmSmsResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::acknowledgeRequest(int32_t /*serial*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::cancelPendingUssdResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnRuimResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::deleteSmsOnSimResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::getCdmaBroadcastConfigResponse(
+ const RadioResponseInfo& /*info*/,
+ const std::vector<CdmaBroadcastSmsConfigInfo>& /*configs*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::getGsmBroadcastConfigResponse(
+ const RadioResponseInfo& /*info*/,
+ const std::vector<GsmBroadcastSmsConfigInfo>& /*configs*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::getSmscAddressResponse(const RadioResponseInfo& /*info*/,
+ const std::string& /*smsc*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::reportSmsMemoryStatusResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::sendCdmaSmsExpectMoreResponse(
+ const RadioResponseInfo& info, const SendSmsResult& sms) {
+ rspInfo = info;
+ sendSmsResult = sms;
+ parent_messaging.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::sendCdmaSmsResponse(const RadioResponseInfo& info,
+ const SendSmsResult& sms) {
+ rspInfo = info;
+ sendSmsResult = sms;
+ parent_messaging.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::sendImsSmsResponse(const RadioResponseInfo& /*info*/,
+ const SendSmsResult& /*sms*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::sendSmsExpectMoreResponse(const RadioResponseInfo& info,
+ const SendSmsResult& sms) {
+ rspInfo = info;
+ sendSmsResult = sms;
+ parent_messaging.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::sendSmsResponse(const RadioResponseInfo& info,
+ const SendSmsResult& sms) {
+ rspInfo = info;
+ sendSmsResult = sms;
+ parent_messaging.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::sendUssdResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastActivationResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::setCdmaBroadcastConfigResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastActivationResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::setGsmBroadcastConfigResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::setSmscAddressResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::writeSmsToRuimResponse(const RadioResponseInfo& /*info*/,
+ int32_t /*index*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioMessagingResponse::writeSmsToSimResponse(const RadioResponseInfo& /*info*/,
+ int32_t /*index*/) {
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_messaging_test.cpp b/radio/aidl/vts/radio_messaging_test.cpp
new file mode 100644
index 0000000..58aeaab
--- /dev/null
+++ b/radio/aidl/vts/radio_messaging_test.cpp
@@ -0,0 +1,194 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/android/hardware/radio/config/IRadioConfig.h>
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+
+#include "radio_messaging_utils.h"
+
+#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
+
+void RadioMessagingTest::SetUp() {
+ std::string serviceName = GetParam();
+
+ if (!isServiceValidForDeviceConfiguration(serviceName)) {
+ ALOGI("Skipped the test due to device configuration.");
+ GTEST_SKIP();
+ }
+
+ radio_messaging = IRadioMessaging::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
+ ASSERT_NE(nullptr, radio_messaging.get());
+
+ radioRsp_messaging = ndk::SharedRefBase::make<RadioMessagingResponse>(*this);
+ ASSERT_NE(nullptr, radioRsp_messaging.get());
+
+ count_ = 0;
+
+ radioInd_messaging = ndk::SharedRefBase::make<RadioMessagingIndication>(*this);
+ ASSERT_NE(nullptr, radioInd_messaging.get());
+
+ radio_messaging->setResponseFunctions(radioRsp_messaging, radioInd_messaging);
+
+ // Assert IRadioConfig exists before testing
+ std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfig> radioConfig =
+ aidl::android::hardware::radio::config::IRadioConfig::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(
+ "android.hardware.radio.config.IRadioConfig/default")));
+ ASSERT_NE(nullptr, radioConfig.get());
+}
+
+/*
+ * Test IRadioMessaging.sendSms() for the response returned.
+ */
+TEST_P(RadioMessagingTest, sendSms) {
+ LOG(DEBUG) << "sendSms";
+ serial = GetRandomSerialNumber();
+ GsmSmsMessage msg;
+ msg.smscPdu = "";
+ msg.pdu = "01000b916105770203f3000006d4f29c3e9b01";
+
+ radio_messaging->sendSms(serial, msg);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_messaging->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::SIM_ABSENT},
+ CHECK_GENERAL_ERROR));
+ EXPECT_EQ(0, radioRsp_messaging->sendSmsResult.errorCode);
+ }
+ LOG(DEBUG) << "sendSms finished";
+}
+
+/*
+ * Test IRadioMessaging.sendSmsExpectMore() for the response returned.
+ */
+TEST_P(RadioMessagingTest, sendSmsExpectMore) {
+ LOG(DEBUG) << "sendSmsExpectMore";
+ serial = GetRandomSerialNumber();
+ GsmSmsMessage msg;
+ msg.smscPdu = "";
+ msg.pdu = "01000b916105770203f3000006d4f29c3e9b01";
+
+ radio_messaging->sendSmsExpectMore(serial, msg);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_messaging->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::SIM_ABSENT},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "sendSmsExpectMore finished";
+}
+
+/*
+ * Test IRadioMessaging.sendCdmaSms() for the response returned.
+ */
+TEST_P(RadioMessagingTest, sendCdmaSms) {
+ LOG(DEBUG) << "sendCdmaSms";
+ serial = GetRandomSerialNumber();
+
+ // Create a CdmaSmsAddress
+ CdmaSmsAddress cdmaSmsAddress;
+ cdmaSmsAddress.digitMode = CdmaSmsAddress::DIGIT_MODE_FOUR_BIT;
+ cdmaSmsAddress.isNumberModeDataNetwork = false;
+ cdmaSmsAddress.numberType = CdmaSmsAddress::NUMBER_TYPE_UNKNOWN;
+ cdmaSmsAddress.numberPlan = CdmaSmsAddress::NUMBER_PLAN_UNKNOWN;
+ cdmaSmsAddress.digits = (std::vector<uint8_t>){11, 1, 6, 5, 10, 7, 7, 2, 10, 3, 10, 3};
+
+ // Create a CdmaSmsSubAddress
+ CdmaSmsSubaddress cdmaSmsSubaddress;
+ cdmaSmsSubaddress.subaddressType = CdmaSmsSubaddress::SUBADDRESS_TYPE_NSAP;
+ cdmaSmsSubaddress.odd = false;
+ cdmaSmsSubaddress.digits = (std::vector<uint8_t>){};
+
+ // Create a CdmaSmsMessage
+ CdmaSmsMessage cdmaSmsMessage;
+ cdmaSmsMessage.teleserviceId = 4098;
+ cdmaSmsMessage.isServicePresent = false;
+ cdmaSmsMessage.serviceCategory = 0;
+ cdmaSmsMessage.address = cdmaSmsAddress;
+ cdmaSmsMessage.subAddress = cdmaSmsSubaddress;
+ cdmaSmsMessage.bearerData =
+ (std::vector<uint8_t>){15, 0, 3, 32, 3, 16, 1, 8, 16, 53, 76, 68, 6, 51, 106, 0};
+
+ radio_messaging->sendCdmaSms(serial, cdmaSmsMessage);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_messaging->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::SIM_ABSENT},
+ CHECK_GENERAL_ERROR));
+ }
+ LOG(DEBUG) << "sendCdmaSms finished";
+}
+
+/*
+ * Test IRadioMessaging.sendCdmaSmsExpectMore() for the response returned.
+ */
+TEST_P(RadioMessagingTest, sendCdmaSmsExpectMore) {
+ serial = GetRandomSerialNumber();
+
+ // Create a CdmaSmsAddress
+ CdmaSmsAddress cdmaSmsAddress;
+ cdmaSmsAddress.digitMode = CdmaSmsAddress::DIGIT_MODE_FOUR_BIT;
+ cdmaSmsAddress.isNumberModeDataNetwork = false;
+ cdmaSmsAddress.numberType = CdmaSmsAddress::NUMBER_TYPE_UNKNOWN;
+ cdmaSmsAddress.numberPlan = CdmaSmsAddress::NUMBER_PLAN_UNKNOWN;
+ cdmaSmsAddress.digits = (std::vector<uint8_t>){11, 1, 6, 5, 10, 7, 7, 2, 10, 3, 10, 3};
+
+ // Create a CdmaSmsSubAddress
+ CdmaSmsSubaddress cdmaSmsSubaddress;
+ cdmaSmsSubaddress.subaddressType = CdmaSmsSubaddress::SUBADDRESS_TYPE_NSAP;
+ cdmaSmsSubaddress.odd = false;
+ cdmaSmsSubaddress.digits = (std::vector<uint8_t>){};
+
+ // Create a CdmaSmsMessage
+ CdmaSmsMessage cdmaSmsMessage;
+ cdmaSmsMessage.teleserviceId = 4098;
+ cdmaSmsMessage.isServicePresent = false;
+ cdmaSmsMessage.serviceCategory = 0;
+ cdmaSmsMessage.address = cdmaSmsAddress;
+ cdmaSmsMessage.subAddress = cdmaSmsSubaddress;
+ cdmaSmsMessage.bearerData =
+ (std::vector<uint8_t>){15, 0, 3, 32, 3, 16, 1, 8, 16, 53, 76, 68, 6, 51, 106, 0};
+
+ radio_messaging->sendCdmaSmsExpectMore(serial, cdmaSmsMessage);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_messaging->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_messaging->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_messaging->rspInfo.error,
+ {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::SIM_ABSENT},
+ CHECK_GENERAL_ERROR));
+ }
+}
diff --git a/radio/aidl/vts/radio_messaging_utils.h b/radio/aidl/vts/radio_messaging_utils.h
new file mode 100644
index 0000000..96cde08
--- /dev/null
+++ b/radio/aidl/vts/radio_messaging_utils.h
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/radio/messaging/BnRadioMessagingIndication.h>
+#include <aidl/android/hardware/radio/messaging/BnRadioMessagingResponse.h>
+#include <aidl/android/hardware/radio/messaging/IRadioMessaging.h>
+
+#include "radio_aidl_hal_utils.h"
+
+using namespace aidl::android::hardware::radio::messaging;
+
+class RadioMessagingTest;
+
+/* Callback class for radio messaging response */
+class RadioMessagingResponse : public BnRadioMessagingResponse {
+ protected:
+ RadioResponseWaiter& parent_messaging;
+
+ public:
+ RadioMessagingResponse(RadioResponseWaiter& parent_messaging);
+ virtual ~RadioMessagingResponse() = default;
+
+ RadioResponseInfo rspInfo;
+ SendSmsResult sendSmsResult;
+
+ virtual ndk::ScopedAStatus acknowledgeIncomingGsmSmsWithPduResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus acknowledgeLastIncomingCdmaSmsResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus acknowledgeLastIncomingGsmSmsResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override;
+
+ virtual ndk::ScopedAStatus cancelPendingUssdResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus deleteSmsOnRuimResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus deleteSmsOnSimResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus getCdmaBroadcastConfigResponse(
+ const RadioResponseInfo& info,
+ const std::vector<CdmaBroadcastSmsConfigInfo>& configs) override;
+
+ virtual ndk::ScopedAStatus getGsmBroadcastConfigResponse(
+ const RadioResponseInfo& info,
+ const std::vector<GsmBroadcastSmsConfigInfo>& configs) override;
+
+ virtual ndk::ScopedAStatus getSmscAddressResponse(const RadioResponseInfo& info,
+ const std::string& smsc) override;
+
+ virtual ndk::ScopedAStatus reportSmsMemoryStatusResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus sendCdmaSmsExpectMoreResponse(const RadioResponseInfo& info,
+ const SendSmsResult& sms) override;
+
+ virtual ndk::ScopedAStatus sendCdmaSmsResponse(const RadioResponseInfo& info,
+ const SendSmsResult& sms) override;
+
+ virtual ndk::ScopedAStatus sendImsSmsResponse(const RadioResponseInfo& info,
+ const SendSmsResult& sms) override;
+
+ virtual ndk::ScopedAStatus sendSmsExpectMoreResponse(const RadioResponseInfo& info,
+ const SendSmsResult& sms) override;
+
+ virtual ndk::ScopedAStatus sendSmsResponse(const RadioResponseInfo& info,
+ const SendSmsResult& sms) override;
+
+ virtual ndk::ScopedAStatus sendUssdResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setCdmaBroadcastActivationResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setCdmaBroadcastConfigResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setGsmBroadcastActivationResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setGsmBroadcastConfigResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setSmscAddressResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus writeSmsToRuimResponse(const RadioResponseInfo& info,
+ int32_t index) override;
+
+ virtual ndk::ScopedAStatus writeSmsToSimResponse(const RadioResponseInfo& info,
+ int32_t index) override;
+};
+
+/* Callback class for radio messaging indication */
+class RadioMessagingIndication : public BnRadioMessagingIndication {
+ protected:
+ RadioMessagingTest& parent_messaging;
+
+ public:
+ RadioMessagingIndication(RadioMessagingTest& parent_messaging);
+ virtual ~RadioMessagingIndication() = default;
+
+ virtual ndk::ScopedAStatus cdmaNewSms(RadioIndicationType type,
+ const CdmaSmsMessage& msg) override;
+
+ virtual ndk::ScopedAStatus cdmaRuimSmsStorageFull(RadioIndicationType type) override;
+
+ virtual ndk::ScopedAStatus newBroadcastSms(RadioIndicationType type,
+ const std::vector<uint8_t>& data) override;
+
+ virtual ndk::ScopedAStatus newSms(RadioIndicationType type,
+ const std::vector<uint8_t>& pdu) override;
+
+ virtual ndk::ScopedAStatus newSmsOnSim(RadioIndicationType type, int32_t recordNumber) override;
+
+ virtual ndk::ScopedAStatus newSmsStatusReport(RadioIndicationType type,
+ const std::vector<uint8_t>& pdu) override;
+
+ virtual ndk::ScopedAStatus onUssd(RadioIndicationType type, UssdModeType modeType,
+ const std::string& msg) override;
+
+ virtual ndk::ScopedAStatus simSmsStorageFull(RadioIndicationType type) override;
+};
+
+// The main test class for Radio AIDL Messaging.
+class RadioMessagingTest : public ::testing::TestWithParam<std::string>,
+ public RadioResponseWaiter {
+ public:
+ virtual void SetUp() override;
+
+ /* radio messaging service handle */
+ std::shared_ptr<IRadioMessaging> radio_messaging;
+ /* radio messaging response handle */
+ std::shared_ptr<RadioMessagingResponse> radioRsp_messaging;
+ /* radio messaging indication handle */
+ std::shared_ptr<RadioMessagingIndication> radioInd_messaging;
+};
diff --git a/radio/aidl/vts/radio_modem_indication.cpp b/radio/aidl/vts/radio_modem_indication.cpp
new file mode 100644
index 0000000..17f37a8
--- /dev/null
+++ b/radio/aidl/vts/radio_modem_indication.cpp
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "radio_modem_utils.h"
+
+RadioModemIndication::RadioModemIndication(RadioModemTest& parent) : parent_modem(parent) {}
+
+ndk::ScopedAStatus RadioModemIndication::hardwareConfigChanged(
+ RadioIndicationType /*type*/, const std::vector<HardwareConfig>& /*configs*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemIndication::modemReset(RadioIndicationType /*type*/,
+ const std::string& /*reason*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemIndication::radioCapabilityIndication(RadioIndicationType /*type*/,
+ const RadioCapability& /*rc*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemIndication::radioStateChanged(RadioIndicationType /*type*/,
+ RadioState /*radioState*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemIndication::rilConnected(RadioIndicationType /*type*/) {
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_modem_response.cpp b/radio/aidl/vts/radio_modem_response.cpp
new file mode 100644
index 0000000..7ac590f
--- /dev/null
+++ b/radio/aidl/vts/radio_modem_response.cpp
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "radio_modem_utils.h"
+
+RadioModemResponse::RadioModemResponse(RadioResponseWaiter& parent) : parent_modem(parent) {}
+
+ndk::ScopedAStatus RadioModemResponse::acknowledgeRequest(int32_t /*serial*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemResponse::enableModemResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemResponse::getBasebandVersionResponse(const RadioResponseInfo& /*info*/,
+ const std::string& /*version*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemResponse::getDeviceIdentityResponse(const RadioResponseInfo& /*info*/,
+ const std::string& /*imei*/,
+ const std::string& /*imeisv*/,
+ const std::string& /*esn*/,
+ const std::string& /*meid*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemResponse::getHardwareConfigResponse(
+ const RadioResponseInfo& /*info*/, const std::vector<HardwareConfig>& /*config*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemResponse::getModemActivityInfoResponse(
+ const RadioResponseInfo& /*info*/, const ActivityStatsInfo& /*activityInfo*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemResponse::getModemStackStatusResponse(
+ const RadioResponseInfo& /*info*/, const bool /*enabled*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemResponse::getRadioCapabilityResponse(const RadioResponseInfo& /*info*/,
+ const RadioCapability& /*rc*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemResponse::nvReadItemResponse(const RadioResponseInfo& /*info*/,
+ const std::string& /*result*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemResponse::nvResetConfigResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemResponse::nvWriteCdmaPrlResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemResponse::nvWriteItemResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemResponse::requestShutdownResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemResponse::sendDeviceStateResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemResponse::setRadioCapabilityResponse(const RadioResponseInfo& /*info*/,
+ const RadioCapability& /*rc*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioModemResponse::setRadioPowerResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_modem.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_modem_test.cpp b/radio/aidl/vts/radio_modem_test.cpp
new file mode 100644
index 0000000..406927f
--- /dev/null
+++ b/radio/aidl/vts/radio_modem_test.cpp
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/android/hardware/radio/config/IRadioConfig.h>
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+
+#include "radio_modem_utils.h"
+
+#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
+
+void RadioModemTest::SetUp() {
+ std::string serviceName = GetParam();
+
+ if (!isServiceValidForDeviceConfiguration(serviceName)) {
+ ALOGI("Skipped the test due to device configuration.");
+ GTEST_SKIP();
+ }
+
+ radio_modem = IRadioModem::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
+ ASSERT_NE(nullptr, radio_modem.get());
+
+ radioRsp_modem = ndk::SharedRefBase::make<RadioModemResponse>(*this);
+ ASSERT_NE(nullptr, radioRsp_modem.get());
+
+ count_ = 0;
+
+ radioInd_modem = ndk::SharedRefBase::make<RadioModemIndication>(*this);
+ ASSERT_NE(nullptr, radioInd_modem.get());
+
+ radio_modem->setResponseFunctions(radioRsp_modem, radioInd_modem);
+
+ // Assert IRadioConfig exists before testing
+ std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfig> radioConfig =
+ aidl::android::hardware::radio::config::IRadioConfig::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(
+ "android.hardware.radio.config.IRadioConfig/default")));
+ ASSERT_NE(nullptr, radioConfig.get());
+}
+
+/*
+ * Test IRadioModem.setRadioPower() for the response returned.
+ */
+TEST_P(RadioModemTest, setRadioPower_emergencyCall_cancelled) {
+ // Set radio power to off.
+ serial = GetRandomSerialNumber();
+ radio_modem->setRadioPower(serial, false, false, false);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+ EXPECT_EQ(RadioError::NONE, radioRsp_modem->rspInfo.error);
+
+ // Set radio power to on with forEmergencyCall being true. This should put modem to only scan
+ // emergency call bands.
+ serial = GetRandomSerialNumber();
+ radio_modem->setRadioPower(serial, true, true, true);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+ EXPECT_EQ(RadioError::NONE, radioRsp_modem->rspInfo.error);
+
+ // Set radio power to on with forEmergencyCall being false. This should put modem in regular
+ // operation modem.
+ serial = GetRandomSerialNumber();
+ radio_modem->setRadioPower(serial, true, false, false);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
+ EXPECT_EQ(RadioError::NONE, radioRsp_modem->rspInfo.error);
+}
diff --git a/radio/aidl/vts/radio_modem_utils.h b/radio/aidl/vts/radio_modem_utils.h
new file mode 100644
index 0000000..cd9a30d
--- /dev/null
+++ b/radio/aidl/vts/radio_modem_utils.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/radio/modem/BnRadioModemIndication.h>
+#include <aidl/android/hardware/radio/modem/BnRadioModemResponse.h>
+#include <aidl/android/hardware/radio/modem/IRadioModem.h>
+
+#include "radio_aidl_hal_utils.h"
+
+using namespace aidl::android::hardware::radio::config;
+using namespace aidl::android::hardware::radio::modem;
+
+class RadioModemTest;
+
+/* Callback class for radio modem response */
+class RadioModemResponse : public BnRadioModemResponse {
+ protected:
+ RadioResponseWaiter& parent_modem;
+
+ public:
+ RadioModemResponse(RadioResponseWaiter& parent_modem);
+ virtual ~RadioModemResponse() = default;
+
+ RadioResponseInfo rspInfo;
+ bool isModemEnabled;
+ bool enableModemResponseToggle;
+
+ virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override;
+
+ virtual ndk::ScopedAStatus enableModemResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus getBasebandVersionResponse(const RadioResponseInfo& info,
+ const std::string& version) override;
+
+ virtual ndk::ScopedAStatus getDeviceIdentityResponse(const RadioResponseInfo& info,
+ const std::string& imei,
+ const std::string& imeisv,
+ const std::string& esn,
+ const std::string& meid) override;
+
+ virtual ndk::ScopedAStatus getHardwareConfigResponse(
+ const RadioResponseInfo& info, const std::vector<HardwareConfig>& config) override;
+
+ virtual ndk::ScopedAStatus getModemActivityInfoResponse(
+ const RadioResponseInfo& info, const ActivityStatsInfo& activityInfo) override;
+
+ virtual ndk::ScopedAStatus getModemStackStatusResponse(const RadioResponseInfo& info,
+ const bool enabled) override;
+
+ virtual ndk::ScopedAStatus getRadioCapabilityResponse(const RadioResponseInfo& info,
+ const RadioCapability& rc) override;
+
+ virtual ndk::ScopedAStatus nvReadItemResponse(const RadioResponseInfo& info,
+ const std::string& result) override;
+
+ virtual ndk::ScopedAStatus nvResetConfigResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus nvWriteCdmaPrlResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus nvWriteItemResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus requestShutdownResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus sendDeviceStateResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setRadioCapabilityResponse(const RadioResponseInfo& info,
+ const RadioCapability& rc) override;
+
+ virtual ndk::ScopedAStatus setRadioPowerResponse(const RadioResponseInfo& info) override;
+};
+
+/* Callback class for radio modem indication */
+class RadioModemIndication : public BnRadioModemIndication {
+ protected:
+ RadioModemTest& parent_modem;
+
+ public:
+ RadioModemIndication(RadioModemTest& parent_modem);
+ virtual ~RadioModemIndication() = default;
+
+ virtual ndk::ScopedAStatus hardwareConfigChanged(
+ RadioIndicationType type, const std::vector<HardwareConfig>& configs) override;
+
+ virtual ndk::ScopedAStatus modemReset(RadioIndicationType type,
+ const std::string& reason) override;
+
+ virtual ndk::ScopedAStatus radioCapabilityIndication(RadioIndicationType type,
+ const RadioCapability& rc) override;
+
+ virtual ndk::ScopedAStatus radioStateChanged(RadioIndicationType type,
+ RadioState radioState) override;
+
+ virtual ndk::ScopedAStatus rilConnected(RadioIndicationType type) override;
+};
+
+// The main test class for Radio AIDL Modem.
+class RadioModemTest : public ::testing::TestWithParam<std::string>, public RadioResponseWaiter {
+ public:
+ virtual void SetUp() override;
+
+ /* radio modem service handle */
+ std::shared_ptr<IRadioModem> radio_modem;
+ /* radio modem response handle */
+ std::shared_ptr<RadioModemResponse> radioRsp_modem;
+ /* radio modem indication handle */
+ std::shared_ptr<RadioModemIndication> radioInd_modem;
+};
diff --git a/radio/aidl/vts/radio_network_indication.cpp b/radio/aidl/vts/radio_network_indication.cpp
new file mode 100644
index 0000000..7bed759
--- /dev/null
+++ b/radio/aidl/vts/radio_network_indication.cpp
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "radio_network_utils.h"
+
+RadioNetworkIndication::RadioNetworkIndication(RadioNetworkTest& parent) : parent_network(parent) {}
+
+ndk::ScopedAStatus RadioNetworkIndication::barringInfoChanged(
+ RadioIndicationType /*type*/, const CellIdentity& /*cellIdentity*/,
+ const std::vector<BarringInfo>& /*barringInfos*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkIndication::cdmaPrlChanged(RadioIndicationType /*type*/,
+ int32_t /*version*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkIndication::cellInfoList(RadioIndicationType /*type*/,
+ const std::vector<CellInfo>& /*records*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkIndication::currentLinkCapacityEstimate(
+ RadioIndicationType /*type*/, const LinkCapacityEstimate& /*lce*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkIndication::currentPhysicalChannelConfigs(
+ RadioIndicationType /*type*/, const std::vector<PhysicalChannelConfig>& /*configs*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkIndication::currentSignalStrength(
+ RadioIndicationType /*type*/, const SignalStrength& /*signalStrength*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkIndication::imsNetworkStateChanged(RadioIndicationType /*type*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkIndication::networkScanResult(RadioIndicationType /*type*/,
+ const NetworkScanResult& /*result*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkIndication::networkStateChanged(RadioIndicationType /*type*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkIndication::nitzTimeReceived(RadioIndicationType /*type*/,
+ const std::string& /*nitzTime*/,
+ int64_t /*receivedTime*/,
+ int64_t /*age*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkIndication::registrationFailed(RadioIndicationType /*type*/,
+ const CellIdentity& /*cellIdentity*/,
+ const std::string& /*chosenPlmn*/,
+ Domain /*domain*/,
+ int32_t /*causeCode*/,
+ int32_t /*additionalCauseCode*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkIndication::restrictedStateChanged(RadioIndicationType /*type*/,
+ PhoneRestrictedState /*state*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkIndication::suppSvcNotify(RadioIndicationType /*type*/,
+ const SuppSvcNotification& /*suppSvc*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkIndication::voiceRadioTechChanged(RadioIndicationType /*type*/,
+ RadioTechnology /*rat*/) {
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_network_response.cpp b/radio/aidl/vts/radio_network_response.cpp
new file mode 100644
index 0000000..b242341
--- /dev/null
+++ b/radio/aidl/vts/radio_network_response.cpp
@@ -0,0 +1,220 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "radio_network_utils.h"
+
+RadioNetworkResponse::RadioNetworkResponse(RadioResponseWaiter& parent) : parent_network(parent) {}
+
+ndk::ScopedAStatus RadioNetworkResponse::acknowledgeRequest(int32_t /*serial*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::getAllowedNetworkTypesBitmapResponse(
+ const RadioResponseInfo& info, const RadioAccessFamily networkTypeBitmap) {
+ rspInfo = info;
+ networkTypeBitmapResponse = networkTypeBitmap;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::getAvailableBandModesResponse(
+ const RadioResponseInfo& /*info*/, const std::vector<RadioBandMode>& /*bandModes*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::getAvailableNetworksResponse(
+ const RadioResponseInfo& info, const std::vector<OperatorInfo>& operatorInfos) {
+ rspInfo = info;
+ networkInfos = operatorInfos;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::getBarringInfoResponse(
+ const RadioResponseInfo& /*info*/, const CellIdentity& /*cellIdentity*/,
+ const std::vector<BarringInfo>& /*barringInfos*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::getCdmaRoamingPreferenceResponse(
+ const RadioResponseInfo& /*info*/, CdmaRoamingType /*type*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::getCellInfoListResponse(
+ const RadioResponseInfo& /*info*/, const std::vector<CellInfo>& /*cellInfo*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::getDataRegistrationStateResponse(
+ const RadioResponseInfo& info, const RegStateResult& /*regResponse*/) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::getImsRegistrationStateResponse(
+ const RadioResponseInfo& /*info*/, bool /*isRegistered*/,
+ RadioTechnologyFamily /*ratFamily*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::getNetworkSelectionModeResponse(
+ const RadioResponseInfo& /*info*/, bool /*manual*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::getOperatorResponse(const RadioResponseInfo& /*info*/,
+ const std::string& /*longName*/,
+ const std::string& /*shortName*/,
+ const std::string& /*numeric*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::getSignalStrengthResponse(
+ const RadioResponseInfo& /*info*/, const SignalStrength& /*sig_strength*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::getSystemSelectionChannelsResponse(
+ const RadioResponseInfo& info, const std::vector<RadioAccessSpecifier>& /*specifier*/) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::getUsageSettingResponse(const RadioResponseInfo& info,
+ const UsageSetting usageSetting) {
+ rspInfo = info;
+ this->usageSetting = usageSetting;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::getVoiceRadioTechnologyResponse(
+ const RadioResponseInfo& /*info*/, RadioTechnology /*rat*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::getVoiceRegistrationStateResponse(
+ const RadioResponseInfo& info, const RegStateResult& regResponse) {
+ rspInfo = info;
+ regStateResp.regState = regResponse.regState;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::isNrDualConnectivityEnabledResponse(
+ const RadioResponseInfo& info, bool isEnabled) {
+ rspInfo = info;
+ isNrDualConnectivityEnabled = isEnabled;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::setAllowedNetworkTypesBitmapResponse(
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::setBandModeResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::setBarringPasswordResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::setCdmaRoamingPreferenceResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::setCellInfoListRateResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::setIndicationFilterResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::setLinkCapacityReportingCriteriaResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::setLocationUpdatesResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::setNetworkSelectionModeAutomaticResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::setNetworkSelectionModeManualResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::setNrDualConnectivityStateResponse(
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::setSignalStrengthReportingCriteriaResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::setSuppServiceNotificationsResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::setSystemSelectionChannelsResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::setUsageSettingResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::startNetworkScanResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::stopNetworkScanResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::supplyNetworkDepersonalizationResponse(
+ const RadioResponseInfo& /*info*/, int32_t /*remainingRetries*/) {
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp
new file mode 100644
index 0000000..1cdbb6d
--- /dev/null
+++ b/radio/aidl/vts/radio_network_test.cpp
@@ -0,0 +1,259 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/android/hardware/radio/config/IRadioConfig.h>
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+
+#include "radio_network_utils.h"
+
+#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
+
+void RadioNetworkTest::SetUp() {
+ std::string serviceName = GetParam();
+
+ if (!isServiceValidForDeviceConfiguration(serviceName)) {
+ ALOGI("Skipped the test due to device configuration.");
+ GTEST_SKIP();
+ }
+
+ radio_network = IRadioNetwork::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
+ ASSERT_NE(nullptr, radio_network.get());
+
+ radioRsp_network = ndk::SharedRefBase::make<RadioNetworkResponse>(*this);
+ ASSERT_NE(nullptr, radioRsp_network.get());
+
+ count_ = 0;
+
+ radioInd_network = ndk::SharedRefBase::make<RadioNetworkIndication>(*this);
+ ASSERT_NE(nullptr, radioInd_network.get());
+
+ radio_network->setResponseFunctions(radioRsp_network, radioInd_network);
+
+ // Assert IRadioConfig exists before testing
+ std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfig> radioConfig =
+ aidl::android::hardware::radio::config::IRadioConfig::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(
+ "android.hardware.radio.config.IRadioConfig/default")));
+ ASSERT_NE(nullptr, radioConfig.get());
+}
+
+/*
+ * Test IRadioNetwork.setAllowedNetworkTypesBitmap for the response returned.
+ */
+TEST_P(RadioNetworkTest, setAllowedNetworkTypesBitmap) {
+ serial = GetRandomSerialNumber();
+ RadioAccessFamily allowedNetworkTypesBitmap = RadioAccessFamily::LTE;
+
+ radio_network->setAllowedNetworkTypesBitmap(serial, allowedNetworkTypesBitmap);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::OPERATION_NOT_ALLOWED,
+ RadioError::MODE_NOT_SUPPORTED, RadioError::INTERNAL_ERR, RadioError::MODEM_ERR,
+ RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED,
+ RadioError::NO_RESOURCES}));
+}
+
+/*
+ * Test IRadioNetwork.getAllowedNetworkTypesBitmap for the response returned.
+ */
+TEST_P(RadioNetworkTest, getAllowedNetworkTypesBitmap) {
+ serial = GetRandomSerialNumber();
+ RadioAccessFamily allowedNetworkTypesBitmap = RadioAccessFamily::LTE;
+
+ radio_network->setAllowedNetworkTypesBitmap(serial, allowedNetworkTypesBitmap);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ if (radioRsp_network->rspInfo.error == RadioError::NONE) {
+ sleep(3); // wait for modem
+ serial = GetRandomSerialNumber();
+ radio_network->getAllowedNetworkTypesBitmap(serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR,
+ RadioError::OPERATION_NOT_ALLOWED, RadioError::MODE_NOT_SUPPORTED,
+ RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR,
+ RadioError::REQUEST_NOT_SUPPORTED, RadioError::NO_RESOURCES}));
+ }
+}
+
+/*
+ * Test IRadioNetwork.setNrDualConnectivityState() for the response returned.
+ */
+TEST_P(RadioNetworkTest, setNrDualConnectivityState) {
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res =
+ radio_network->setNrDualConnectivityState(serial, NrDualConnectivityState::DISABLE);
+ ASSERT_OK(res);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ if (getRadioHalCapabilities()) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::REQUEST_NOT_SUPPORTED}));
+ } else {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR,
+ RadioError::INVALID_STATE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::NONE}));
+ }
+}
+
+/*
+ * Test IRadioNetwork.isNrDualConnectivityEnabled() for the response returned.
+ */
+TEST_P(RadioNetworkTest, isNrDualConnectivityEnabled) {
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res = radio_network->isNrDualConnectivityEnabled(serial);
+ ASSERT_OK(res);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ if (getRadioHalCapabilities()) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::REQUEST_NOT_SUPPORTED}));
+ } else {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR, RadioError::NONE}));
+ }
+}
+
+void RadioNetworkTest::invokeAndExpectResponse(
+ std::function<ndk::ScopedAStatus(int32_t serial)> request,
+ std::vector<RadioError> errors_to_check) {
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res = request(serial);
+ ASSERT_OK(res);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, errors_to_check));
+}
+
+/*
+ * Test IRadioNetwork.getUsageSetting()
+ *
+ * Verify that the usage setting can be retrieved.
+ */
+TEST_P(RadioNetworkTest, getUsageSetting) {
+ invokeAndExpectResponse([&](int serial) { return radio_network->getUsageSetting(serial); },
+ {RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_STATE,
+ RadioError::SIM_ABSENT, RadioError::INTERNAL_ERR, RadioError::NONE});
+
+ ASSERT_TRUE(radioRsp_network->usageSetting == UsageSetting::VOICE_CENTRIC ||
+ radioRsp_network->usageSetting == UsageSetting::DATA_CENTRIC);
+}
+
+void RadioNetworkTest::testSetUsageSetting_InvalidValues(std::vector<RadioError> errors) {
+ invokeAndExpectResponse(
+ [&](int serial) {
+ return radio_network->setUsageSetting(serial,
+ UsageSetting(0) /*below valid range*/);
+ },
+ errors);
+ invokeAndExpectResponse(
+ [&](int serial) {
+ return radio_network->setUsageSetting(serial, UsageSetting(-1) /*negative*/);
+ },
+ errors);
+ invokeAndExpectResponse(
+ [&](int serial) {
+ return radio_network->setUsageSetting(serial,
+ UsageSetting(3) /*above valid range*/);
+ },
+ errors);
+}
+
+/*
+ * Test IRadioNetwork.setUsageSetting() and IRadioNetwork.getUsageSetting()
+ *
+ * Verify the following:
+ * -That the usage setting can be retrieved.
+ * -That the usage setting can be successfully set to allowed values.
+ * -That the usage setting cannot be set to invalid values.
+ */
+TEST_P(RadioNetworkTest, setUsageSetting) {
+ invokeAndExpectResponse([&](int serial) { return radio_network->getUsageSetting(serial); },
+ {RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_STATE,
+ RadioError::SIM_ABSENT, RadioError::INTERNAL_ERR, RadioError::NONE});
+
+ if (radioRsp_network->rspInfo.error != RadioError::NONE) {
+ // Test only for invalid values, with the only allowable response being the same error
+ // that was previously provided, or an error indicating invalid arguments.
+ testSetUsageSetting_InvalidValues(
+ {radioRsp_network->rspInfo.error, RadioError::INVALID_ARGUMENTS});
+ // It is unsafe to proceed with setting valid values without knowing the starting value, but
+ // we expect errors anyway, so not necessary.
+ return;
+ } else {
+ // Because querying succeeded, the device is in a valid state to test for invalid values
+ // and the only thing that can change is that we expect to have an EINVAL return each time.
+ testSetUsageSetting_InvalidValues({RadioError::INVALID_ARGUMENTS});
+ }
+
+ // Store the original setting value to reset later.
+ const UsageSetting originalSetting = radioRsp_network->usageSetting;
+
+ // Choose the "other" value that is not the current value for test.
+ const UsageSetting testSetting = radioRsp_network->usageSetting == UsageSetting::VOICE_CENTRIC
+ ? UsageSetting::DATA_CENTRIC
+ : UsageSetting::VOICE_CENTRIC;
+
+ // Set an alternative setting; it may either succeed or be disallowed as out of range for
+ // the current device (if the device only supports its current mode).
+ invokeAndExpectResponse(
+ [&](int serial) { return radio_network->setUsageSetting(serial, testSetting); },
+ {RadioError::INVALID_ARGUMENTS, RadioError::NONE});
+
+ // If there was no error, then we expect the test setting to be set, or if there is an error
+ // we expect the original setting to be maintained.
+ const UsageSetting expectedSetting =
+ radioRsp_network->rspInfo.error == RadioError::NONE ? testSetting : originalSetting;
+ invokeAndExpectResponse([&](int serial) { return radio_network->getUsageSetting(serial); },
+ {RadioError::NONE});
+
+ const UsageSetting updatedSetting = radioRsp_network->usageSetting;
+
+ // Re-set the original setting, which must always succeed.
+ invokeAndExpectResponse(
+ [&](int serial) { return radio_network->setUsageSetting(serial, originalSetting); },
+ {RadioError::NONE});
+
+ // Check that indeed the updated setting was set. We do this after resetting to original
+ // conditions to avoid early-exiting the test and leaving the device in a modified state.
+ ASSERT_TRUE(expectedSetting == updatedSetting);
+ // Check that indeed the original setting was reset.
+ ASSERT_TRUE(originalSetting == radioRsp_network->usageSetting);
+}
diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h
new file mode 100644
index 0000000..caa1ecc
--- /dev/null
+++ b/radio/aidl/vts/radio_network_utils.h
@@ -0,0 +1,221 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/radio/network/BnRadioNetworkIndication.h>
+#include <aidl/android/hardware/radio/network/BnRadioNetworkResponse.h>
+#include <aidl/android/hardware/radio/network/IRadioNetwork.h>
+
+#include "radio_aidl_hal_utils.h"
+
+using namespace aidl::android::hardware::radio::network;
+
+class RadioNetworkTest;
+
+/* Callback class for radio network response */
+class RadioNetworkResponse : public BnRadioNetworkResponse {
+ protected:
+ RadioResponseWaiter& parent_network;
+
+ public:
+ RadioNetworkResponse(RadioResponseWaiter& parent_network);
+ virtual ~RadioNetworkResponse() = default;
+
+ RadioResponseInfo rspInfo;
+ std::vector<RadioBandMode> radioBandModes;
+ std::vector<OperatorInfo> networkInfos;
+ bool isNrDualConnectivityEnabled;
+ RadioAccessFamily networkTypeBitmapResponse;
+ RegStateResult regStateResp;
+ CellIdentity barringCellIdentity;
+ std::vector<BarringInfo> barringInfos;
+ UsageSetting usageSetting;
+
+ virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override;
+
+ virtual ndk::ScopedAStatus getAllowedNetworkTypesBitmapResponse(
+ const RadioResponseInfo& info, const RadioAccessFamily networkTypeBitmap) override;
+
+ virtual ndk::ScopedAStatus getAvailableBandModesResponse(
+ const RadioResponseInfo& info, const std::vector<RadioBandMode>& bandModes) override;
+
+ virtual ndk::ScopedAStatus getAvailableNetworksResponse(
+ const RadioResponseInfo& info, const std::vector<OperatorInfo>& networkInfos) override;
+
+ virtual ndk::ScopedAStatus getBarringInfoResponse(
+ const RadioResponseInfo& info, const CellIdentity& cellIdentity,
+ const std::vector<BarringInfo>& barringInfos) override;
+
+ virtual ndk::ScopedAStatus getCdmaRoamingPreferenceResponse(const RadioResponseInfo& info,
+ CdmaRoamingType type) override;
+
+ virtual ndk::ScopedAStatus getCellInfoListResponse(
+ const RadioResponseInfo& info, const std::vector<CellInfo>& cellInfo) override;
+
+ virtual ndk::ScopedAStatus getDataRegistrationStateResponse(
+ const RadioResponseInfo& info, const RegStateResult& dataRegResponse) override;
+
+ virtual ndk::ScopedAStatus getImsRegistrationStateResponse(
+ const RadioResponseInfo& info, bool isRegistered,
+ RadioTechnologyFamily ratFamily) override;
+
+ virtual ndk::ScopedAStatus getNetworkSelectionModeResponse(const RadioResponseInfo& info,
+ bool manual) override;
+
+ virtual ndk::ScopedAStatus getOperatorResponse(const RadioResponseInfo& info,
+ const std::string& longName,
+ const std::string& shortName,
+ const std::string& numeric) override;
+
+ virtual ndk::ScopedAStatus getSignalStrengthResponse(
+ const RadioResponseInfo& info, const SignalStrength& sigStrength) override;
+
+ virtual ndk::ScopedAStatus getSystemSelectionChannelsResponse(
+ const RadioResponseInfo& info,
+ const std::vector<RadioAccessSpecifier>& specifier) override;
+
+ virtual ndk::ScopedAStatus getUsageSettingResponse(const RadioResponseInfo& info,
+ UsageSetting usageSetting) override;
+
+ virtual ndk::ScopedAStatus getVoiceRadioTechnologyResponse(const RadioResponseInfo& info,
+ RadioTechnology rat) override;
+
+ virtual ndk::ScopedAStatus getVoiceRegistrationStateResponse(
+ const RadioResponseInfo& info, const RegStateResult& voiceRegResponse) override;
+
+ virtual ndk::ScopedAStatus isNrDualConnectivityEnabledResponse(const RadioResponseInfo& info,
+ bool isEnabled) override;
+
+ virtual ndk::ScopedAStatus setAllowedNetworkTypesBitmapResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setBandModeResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setBarringPasswordResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setCdmaRoamingPreferenceResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setCellInfoListRateResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setIndicationFilterResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setLinkCapacityReportingCriteriaResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setLocationUpdatesResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setNetworkSelectionModeAutomaticResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setNetworkSelectionModeManualResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setNrDualConnectivityStateResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setSignalStrengthReportingCriteriaResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setSuppServiceNotificationsResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setSystemSelectionChannelsResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setUsageSettingResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus startNetworkScanResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus stopNetworkScanResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus supplyNetworkDepersonalizationResponse(
+ const RadioResponseInfo& info, int32_t remainingRetries) override;
+};
+
+/* Callback class for radio network indication */
+class RadioNetworkIndication : public BnRadioNetworkIndication {
+ protected:
+ RadioNetworkTest& parent_network;
+
+ public:
+ RadioNetworkIndication(RadioNetworkTest& parent_network);
+ virtual ~RadioNetworkIndication() = default;
+
+ virtual ndk::ScopedAStatus barringInfoChanged(
+ RadioIndicationType type, const CellIdentity& cellIdentity,
+ const std::vector<BarringInfo>& barringInfos) override;
+
+ virtual ndk::ScopedAStatus cdmaPrlChanged(RadioIndicationType type, int32_t version) override;
+
+ virtual ndk::ScopedAStatus cellInfoList(RadioIndicationType type,
+ const std::vector<CellInfo>& records) override;
+
+ virtual ndk::ScopedAStatus currentLinkCapacityEstimate(
+ RadioIndicationType type, const LinkCapacityEstimate& lce) override;
+
+ virtual ndk::ScopedAStatus currentPhysicalChannelConfigs(
+ RadioIndicationType type, const std::vector<PhysicalChannelConfig>& configs) override;
+
+ virtual ndk::ScopedAStatus currentSignalStrength(RadioIndicationType type,
+ const SignalStrength& signalStrength) override;
+
+ virtual ndk::ScopedAStatus imsNetworkStateChanged(RadioIndicationType type) override;
+
+ virtual ndk::ScopedAStatus networkScanResult(RadioIndicationType type,
+ const NetworkScanResult& result) override;
+
+ virtual ndk::ScopedAStatus networkStateChanged(RadioIndicationType type) override;
+
+ virtual ndk::ScopedAStatus nitzTimeReceived(RadioIndicationType type,
+ const std::string& nitzTime, int64_t receivedTimeMs,
+ int64_t ageMs) override;
+
+ virtual ndk::ScopedAStatus registrationFailed(RadioIndicationType type,
+ const CellIdentity& cellIdentity,
+ const std::string& chosenPlmn, Domain domain,
+ int32_t causeCode,
+ int32_t additionalCauseCode) override;
+
+ virtual ndk::ScopedAStatus restrictedStateChanged(RadioIndicationType type,
+ PhoneRestrictedState state) override;
+
+ virtual ndk::ScopedAStatus suppSvcNotify(RadioIndicationType type,
+ const SuppSvcNotification& suppSvc) override;
+
+ virtual ndk::ScopedAStatus voiceRadioTechChanged(RadioIndicationType type,
+ RadioTechnology rat) override;
+};
+
+// The main test class for Radio AIDL Network.
+class RadioNetworkTest : public ::testing::TestWithParam<std::string>, public RadioResponseWaiter {
+ public:
+ virtual void SetUp() override;
+
+ /* radio network service handle */
+ std::shared_ptr<IRadioNetwork> radio_network;
+ /* radio network response handle */
+ std::shared_ptr<RadioNetworkResponse> radioRsp_network;
+ /* radio network indication handle */
+ std::shared_ptr<RadioNetworkIndication> radioInd_network;
+
+ void invokeAndExpectResponse(std::function<ndk::ScopedAStatus(int32_t serial)> request,
+ std::vector<RadioError> errors_to_check);
+
+ // Helper function to reduce copy+paste
+ void testSetUsageSetting_InvalidValues(std::vector<RadioError> errors);
+};
diff --git a/radio/aidl/vts/radio_sim_indication.cpp b/radio/aidl/vts/radio_sim_indication.cpp
new file mode 100644
index 0000000..0385845
--- /dev/null
+++ b/radio/aidl/vts/radio_sim_indication.cpp
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "radio_sim_utils.h"
+
+RadioSimIndication::RadioSimIndication(RadioSimTest& parent) : parent_sim(parent) {}
+
+ndk::ScopedAStatus RadioSimIndication::carrierInfoForImsiEncryption(RadioIndicationType /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimIndication::cdmaSubscriptionSourceChanged(
+ RadioIndicationType /*type*/, CdmaSubscriptionSource /*cdmaSource*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimIndication::simPhonebookChanged(RadioIndicationType /*type*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimIndication::simPhonebookRecordsReceived(
+ RadioIndicationType /*type*/, PbReceivedStatus /*status*/,
+ const std::vector<PhonebookRecordInfo>& /*records*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimIndication::simRefresh(RadioIndicationType /*type*/,
+ const SimRefreshResult& /*refreshResult*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimIndication::simStatusChanged(RadioIndicationType /*type*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimIndication::stkEventNotify(RadioIndicationType /*type*/,
+ const std::string& /*cmd*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimIndication::stkProactiveCommand(RadioIndicationType /*type*/,
+ const std::string& /*cmd*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimIndication::stkSessionEnd(RadioIndicationType /*type*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimIndication::subscriptionStatusChanged(RadioIndicationType /*type*/,
+ bool /*activate*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimIndication::uiccApplicationsEnablementChanged(
+ RadioIndicationType /*type*/, bool /*enabled*/) {
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_sim_response.cpp b/radio/aidl/vts/radio_sim_response.cpp
new file mode 100644
index 0000000..2c796fa
--- /dev/null
+++ b/radio/aidl/vts/radio_sim_response.cpp
@@ -0,0 +1,209 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "radio_sim_utils.h"
+
+RadioSimResponse::RadioSimResponse(RadioResponseWaiter& parent) : parent_sim(parent) {}
+
+ndk::ScopedAStatus RadioSimResponse::acknowledgeRequest(int32_t /*serial*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::areUiccApplicationsEnabledResponse(
+ const RadioResponseInfo& /*info*/, bool /*enabled*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::changeIccPin2ForAppResponse(const RadioResponseInfo& /*info*/,
+ int32_t /*remainingRetries*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::changeIccPinForAppResponse(const RadioResponseInfo& /*info*/,
+ int32_t /*remainingRetries*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::enableUiccApplicationsResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::getAllowedCarriersResponse(
+ const RadioResponseInfo& /*info*/, const CarrierRestrictions& /*carriers*/,
+ SimLockMultiSimPolicy /*multiSimPolicy*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::getCdmaSubscriptionResponse(
+ const RadioResponseInfo& /*info*/, const std::string& /*mdn*/, const std::string& /*hSid*/,
+ const std::string& /*hNid*/, const std::string& /*min*/, const std::string& /*prl*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::getCdmaSubscriptionSourceResponse(
+ const RadioResponseInfo& /*info*/, CdmaSubscriptionSource /*source*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::getFacilityLockForAppResponse(
+ const RadioResponseInfo& /*info*/, int32_t /*response*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::getIccCardStatusResponse(const RadioResponseInfo& info,
+ const CardStatus& card_status) {
+ rspInfo = info;
+ cardStatus = card_status;
+ parent_sim.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::getImsiForAppResponse(const RadioResponseInfo& /*info*/,
+ const std::string& /*imsi*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::getSimPhonebookCapacityResponse(
+ const RadioResponseInfo& info, const PhonebookCapacity& pbCapacity) {
+ rspInfo = info;
+ capacity = pbCapacity;
+ parent_sim.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::getSimPhonebookRecordsResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::iccCloseLogicalChannelResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::iccIoForAppResponse(const RadioResponseInfo& /*info*/,
+ const IccIoResult& /*iccIo*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::iccOpenLogicalChannelResponse(
+ const RadioResponseInfo& /*info*/, int32_t /*channelId*/,
+ const std::vector<uint8_t>& /*selectResponse*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::iccTransmitApduBasicChannelResponse(
+ const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::iccTransmitApduLogicalChannelResponse(
+ const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::reportStkServiceIsRunningResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::requestIccSimAuthenticationResponse(
+ const RadioResponseInfo& /*info*/, const IccIoResult& /*result*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::sendEnvelopeResponse(const RadioResponseInfo& /*info*/,
+ const std::string& /*commandResponse*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::sendEnvelopeWithStatusResponse(
+ const RadioResponseInfo& /*info*/, const IccIoResult& /*iccIo*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::sendTerminalResponseToSimResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::setAllowedCarriersResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::setCarrierInfoForImsiEncryptionResponse(
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::setCdmaSubscriptionSourceResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::setFacilityLockForAppResponse(
+ const RadioResponseInfo& /*info*/, int32_t /*retry*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::setSimCardPowerResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_sim.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::setUiccSubscriptionResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::supplyIccPin2ForAppResponse(const RadioResponseInfo& /*info*/,
+ int32_t /*remainingRetries*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::supplyIccPinForAppResponse(const RadioResponseInfo& /*info*/,
+ int32_t /*remainingRetries*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::supplyIccPuk2ForAppResponse(const RadioResponseInfo& /*info*/,
+ int32_t /*remainingRetries*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::supplyIccPukForAppResponse(const RadioResponseInfo& /*info*/,
+ int32_t /*remainingRetries*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::supplySimDepersonalizationResponse(
+ const RadioResponseInfo& /*info*/, PersoSubstate /*persoType*/,
+ int32_t /*remainingRetries*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioSimResponse::updateSimPhonebookRecordsResponse(
+ const RadioResponseInfo& info, int32_t recordIndex) {
+ rspInfo = info;
+ updatedRecordIndex = recordIndex;
+ parent_sim.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_sim_test.cpp b/radio/aidl/vts/radio_sim_test.cpp
new file mode 100644
index 0000000..c70219f
--- /dev/null
+++ b/radio/aidl/vts/radio_sim_test.cpp
@@ -0,0 +1,259 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/android/hardware/radio/config/IRadioConfig.h>
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+
+#include "radio_sim_utils.h"
+
+#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
+
+void RadioSimTest::SetUp() {
+ std::string serviceName = GetParam();
+
+ if (!isServiceValidForDeviceConfiguration(serviceName)) {
+ ALOGI("Skipped the test due to device configuration.");
+ GTEST_SKIP();
+ }
+
+ radio_sim = IRadioSim::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
+ ASSERT_NE(nullptr, radio_sim.get());
+
+ radioRsp_sim = ndk::SharedRefBase::make<RadioSimResponse>(*this);
+ ASSERT_NE(nullptr, radioRsp_sim.get());
+
+ count_ = 0;
+
+ radioInd_sim = ndk::SharedRefBase::make<RadioSimIndication>(*this);
+ ASSERT_NE(nullptr, radioInd_sim.get());
+
+ radio_sim->setResponseFunctions(radioRsp_sim, radioInd_sim);
+
+ // Assert IRadioConfig exists before testing
+ std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfig> radioConfig =
+ aidl::android::hardware::radio::config::IRadioConfig::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(
+ "android.hardware.radio.config.IRadioConfig/default")));
+ ASSERT_NE(nullptr, radioConfig.get());
+}
+
+ndk::ScopedAStatus RadioSimTest::updateSimCardStatus() {
+ serial = GetRandomSerialNumber();
+ radio_sim->getIccCardStatus(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ return ndk::ScopedAStatus::ok();
+}
+
+/*
+ * Test IRadioSim.setSimCardPower() for the response returned.
+ */
+TEST_P(RadioSimTest, setSimCardPower) {
+ /* Test setSimCardPower power down */
+ serial = GetRandomSerialNumber();
+ radio_sim->setSimCardPower(serial, CardPowerState::POWER_DOWN);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS,
+ RadioError::RADIO_NOT_AVAILABLE, RadioError::SIM_ERR}));
+
+ // setSimCardPower does not return until the request is handled, and should not trigger
+ // CardStatus::STATE_ABSENT when turning off power
+ if (radioRsp_sim->rspInfo.error == RadioError::NONE) {
+ /* Wait some time for setting sim power down and then verify it */
+ updateSimCardStatus();
+ // We cannot assert the consistency of CardState here due to b/203031664
+ // EXPECT_EQ(CardStatus::STATE_PRESENT, cardStatus.cardState);
+ // applications should be an empty vector of AppStatus
+ EXPECT_EQ(0, cardStatus.applications.size());
+ }
+
+ // Give some time for modem to fully power down the SIM card
+ sleep(MODEM_SET_SIM_POWER_DELAY_IN_SECONDS);
+
+ /* Test setSimCardPower power up */
+ serial = GetRandomSerialNumber();
+ radio_sim->setSimCardPower(serial, CardPowerState::POWER_UP);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::NONE, RadioError::INVALID_ARGUMENTS,
+ RadioError::RADIO_NOT_AVAILABLE, RadioError::SIM_ERR}));
+
+ // Give some time for modem to fully power up the SIM card
+ sleep(MODEM_SET_SIM_POWER_DELAY_IN_SECONDS);
+
+ // setSimCardPower does not return until the request is handled. Just verify that we still
+ // have CardStatus::STATE_PRESENT after turning the power back on
+ if (radioRsp_sim->rspInfo.error == RadioError::NONE) {
+ updateSimCardStatus();
+ EXPECT_EQ(CardStatus::STATE_PRESENT, cardStatus.cardState);
+ }
+}
+
+/*
+ * Test IRadioSim.setCarrierInfoForImsiEncryption() for the response returned.
+ */
+TEST_P(RadioSimTest, setCarrierInfoForImsiEncryption) {
+ serial = GetRandomSerialNumber();
+ ImsiEncryptionInfo imsiInfo;
+ imsiInfo.mcc = "310";
+ imsiInfo.mnc = "004";
+ imsiInfo.carrierKey = (std::vector<uint8_t>){1, 2, 3, 4, 5, 6};
+ imsiInfo.keyIdentifier = "Test";
+ imsiInfo.expirationTime = 20180101;
+ imsiInfo.keyType = ImsiEncryptionInfo::PUBLIC_KEY_TYPE_EPDG;
+
+ radio_sim->setCarrierInfoForImsiEncryption(serial, imsiInfo);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+}
+
+/*
+ * Test IRadioSim.getSimPhonebookRecords() for the response returned.
+ */
+TEST_P(RadioSimTest, getSimPhonebookRecords) {
+ serial = GetRandomSerialNumber();
+ radio_sim->getSimPhonebookRecords(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::INVALID_SIM_STATE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::MODEM_ERR, RadioError::INVALID_ARGUMENTS,
+ RadioError::REQUEST_NOT_SUPPORTED},
+ CHECK_GENERAL_ERROR));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED},
+ CHECK_GENERAL_ERROR));
+ }
+}
+
+/*
+ * Test IRadioSim.getSimPhonebookCapacity for the response returned.
+ */
+TEST_P(RadioSimTest, getSimPhonebookCapacity) {
+ serial = GetRandomSerialNumber();
+ radio_sim->getSimPhonebookCapacity(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::INVALID_SIM_STATE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::MODEM_ERR, RadioError::INVALID_ARGUMENTS,
+ RadioError::REQUEST_NOT_SUPPORTED},
+ CHECK_GENERAL_ERROR));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED},
+ CHECK_GENERAL_ERROR));
+
+ PhonebookCapacity pbCapacity = radioRsp_sim->capacity;
+ if (pbCapacity.maxAdnRecords > 0) {
+ EXPECT_TRUE(pbCapacity.maxNameLen > 0 && pbCapacity.maxNumberLen > 0);
+ EXPECT_TRUE(pbCapacity.usedAdnRecords <= pbCapacity.maxAdnRecords);
+ }
+
+ if (pbCapacity.maxEmailRecords > 0) {
+ EXPECT_TRUE(pbCapacity.maxEmailLen > 0);
+ EXPECT_TRUE(pbCapacity.usedEmailRecords <= pbCapacity.maxEmailRecords);
+ }
+
+ if (pbCapacity.maxAdditionalNumberRecords > 0) {
+ EXPECT_TRUE(pbCapacity.maxAdditionalNumberLen > 0);
+ EXPECT_TRUE(pbCapacity.usedAdditionalNumberRecords <=
+ pbCapacity.maxAdditionalNumberRecords);
+ }
+ }
+}
+
+/*
+ * Test IRadioSim.updateSimPhonebookRecords() for the response returned.
+ */
+TEST_P(RadioSimTest, updateSimPhonebookRecords) {
+ serial = GetRandomSerialNumber();
+ radio_sim->getSimPhonebookCapacity(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
+ ASSERT_TRUE(
+ CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::INVALID_SIM_STATE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::MODEM_ERR, RadioError::INVALID_ARGUMENTS,
+ RadioError::REQUEST_NOT_SUPPORTED},
+ CHECK_GENERAL_ERROR));
+ } else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED},
+ CHECK_GENERAL_ERROR));
+ PhonebookCapacity pbCapacity = radioRsp_sim->capacity;
+
+ serial = GetRandomSerialNumber();
+ radio_sim->getSimPhonebookRecords(serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED},
+ CHECK_GENERAL_ERROR));
+
+ if (pbCapacity.maxAdnRecords > 0 && pbCapacity.usedAdnRecords < pbCapacity.maxAdnRecords) {
+ // Add a phonebook record
+ PhonebookRecordInfo recordInfo;
+ recordInfo.recordId = 0;
+ recordInfo.name = "ABC";
+ recordInfo.number = "1234567890";
+ serial = GetRandomSerialNumber();
+ radio_sim->updateSimPhonebookRecords(serial, recordInfo);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
+ int index = radioRsp_sim->updatedRecordIndex;
+ EXPECT_TRUE(index > 0);
+
+ // Deleted a phonebook record
+ recordInfo.recordId = index;
+ recordInfo.name = "";
+ recordInfo.number = "";
+ serial = GetRandomSerialNumber();
+ radio_sim->updateSimPhonebookRecords(serial, recordInfo);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial);
+ EXPECT_EQ(RadioError::NONE, radioRsp_sim->rspInfo.error);
+ }
+ }
+}
diff --git a/radio/aidl/vts/radio_sim_utils.h b/radio/aidl/vts/radio_sim_utils.h
new file mode 100644
index 0000000..6cb6790
--- /dev/null
+++ b/radio/aidl/vts/radio_sim_utils.h
@@ -0,0 +1,207 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/radio/sim/BnRadioSimIndication.h>
+#include <aidl/android/hardware/radio/sim/BnRadioSimResponse.h>
+#include <aidl/android/hardware/radio/sim/IRadioSim.h>
+
+#include "radio_aidl_hal_utils.h"
+
+using namespace aidl::android::hardware::radio::sim;
+
+class RadioSimTest;
+
+/* Callback class for radio SIM response */
+class RadioSimResponse : public BnRadioSimResponse {
+ protected:
+ RadioResponseWaiter& parent_sim;
+
+ public:
+ RadioSimResponse(RadioResponseWaiter& parent_sim);
+ virtual ~RadioSimResponse() = default;
+
+ RadioResponseInfo rspInfo;
+ CarrierRestrictions carrierRestrictionsResp;
+ SimLockMultiSimPolicy multiSimPolicyResp;
+ bool canToggleUiccApplicationsEnablement;
+ bool areUiccApplicationsEnabled;
+ PhonebookCapacity capacity;
+ int32_t updatedRecordIndex;
+
+ virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override;
+
+ virtual ndk::ScopedAStatus areUiccApplicationsEnabledResponse(const RadioResponseInfo& info,
+ bool enabled) override;
+
+ virtual ndk::ScopedAStatus changeIccPin2ForAppResponse(const RadioResponseInfo& info,
+ int32_t remainingRetries) override;
+
+ virtual ndk::ScopedAStatus changeIccPinForAppResponse(const RadioResponseInfo& info,
+ int32_t remainingRetries) override;
+
+ virtual ndk::ScopedAStatus enableUiccApplicationsResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus getAllowedCarriersResponse(
+ const RadioResponseInfo& info, const CarrierRestrictions& carriers,
+ const SimLockMultiSimPolicy multiSimPolicy) override;
+
+ virtual ndk::ScopedAStatus getCdmaSubscriptionResponse(
+ const RadioResponseInfo& info, const std::string& mdn, const std::string& hSid,
+ const std::string& hNid, const std::string& min, const std::string& prl) override;
+
+ virtual ndk::ScopedAStatus getCdmaSubscriptionSourceResponse(
+ const RadioResponseInfo& info, CdmaSubscriptionSource source) override;
+
+ virtual ndk::ScopedAStatus getFacilityLockForAppResponse(const RadioResponseInfo& info,
+ int32_t response) override;
+
+ virtual ndk::ScopedAStatus getIccCardStatusResponse(const RadioResponseInfo& info,
+ const CardStatus& cardStatus) override;
+
+ virtual ndk::ScopedAStatus getImsiForAppResponse(const RadioResponseInfo& info,
+ const std::string& imsi) override;
+
+ virtual ndk::ScopedAStatus getSimPhonebookCapacityResponse(
+ const RadioResponseInfo& info, const PhonebookCapacity& capacity) override;
+
+ virtual ndk::ScopedAStatus getSimPhonebookRecordsResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus iccCloseLogicalChannelResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus iccIoForAppResponse(const RadioResponseInfo& info,
+ const IccIoResult& iccIo) override;
+
+ virtual ndk::ScopedAStatus iccOpenLogicalChannelResponse(
+ const RadioResponseInfo& info, int32_t channelId,
+ const std::vector<uint8_t>& selectResponse) override;
+
+ virtual ndk::ScopedAStatus iccTransmitApduBasicChannelResponse(
+ const RadioResponseInfo& info, const IccIoResult& result) override;
+
+ virtual ndk::ScopedAStatus iccTransmitApduLogicalChannelResponse(
+ const RadioResponseInfo& info, const IccIoResult& result) override;
+
+ virtual ndk::ScopedAStatus reportStkServiceIsRunningResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus requestIccSimAuthenticationResponse(
+ const RadioResponseInfo& info, const IccIoResult& result) override;
+
+ virtual ndk::ScopedAStatus sendEnvelopeResponse(const RadioResponseInfo& info,
+ const std::string& commandResponse) override;
+
+ virtual ndk::ScopedAStatus sendEnvelopeWithStatusResponse(const RadioResponseInfo& info,
+ const IccIoResult& iccIo) override;
+
+ virtual ndk::ScopedAStatus sendTerminalResponseToSimResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setAllowedCarriersResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setCarrierInfoForImsiEncryptionResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setCdmaSubscriptionSourceResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setFacilityLockForAppResponse(const RadioResponseInfo& info,
+ int32_t retry) override;
+
+ virtual ndk::ScopedAStatus setSimCardPowerResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setUiccSubscriptionResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus supplyIccPin2ForAppResponse(const RadioResponseInfo& info,
+ int32_t remainingRetries) override;
+
+ virtual ndk::ScopedAStatus supplyIccPinForAppResponse(const RadioResponseInfo& info,
+ int32_t remainingRetries) override;
+
+ virtual ndk::ScopedAStatus supplyIccPuk2ForAppResponse(const RadioResponseInfo& info,
+ int32_t remainingRetries) override;
+
+ virtual ndk::ScopedAStatus supplyIccPukForAppResponse(const RadioResponseInfo& info,
+ int32_t remainingRetries) override;
+
+ virtual ndk::ScopedAStatus supplySimDepersonalizationResponse(
+ const RadioResponseInfo& info, PersoSubstate persoType,
+ int32_t remainingRetries) override;
+
+ virtual ndk::ScopedAStatus updateSimPhonebookRecordsResponse(
+ const RadioResponseInfo& info, int32_t updatedRecordIndex) override;
+};
+
+/* Callback class for radio SIM indication */
+class RadioSimIndication : public BnRadioSimIndication {
+ protected:
+ RadioSimTest& parent_sim;
+
+ public:
+ RadioSimIndication(RadioSimTest& parent_sim);
+ virtual ~RadioSimIndication() = default;
+
+ virtual ndk::ScopedAStatus carrierInfoForImsiEncryption(RadioIndicationType info) override;
+
+ virtual ndk::ScopedAStatus cdmaSubscriptionSourceChanged(
+ RadioIndicationType type, CdmaSubscriptionSource cdmaSource) override;
+
+ virtual ndk::ScopedAStatus simPhonebookChanged(RadioIndicationType type) override;
+
+ virtual ndk::ScopedAStatus simPhonebookRecordsReceived(
+ RadioIndicationType type, PbReceivedStatus status,
+ const std::vector<PhonebookRecordInfo>& records) override;
+
+ virtual ndk::ScopedAStatus simRefresh(RadioIndicationType type,
+ const SimRefreshResult& refreshResult) override;
+
+ virtual ndk::ScopedAStatus simStatusChanged(RadioIndicationType type) override;
+
+ virtual ndk::ScopedAStatus stkEventNotify(RadioIndicationType type,
+ const std::string& cmd) override;
+
+ virtual ndk::ScopedAStatus stkProactiveCommand(RadioIndicationType type,
+ const std::string& cmd) override;
+
+ virtual ndk::ScopedAStatus stkSessionEnd(RadioIndicationType type) override;
+
+ virtual ndk::ScopedAStatus subscriptionStatusChanged(RadioIndicationType type,
+ bool activate) override;
+
+ virtual ndk::ScopedAStatus uiccApplicationsEnablementChanged(RadioIndicationType type,
+ bool enabled) override;
+};
+
+// The main test class for Radio AIDL SIM.
+class RadioSimTest : public ::testing::TestWithParam<std::string>, public RadioResponseWaiter {
+ protected:
+ /* Update Sim Card Status */
+ virtual ndk::ScopedAStatus updateSimCardStatus();
+
+ public:
+ virtual void SetUp() override;
+
+ /* radio SIM service handle */
+ std::shared_ptr<IRadioSim> radio_sim;
+ /* radio SIM response handle */
+ std::shared_ptr<RadioSimResponse> radioRsp_sim;
+ /* radio SIM indication handle */
+ std::shared_ptr<RadioSimIndication> radioInd_sim;
+};
diff --git a/radio/aidl/vts/radio_voice_indication.cpp b/radio/aidl/vts/radio_voice_indication.cpp
new file mode 100644
index 0000000..2c46817
--- /dev/null
+++ b/radio/aidl/vts/radio_voice_indication.cpp
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "radio_voice_utils.h"
+
+RadioVoiceIndication::RadioVoiceIndication(RadioVoiceTest& parent) : parent_voice(parent) {}
+
+ndk::ScopedAStatus RadioVoiceIndication::callRing(RadioIndicationType /*type*/, bool /*isGsm*/,
+ const CdmaSignalInfoRecord& /*record*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceIndication::callStateChanged(RadioIndicationType /*type*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceIndication::cdmaCallWaiting(
+ RadioIndicationType /*type*/, const CdmaCallWaiting& /*callWaitingRecord*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceIndication::cdmaInfoRec(
+ RadioIndicationType /*type*/, const std::vector<CdmaInformationRecord>& /*records*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceIndication::cdmaOtaProvisionStatus(RadioIndicationType /*type*/,
+ CdmaOtaProvisionStatus /*status*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceIndication::currentEmergencyNumberList(
+ RadioIndicationType /*type*/, const std::vector<EmergencyNumber>& /*emergencyNumberList*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceIndication::enterEmergencyCallbackMode(RadioIndicationType /*type*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceIndication::exitEmergencyCallbackMode(RadioIndicationType /*type*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceIndication::indicateRingbackTone(RadioIndicationType /*type*/,
+ bool /*start*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceIndication::onSupplementaryServiceIndication(
+ RadioIndicationType /*type*/, const StkCcUnsolSsResult& /*ss*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceIndication::resendIncallMute(RadioIndicationType /*type*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceIndication::srvccStateNotify(RadioIndicationType /*type*/,
+ SrvccState /*state*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceIndication::stkCallControlAlphaNotify(RadioIndicationType /*type*/,
+ const std::string& /*alpha*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceIndication::stkCallSetup(RadioIndicationType /*type*/,
+ int64_t /*timeout*/) {
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_voice_response.cpp b/radio/aidl/vts/radio_voice_response.cpp
new file mode 100644
index 0000000..ca350c6
--- /dev/null
+++ b/radio/aidl/vts/radio_voice_response.cpp
@@ -0,0 +1,191 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "radio_voice_utils.h"
+
+RadioVoiceResponse::RadioVoiceResponse(RadioResponseWaiter& parent) : parent_voice(parent) {}
+
+ndk::ScopedAStatus RadioVoiceResponse::acceptCallResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::acknowledgeRequest(int32_t /*serial*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::conferenceResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::dialResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::emergencyDialResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::exitEmergencyCallbackModeResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::explicitCallTransferResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::getCallForwardStatusResponse(
+ const RadioResponseInfo& /*info*/,
+ const std::vector<CallForwardInfo>& /*callForwardInfos*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::getCallWaitingResponse(const RadioResponseInfo& /*info*/,
+ bool /*enable*/,
+ int32_t /*serviceClass*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::getClipResponse(const RadioResponseInfo& /*info*/,
+ ClipStatus /*status*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::getClirResponse(const RadioResponseInfo& /*info*/,
+ int32_t /*n*/, int32_t /*m*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::getCurrentCallsResponse(const RadioResponseInfo& info,
+ const std::vector<Call>& calls) {
+ rspInfo = info;
+ currentCalls = calls;
+ parent_voice.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::getLastCallFailCauseResponse(
+ const RadioResponseInfo& /*info*/, const LastCallFailCauseInfo& /*failCauseInfo*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::getMuteResponse(const RadioResponseInfo& /*info*/,
+ bool /*enable*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::getPreferredVoicePrivacyResponse(
+ const RadioResponseInfo& /*info*/, bool /*enable*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::getTtyModeResponse(const RadioResponseInfo& /*info*/,
+ TtyMode /*mode*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::handleStkCallSetupRequestFromSimResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::hangupConnectionResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_voice.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::hangupForegroundResumeBackgroundResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::hangupWaitingOrBackgroundResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::isVoNrEnabledResponse(const RadioResponseInfo& /*info*/,
+ bool /*enabled*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::rejectCallResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::sendBurstDtmfResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::sendCdmaFeatureCodeResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::sendDtmfResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::separateConnectionResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::setCallForwardResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::setCallWaitingResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::setClirResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::setMuteResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::setPreferredVoicePrivacyResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::setTtyModeResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::setVoNrEnabledResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::startDtmfResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::stopDtmfResponse(const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioVoiceResponse::switchWaitingOrHoldingAndActiveResponse(
+ const RadioResponseInfo& /*info*/) {
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_voice_test.cpp b/radio/aidl/vts/radio_voice_test.cpp
new file mode 100644
index 0000000..201f14c
--- /dev/null
+++ b/radio/aidl/vts/radio_voice_test.cpp
@@ -0,0 +1,261 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/android/hardware/radio/config/IRadioConfig.h>
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+
+#include "radio_voice_utils.h"
+
+#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
+
+void RadioVoiceTest::SetUp() {
+ std::string serviceName = GetParam();
+
+ if (!isServiceValidForDeviceConfiguration(serviceName)) {
+ ALOGI("Skipped the test due to device configuration.");
+ GTEST_SKIP();
+ }
+
+ radio_voice = IRadioVoice::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
+ ASSERT_NE(nullptr, radio_voice.get());
+
+ radioRsp_voice = ndk::SharedRefBase::make<RadioVoiceResponse>(*this);
+ ASSERT_NE(nullptr, radioRsp_voice.get());
+
+ count_ = 0;
+
+ radioInd_voice = ndk::SharedRefBase::make<RadioVoiceIndication>(*this);
+ ASSERT_NE(nullptr, radioInd_voice.get());
+
+ radio_voice->setResponseFunctions(radioRsp_voice, radioInd_voice);
+
+ // Assert IRadioConfig exists before testing
+ std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfig> radioConfig =
+ aidl::android::hardware::radio::config::IRadioConfig::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(
+ "android.hardware.radio.config.IRadioConfig/default")));
+ ASSERT_NE(nullptr, radioConfig.get());
+}
+
+ndk::ScopedAStatus RadioVoiceTest::clearPotentialEstablishedCalls() {
+ // Get the current call Id to hangup the established emergency call.
+ serial = GetRandomSerialNumber();
+ radio_voice->getCurrentCalls(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+
+ // Hang up to disconnect the established call channels.
+ for (const Call& call : radioRsp_voice->currentCalls) {
+ serial = GetRandomSerialNumber();
+ radio_voice->hangup(serial, call.index);
+ ALOGI("Hang up to disconnect the established call channel: %d", call.index);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ // Give some time for modem to disconnect the established call channel.
+ sleep(MODEM_EMERGENCY_CALL_DISCONNECT_TIME);
+ }
+
+ // Verify there are no more current calls.
+ serial = GetRandomSerialNumber();
+ radio_voice->getCurrentCalls(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(0, radioRsp_voice->currentCalls.size());
+ return ndk::ScopedAStatus::ok();
+}
+
+/*
+ * Test IRadioVoice.emergencyDial() for the response returned.
+ */
+TEST_P(RadioVoiceTest, emergencyDial) {
+ if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
+ ALOGI("Skipping emergencyDial because voice call is not supported in device");
+ return;
+ } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
+ !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
+ return;
+ } else {
+ ALOGI("Running emergencyDial because voice call is supported in device");
+ }
+
+ serial = GetRandomSerialNumber();
+
+ Dial dialInfo;
+ dialInfo.address = std::string("911");
+ EmergencyServiceCategory categories = EmergencyServiceCategory::UNSPECIFIED;
+ std::vector<std::string> urns = {""};
+ EmergencyCallRouting routing = EmergencyCallRouting::UNKNOWN;
+
+ ndk::ScopedAStatus res =
+ radio_voice->emergencyDial(serial, dialInfo, categories, urns, routing, true, true);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ ALOGI("emergencyDial, rspInfo.error = %s\n", toString(radioRsp_voice->rspInfo.error).c_str());
+
+ RadioError rspEmergencyDial = radioRsp_voice->rspInfo.error;
+ // In DSDS or TSTS, we only check the result if the current slot is IN_SERVICE
+ // or Emergency_Only.
+ if (isDsDsEnabled() || isTsTsEnabled()) {
+ // TODO(b/210712359): maybe create a local RadioNetwork instance
+ /**
+ serial = GetRandomSerialNumber();
+ radio_v1_6->getVoiceRegistrationState(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ if (isVoiceEmergencyOnly(radioRsp_v1_6->voiceRegResp.regState) ||
+ isVoiceInService(radioRsp_v1_6->voiceRegResp.regState)) {
+ EXPECT_EQ(RadioError::NONE, rspEmergencyDial);
+ }
+ **/
+ } else {
+ EXPECT_EQ(RadioError::NONE, rspEmergencyDial);
+ }
+
+ // Give some time for modem to establish the emergency call channel.
+ sleep(MODEM_EMERGENCY_CALL_ESTABLISH_TIME);
+
+ // Disconnect all the potential established calls to prevent them affecting other tests.
+ clearPotentialEstablishedCalls();
+}
+
+/*
+ * Test IRadioVoice.emergencyDial() with specified service and its response returned.
+ */
+TEST_P(RadioVoiceTest, emergencyDial_withServices) {
+ if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
+ ALOGI("Skipping emergencyDial because voice call is not supported in device");
+ return;
+ } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
+ !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
+ return;
+ } else {
+ ALOGI("Running emergencyDial because voice call is supported in device");
+ }
+
+ serial = GetRandomSerialNumber();
+
+ Dial dialInfo;
+ dialInfo.address = std::string("911");
+ EmergencyServiceCategory categories = EmergencyServiceCategory::AMBULANCE;
+ std::vector<std::string> urns = {"urn:service:sos.ambulance"};
+ EmergencyCallRouting routing = EmergencyCallRouting::UNKNOWN;
+
+ ndk::ScopedAStatus res =
+ radio_voice->emergencyDial(serial, dialInfo, categories, urns, routing, true, true);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ ALOGI("emergencyDial_withServices, rspInfo.error = %s\n",
+ toString(radioRsp_voice->rspInfo.error).c_str());
+ RadioError rspEmergencyDial = radioRsp_voice->rspInfo.error;
+
+ // In DSDS or TSTS, we only check the result if the current slot is IN_SERVICE
+ // or Emergency_Only.
+ if (isDsDsEnabled() || isTsTsEnabled()) {
+ // TODO(b/210712359): maybe create a local RadioNetwork instance
+ /**
+ serial = GetRandomSerialNumber();
+ radio_v1_6->getVoiceRegistrationState_1_6(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ if (isVoiceEmergencyOnly(radioRsp_v1_6->voiceRegResp.regState) ||
+ isVoiceInService(radioRsp_v1_6->voiceRegResp.regState)) {
+ EXPECT_EQ(RadioError::NONE, rspEmergencyDial);
+ }
+ **/
+ } else {
+ EXPECT_EQ(RadioError::NONE, rspEmergencyDial);
+ }
+ // Give some time for modem to establish the emergency call channel.
+ sleep(MODEM_EMERGENCY_CALL_ESTABLISH_TIME);
+
+ // Disconnect all the potential established calls to prevent them affecting other tests.
+ clearPotentialEstablishedCalls();
+}
+
+/*
+ * Test IRadioVoice.emergencyDial() with known emergency call routing and its response returned.
+ */
+TEST_P(RadioVoiceTest, emergencyDial_withEmergencyRouting) {
+ if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
+ ALOGI("Skipping emergencyDial because voice call is not supported in device");
+ return;
+ } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
+ !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
+ return;
+ } else {
+ ALOGI("Running emergencyDial because voice call is supported in device");
+ }
+
+ serial = GetRandomSerialNumber();
+
+ Dial dialInfo;
+ dialInfo.address = std::string("911");
+ EmergencyServiceCategory categories = EmergencyServiceCategory::UNSPECIFIED;
+ std::vector<std::string> urns = {""};
+ EmergencyCallRouting routing = EmergencyCallRouting::EMERGENCY;
+
+ ndk::ScopedAStatus res =
+ radio_voice->emergencyDial(serial, dialInfo, categories, urns, routing, true, true);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+
+ ALOGI("emergencyDial_withEmergencyRouting, rspInfo.error = %s\n",
+ toString(radioRsp_voice->rspInfo.error).c_str());
+ RadioError rspEmergencyDial = radioRsp_voice->rspInfo.error;
+
+ // In DSDS or TSTS, we only check the result if the current slot is IN_SERVICE
+ // or Emergency_Only.
+ if (isDsDsEnabled() || isTsTsEnabled()) {
+ // TODO(b/210712359): maybe create a local RadioNetwork instance
+ /**
+ serial = GetRandomSerialNumber();
+ radio_v1_6->getVoiceRegistrationState_1_6(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ if (isVoiceEmergencyOnly(radioRsp_v1_6->voiceRegResp.regState) ||
+ isVoiceInService(radioRsp_v1_6->voiceRegResp.regState)) {
+ EXPECT_EQ(RadioError::NONE, rspEmergencyDial);
+ }
+ **/
+ } else {
+ EXPECT_EQ(RadioError::NONE, rspEmergencyDial);
+ }
+
+ // Give some time for modem to establish the emergency call channel.
+ sleep(MODEM_EMERGENCY_CALL_ESTABLISH_TIME);
+
+ // Disconnect all the potential established calls to prevent them affecting other tests.
+ clearPotentialEstablishedCalls();
+}
+
+/*
+ * Test IRadioVoice.getCurrentCalls() for the response returned.
+ */
+TEST_P(RadioVoiceTest, getCurrentCalls) {
+ serial = GetRandomSerialNumber();
+ radio_voice->getCurrentCalls(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_voice->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_voice->rspInfo.serial);
+ EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error);
+}
diff --git a/radio/aidl/vts/radio_voice_utils.h b/radio/aidl/vts/radio_voice_utils.h
new file mode 100644
index 0000000..a676a7f
--- /dev/null
+++ b/radio/aidl/vts/radio_voice_utils.h
@@ -0,0 +1,192 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/radio/voice/BnRadioVoiceIndication.h>
+#include <aidl/android/hardware/radio/voice/BnRadioVoiceResponse.h>
+#include <aidl/android/hardware/radio/voice/IRadioVoice.h>
+
+#include "radio_aidl_hal_utils.h"
+
+using namespace aidl::android::hardware::radio::voice;
+
+class RadioVoiceTest;
+
+/* Callback class for radio voice response */
+class RadioVoiceResponse : public BnRadioVoiceResponse {
+ protected:
+ RadioResponseWaiter& parent_voice;
+
+ public:
+ RadioVoiceResponse(RadioResponseWaiter& parent_voice);
+ virtual ~RadioVoiceResponse() = default;
+
+ RadioResponseInfo rspInfo;
+ std::vector<Call> currentCalls;
+
+ virtual ndk::ScopedAStatus acceptCallResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override;
+
+ virtual ndk::ScopedAStatus conferenceResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus dialResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus emergencyDialResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus exitEmergencyCallbackModeResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus explicitCallTransferResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus getCallForwardStatusResponse(
+ const RadioResponseInfo& info,
+ const std::vector<CallForwardInfo>& call_forwardInfos) override;
+
+ virtual ndk::ScopedAStatus getCallWaitingResponse(const RadioResponseInfo& info, bool enable,
+ int32_t serviceClass) override;
+
+ virtual ndk::ScopedAStatus getClipResponse(const RadioResponseInfo& info,
+ ClipStatus status) override;
+
+ virtual ndk::ScopedAStatus getClirResponse(const RadioResponseInfo& info, int32_t n,
+ int32_t m) override;
+
+ virtual ndk::ScopedAStatus getCurrentCallsResponse(const RadioResponseInfo& info,
+ const std::vector<Call>& calls) override;
+
+ virtual ndk::ScopedAStatus getLastCallFailCauseResponse(
+ const RadioResponseInfo& info, const LastCallFailCauseInfo& failCauseInfo) override;
+
+ virtual ndk::ScopedAStatus getMuteResponse(const RadioResponseInfo& info, bool enable) override;
+
+ virtual ndk::ScopedAStatus getPreferredVoicePrivacyResponse(const RadioResponseInfo& info,
+ bool enable) override;
+
+ virtual ndk::ScopedAStatus getTtyModeResponse(const RadioResponseInfo& info,
+ TtyMode mode) override;
+
+ virtual ndk::ScopedAStatus handleStkCallSetupRequestFromSimResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus hangupConnectionResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus hangupForegroundResumeBackgroundResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus hangupWaitingOrBackgroundResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus isVoNrEnabledResponse(const RadioResponseInfo& info,
+ bool enable) override;
+
+ virtual ndk::ScopedAStatus rejectCallResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus sendBurstDtmfResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus sendCdmaFeatureCodeResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus sendDtmfResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus separateConnectionResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setCallForwardResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setCallWaitingResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setClirResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setMuteResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setPreferredVoicePrivacyResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setTtyModeResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setVoNrEnabledResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus startDtmfResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus stopDtmfResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus switchWaitingOrHoldingAndActiveResponse(
+ const RadioResponseInfo& info) override;
+};
+
+/* Callback class for radio voice indication */
+class RadioVoiceIndication : public BnRadioVoiceIndication {
+ protected:
+ RadioVoiceTest& parent_voice;
+
+ public:
+ RadioVoiceIndication(RadioVoiceTest& parent_voice);
+ virtual ~RadioVoiceIndication() = default;
+
+ virtual ndk::ScopedAStatus callRing(RadioIndicationType type, bool isGsm,
+ const CdmaSignalInfoRecord& record) override;
+
+ virtual ndk::ScopedAStatus callStateChanged(RadioIndicationType type) override;
+
+ virtual ndk::ScopedAStatus cdmaCallWaiting(RadioIndicationType type,
+ const CdmaCallWaiting& callWaitingRecord) override;
+
+ virtual ndk::ScopedAStatus cdmaInfoRec(
+ RadioIndicationType type, const std::vector<CdmaInformationRecord>& records) override;
+
+ virtual ndk::ScopedAStatus cdmaOtaProvisionStatus(RadioIndicationType type,
+ CdmaOtaProvisionStatus status) override;
+
+ virtual ndk::ScopedAStatus currentEmergencyNumberList(
+ RadioIndicationType type,
+ const std::vector<EmergencyNumber>& emergencyNumberList) override;
+
+ virtual ndk::ScopedAStatus enterEmergencyCallbackMode(RadioIndicationType type) override;
+
+ virtual ndk::ScopedAStatus exitEmergencyCallbackMode(RadioIndicationType type) override;
+
+ virtual ndk::ScopedAStatus indicateRingbackTone(RadioIndicationType type, bool start) override;
+
+ virtual ndk::ScopedAStatus onSupplementaryServiceIndication(
+ RadioIndicationType type, const StkCcUnsolSsResult& ss) override;
+
+ virtual ndk::ScopedAStatus resendIncallMute(RadioIndicationType type) override;
+
+ virtual ndk::ScopedAStatus srvccStateNotify(RadioIndicationType type,
+ SrvccState state) override;
+
+ virtual ndk::ScopedAStatus stkCallControlAlphaNotify(RadioIndicationType type,
+ const std::string& alpha) override;
+
+ virtual ndk::ScopedAStatus stkCallSetup(RadioIndicationType type, int64_t timeout) override;
+};
+
+// The main test class for Radio AIDL Voice.
+class RadioVoiceTest : public ::testing::TestWithParam<std::string>, public RadioResponseWaiter {
+ protected:
+ /* Clear Potential Established Calls */
+ virtual ndk::ScopedAStatus clearPotentialEstablishedCalls();
+
+ public:
+ virtual void SetUp() override;
+
+ /* radio voice service handle */
+ std::shared_ptr<IRadioVoice> radio_voice;
+ /* radio voice response handle */
+ std::shared_ptr<RadioVoiceResponse> radioRsp_voice;
+ /* radio voice indication handle */
+ std::shared_ptr<RadioVoiceIndication> radioInd_voice;
+};
diff --git a/rebootescrow/aidl/default/service.cpp b/rebootescrow/aidl/default/service.cpp
index 8a8086b..dc06c71 100644
--- a/rebootescrow/aidl/default/service.cpp
+++ b/rebootescrow/aidl/default/service.cpp
@@ -34,7 +34,7 @@
auto re = ndk::SharedRefBase::make<RebootEscrow>(rebootEscrowDevicePath);
const std::string instance = std::string() + RebootEscrow::descriptor + "/default";
binder_status_t status = AServiceManager_addService(re->asBinder().get(), instance.c_str());
- CHECK(status == STATUS_OK);
+ CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE;
diff --git a/security/dice/aidl/Android.bp b/security/dice/aidl/Android.bp
new file mode 100644
index 0000000..af9dd33
--- /dev/null
+++ b/security/dice/aidl/Android.bp
@@ -0,0 +1,47 @@
+// Copyright 2021, 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 {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+aidl_interface {
+ name: "android.hardware.security.dice",
+ vendor_available: true,
+ srcs: [
+ "android/hardware/security/dice/*.aidl",
+ ],
+ stability: "vintf",
+ backend: {
+ java: {
+ enabled: false,
+ platform_apis: false,
+ },
+ ndk: {
+ vndk: {
+ enabled: true,
+ },
+ apps_enabled: false,
+ },
+ rust: {
+ enabled: true,
+ },
+ },
+ // versions: ["1"],
+}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Bcc.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Bcc.aidl
index cfafc50..5af7358 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Bcc.aidl
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright 2021, 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.
@@ -31,8 +31,9 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.security.dice;
+/* @hide */
+@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability
+parcelable Bcc {
+ byte[] data;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/BccHandover.aidl
similarity index 83%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/BccHandover.aidl
index cfafc50..ab50c36 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/BccHandover.aidl
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright 2021, 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.
@@ -31,8 +31,11 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.security.dice;
+/* @hide */
+@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability
+parcelable BccHandover {
+ byte[] cdiAttest;
+ byte[] cdiSeal;
+ android.hardware.security.dice.Bcc bcc;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Config.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Config.aidl
index cfafc50..78dd2f8 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Config.aidl
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright 2021, 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.
@@ -31,8 +31,9 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.security.dice;
+/* @hide */
+@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability
+parcelable Config {
+ byte[] desc;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/IDiceDevice.aidl
similarity index 70%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/IDiceDevice.aidl
index cfafc50..383f4d1 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/IDiceDevice.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,12 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.security.dice;
+/* @hide */
+@SensitiveData @VintfStability
+interface IDiceDevice {
+ android.hardware.security.dice.Signature sign(in android.hardware.security.dice.InputValues[] id, in byte[] payload);
+ android.hardware.security.dice.Bcc getAttestationChain(in android.hardware.security.dice.InputValues[] inputValues);
+ android.hardware.security.dice.BccHandover derive(in android.hardware.security.dice.InputValues[] inputValues);
+ void demote(in android.hardware.security.dice.InputValues[] inputValues);
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/InputValues.aidl
similarity index 76%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/InputValues.aidl
index cfafc50..79583fb 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/InputValues.aidl
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright 2021, 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.
@@ -31,8 +31,14 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.security.dice;
+/* @hide */
+@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability
+parcelable InputValues {
+ byte[] codeHash;
+ android.hardware.security.dice.Config config;
+ byte[] authorityHash;
+ @nullable byte[] authorityDescriptor;
+ android.hardware.security.dice.Mode mode = android.hardware.security.dice.Mode.NOT_INITIALIZED;
+ byte[] hidden;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Mode.aidl
similarity index 89%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Mode.aidl
index cfafc50..295c32e 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Mode.aidl
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright 2021, 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.
@@ -31,8 +31,12 @@
// 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.graphics.composer3;
+package android.hardware.security.dice;
+/* @hide */
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum Mode {
+ NOT_INITIALIZED = 0,
+ NORMAL = 1,
+ DEBUG = 2,
+ RECOVERY = 3,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/ResponseCode.aidl
similarity index 88%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/ResponseCode.aidl
index cfafc50..c13afa6 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/ResponseCode.aidl
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright 2020, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,8 +31,11 @@
// 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.graphics.composer3;
+package android.hardware.security.dice;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum ResponseCode {
+ PERMISSION_DENIED = 1,
+ SYSTEM_ERROR = 2,
+ NOT_IMPLEMENTED = 3,
+ DEMOTION_FAILED = 4,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Signature.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Signature.aidl
index cfafc50..294170d 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/security/dice/aidl/aidl_api/android.hardware.security.dice/current/android/hardware/security/dice/Signature.aidl
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright 2021, 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.
@@ -31,8 +31,9 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.security.dice;
+/* @hide */
+@RustDerive(Clone=true, Eq=true, Hash=true, Ord=true, PartialEq=true, PartialOrd=true) @VintfStability
+parcelable Signature {
+ byte[] data;
}
diff --git a/security/dice/aidl/android/hardware/security/dice/Bcc.aidl b/security/dice/aidl/android/hardware/security/dice/Bcc.aidl
new file mode 100644
index 0000000..983915e
--- /dev/null
+++ b/security/dice/aidl/android/hardware/security/dice/Bcc.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2021, 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.security.dice;
+
+/**
+ * A DICE certificate chain following the Boot Certificate Chain (BCC) specification.
+ * @hide
+ */
+@VintfStability
+@RustDerive(Clone=true, Eq=true, PartialEq=true, Ord=true, PartialOrd=true, Hash=true)
+parcelable Bcc {
+ /**
+ * The DICE certificate chain CBOR encoded following the BCC specification. The CDDL
+ * specification for BCC can be found here [1].
+ *
+ * @see <a
+ * href="https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/keymint/aidl/android/hardware/security/keymint/ProtectedData.aidl">
+ * BCC CDDL specification
+ * </a>
+ */
+ byte[] data;
+}
diff --git a/security/dice/aidl/android/hardware/security/dice/BccHandover.aidl b/security/dice/aidl/android/hardware/security/dice/BccHandover.aidl
new file mode 100644
index 0000000..d522cef
--- /dev/null
+++ b/security/dice/aidl/android/hardware/security/dice/BccHandover.aidl
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2021, 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.security.dice;
+
+import android.hardware.security.dice.Bcc;
+
+/**
+ * Represents one set of DICE artifacts.
+ *
+ * @hide
+ */
+@VintfStability
+@RustDerive(Clone=true, Eq=true, PartialEq=true, Ord=true, PartialOrd=true, Hash=true)
+parcelable BccHandover {
+ /**
+ * CDI_attest. Must a exactly 32 bytes of data.
+ */
+ byte[] cdiAttest;
+ /**
+ * CDI_seal. Must a exactly 32 bytes of data.
+ */
+ byte[] cdiSeal;
+ /**
+ * CBOR encoded BCC.
+ *
+ * @see <a
+ * href="https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/keymint/aidl/android/hardware/security/keymint/ProtectedData.aidl">
+ * BCC CDDL specification
+ * </a>
+ */
+ Bcc bcc;
+}
diff --git a/security/dice/aidl/android/hardware/security/dice/Config.aidl b/security/dice/aidl/android/hardware/security/dice/Config.aidl
new file mode 100644
index 0000000..6decfc5
--- /dev/null
+++ b/security/dice/aidl/android/hardware/security/dice/Config.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2021, 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.security.dice;
+
+/**
+ * DICE config descriptor as described in at
+ * <a
+ * href="https://pigweed.googlesource.com/open-dice/+/refs/heads/main/docs/specification.md#input-values">
+ * input-values
+ * </a>
+ * @hide
+ */
+@VintfStability
+@RustDerive(Clone=true, Eq=true, PartialEq=true, Ord=true, PartialOrd=true, Hash=true)
+parcelable Config {
+ /**
+ * A free form descriptor. This should follow the BCC Configuration Descriptor.
+ * @see <a
+ * href="https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/keymint/aidl/android/hardware/security/keymint/ProtectedData.aidl">
+ * BccPayload field -4670548
+ * </a>
+ */
+ byte[] desc;
+}
diff --git a/security/dice/aidl/android/hardware/security/dice/IDiceDevice.aidl b/security/dice/aidl/android/hardware/security/dice/IDiceDevice.aidl
new file mode 100644
index 0000000..709aede
--- /dev/null
+++ b/security/dice/aidl/android/hardware/security/dice/IDiceDevice.aidl
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2021 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.security.dice;
+
+import android.hardware.security.dice.Bcc;
+import android.hardware.security.dice.BccHandover;
+import android.hardware.security.dice.InputValues;
+import android.hardware.security.dice.Signature;
+
+/**
+ * IDiceDevice specifies an interface that allows access to the Android instance's DICE artifacts.
+ *
+ * <h2>Features</h2>
+ *
+ * The dice device provides access to the component's CDI_SEAL and CDI_ATTEST secrets as well
+ * as to its attestation certificate chain. The "component" is the Android instance running this
+ * HAL service and the secrets and attestation chain must include all boot stage components,
+ * the kernel, and the verified boot information (VBA).
+ *
+ * Implementations provide the following operations:
+ * <li> sign - Signing a payload with a key derived from CDI_ATTEST.
+ * <li> getAttestationChain - Retrieve the component's attestation certificate chain.
+ * <li> derive - Retrieve the component's DICE artifacts.
+ *
+ * @see <a
+ * href="https://pigweed.googlesource.com/open-dice/+/refs/heads/main/docs/specification.md">
+ * Open-dice Specification
+ * </a>
+ * @see <a
+ * href="https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/security/keymint/aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl">
+ * Boot Certificate Chain (BCC) CDDL specification
+ * </a>
+ * @hide
+ */
+@SensitiveData
+@VintfStability
+interface IDiceDevice {
+ /**
+ * Uses the a key derived from the component's, or a child's given by <code>inputValues</code>,
+ * attestation secret to sign the payload using RFC 8032 Pure Ed25519 and returns the
+ * signature. The payload is limited to 1024 bytes.
+ *
+ * @see <a href="https://datatracker.ietf.org/doc/html/rfc8032">RFC 8032</a>
+ */
+ Signature sign(in InputValues[] id, in byte[] payload);
+
+ /**
+ * Returns the attestation chain of the component if <code>inputValues</code> is empty or the
+ * chain to the given child of the component identified by the <code>inputValues</code> vector.
+ *
+ * ## Error as service specific exception:
+ * ResponseCode::PERMISSION_DENIED if the caller is not sufficiently privileged.
+ */
+ Bcc getAttestationChain(in InputValues[] inputValues);
+
+ /**
+ * This function allows a client to become a resident node. A resident node is a node that
+ * manages its own dice secrets as opposed to using them by proxy, i.e., by calling sign
+ * and getAttestationChain. Called with empty <code>inputValues</code> vectors, an
+ * implementation returns the component's DICE secrets. If the <code>inputValues</code> vector
+ * is given the appropriate derivations are performed starting from the component's level.
+ *
+ * ## Error as service specific exception:
+ * ResponseCode::PERMISSION_DENIED if the implementation does not allow resident nodes
+ * at the client's level.
+ */
+ BccHandover derive(in InputValues[] inputValues);
+
+ /**
+ * This demotes the implementation of this interface.
+ * When called, the implementation performs appropriate derivation steps using
+ * <code>inputValues</code>, traversing the vector in ascending order. Then it replaces its
+ * stored DICE artifacts with the newly derived ones.
+ *
+ * IMPORTANT: When the function returns, all remnants of the previous DICE artifacts must
+ * have been purged from memory.
+ *
+ * This operation is not reversible until the next reboot. Further demotion is always
+ * possible.
+ *
+ * ## Error as service specific exception:
+ * ResponseCode::DEMOTION_FAILED if the implementation failed to demote itself
+ * or was unable to purge previous DICE artifacts from memory.
+ */
+ void demote(in InputValues[] inputValues);
+}
diff --git a/security/dice/aidl/android/hardware/security/dice/InputValues.aidl b/security/dice/aidl/android/hardware/security/dice/InputValues.aidl
new file mode 100644
index 0000000..e44ef22
--- /dev/null
+++ b/security/dice/aidl/android/hardware/security/dice/InputValues.aidl
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2021, 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.security.dice;
+
+import android.hardware.security.dice.Config;
+import android.hardware.security.dice.Mode;
+
+/**
+ * DICE input values for certificate and CDI generation.
+ *
+ * @see <a
+ * href="https://pigweed.googlesource.com/open-dice/+/refs/heads/main/docs/specification.md#input-values">
+ * Open-dice input-values
+ * </a>
+ * @hide
+ */
+@RustDerive(Clone=true, Eq=true, PartialEq=true, Ord=true, PartialOrd=true, Hash=true)
+@VintfStability
+parcelable InputValues {
+ /**
+ * The target code hash. Must be exactly 64 bytes.
+ */
+ byte[] codeHash;
+ /**
+ * The configuration data.
+ */
+ Config config;
+ /**
+ * The authority hash. Must be exactly 64 bytes. Must be all zero if unused.
+ */
+ byte[] authorityHash;
+ /**
+ * Optional free form authorityDescriptor.
+ */
+ @nullable byte[] authorityDescriptor;
+ /**
+ * The mode of operation. Normal, Debug, Maintenance, or not initialized.
+ */
+ Mode mode = Mode.NOT_INITIALIZED;
+ /**
+ * Optional hidden values. Must be exactly 64 bytes. Must be all zero if unused.
+ */
+ byte[] hidden;
+}
diff --git a/security/dice/aidl/android/hardware/security/dice/Mode.aidl b/security/dice/aidl/android/hardware/security/dice/Mode.aidl
new file mode 100644
index 0000000..3b3bfdc
--- /dev/null
+++ b/security/dice/aidl/android/hardware/security/dice/Mode.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2021, 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.security.dice;
+
+/**
+ * DICE mode values as defined at
+ *
+ * @see <a
+ * href="https://pigweed.googlesource.com/open-dice/+/refs/heads/main/docs/specification.md#mode-value-details">
+ * open-dice mode-value-details
+ * </a>
+ * @hide
+ */
+@Backing(type="int")
+@VintfStability
+enum Mode {
+ NOT_INITIALIZED = 0,
+ NORMAL = 1,
+ DEBUG = 2,
+ /**
+ * The recovery mode is also referred to as "maintenance" mode.
+ */
+ RECOVERY = 3,
+}
diff --git a/security/dice/aidl/android/hardware/security/dice/ResponseCode.aidl b/security/dice/aidl/android/hardware/security/dice/ResponseCode.aidl
new file mode 100644
index 0000000..3e77cf7
--- /dev/null
+++ b/security/dice/aidl/android/hardware/security/dice/ResponseCode.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.security.dice;
+
+@Backing(type="int")
+/**
+ * These response codes are used as service specific exception codes by
+ * IDiceDevice.
+ * @hide
+ */
+@VintfStability
+enum ResponseCode {
+ /**
+ * The caller has insufficient privilege to access the DICE API.
+ */
+ PERMISSION_DENIED = 1,
+ /**
+ * An unexpected error occurred, likely with IO or IPC.
+ */
+ SYSTEM_ERROR = 2,
+ /**
+ * Returned if the called function is not implemented.
+ */
+ NOT_IMPLEMENTED = 3,
+ /**
+ * An attempt to demote the implementation failed.
+ */
+ DEMOTION_FAILED = 4,
+}
diff --git a/security/dice/aidl/android/hardware/security/dice/Signature.aidl b/security/dice/aidl/android/hardware/security/dice/Signature.aidl
new file mode 100644
index 0000000..ea3594f
--- /dev/null
+++ b/security/dice/aidl/android/hardware/security/dice/Signature.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2021, 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.security.dice;
+
+/**
+ * This parcelable represents a Signature. It is used as return value of IDiceNode::sign.
+ *
+ * @hide
+ */
+@RustDerive(Clone=true, Eq=true, PartialEq=true, Ord=true, PartialOrd=true, Hash=true)
+@VintfStability
+parcelable Signature {
+ /**
+ * The RFC 8032 PureEd25519 signature.
+ * @see <a href="https://datatracker.ietf.org/doc/html/rfc8032">RFC 8032</a>
+ */
+ byte[] data;
+}
diff --git a/security/keymint/aidl/Android.bp b/security/keymint/aidl/Android.bp
index 3cf6ff2..dcbe9c1 100644
--- a/security/keymint/aidl/Android.bp
+++ b/security/keymint/aidl/Android.bp
@@ -45,14 +45,14 @@
cc_defaults {
name: "keymint_use_latest_hal_aidl_ndk_static",
static_libs: [
- "android.hardware.security.keymint-V1-ndk",
+ "android.hardware.security.keymint-V2-ndk",
],
}
cc_defaults {
name: "keymint_use_latest_hal_aidl_ndk_shared",
shared_libs: [
- "android.hardware.security.keymint-V1-ndk",
+ "android.hardware.security.keymint-V2-ndk",
],
}
@@ -62,6 +62,6 @@
rust_defaults {
name: "keymint_use_latest_hal_aidl_rust",
rustlibs: [
- "android.hardware.security.keymint-V1-rust",
+ "android.hardware.security.keymint-V2-rust",
],
}
diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/current/android/hardware/security/keymint/EcCurve.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/current/android/hardware/security/keymint/EcCurve.aidl
index 6b4a9ae..ffc7efe 100644
--- a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/current/android/hardware/security/keymint/EcCurve.aidl
+++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/current/android/hardware/security/keymint/EcCurve.aidl
@@ -39,4 +39,5 @@
P_256 = 1,
P_384 = 2,
P_521 = 3,
+ CURVE_25519 = 4,
}
diff --git a/security/keymint/aidl/android/hardware/security/keymint/EcCurve.aidl b/security/keymint/aidl/android/hardware/security/keymint/EcCurve.aidl
index 5b1c10c..e9f81d8 100644
--- a/security/keymint/aidl/android/hardware/security/keymint/EcCurve.aidl
+++ b/security/keymint/aidl/android/hardware/security/keymint/EcCurve.aidl
@@ -27,4 +27,5 @@
P_256 = 1,
P_384 = 2,
P_521 = 3,
+ CURVE_25519 = 4,
}
diff --git a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
index cd8cfc5..9846ee9 100644
--- a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
+++ b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
@@ -93,6 +93,11 @@
* P-521. STRONGBOX IKeyMintDevices must support NIST curve P-256.
* - TRUSTED_ENVIRONMENT IKeyMintDevices must support SHA1, SHA-2 224, SHA-2 256, SHA-2
* 384 and SHA-2 512 digest modes. STRONGBOX IKeyMintDevices must support SHA-2 256.
+ * - TRUSTED_ENVRIONMENT IKeyMintDevices must support curve 25519 for Purpose::SIGN (Ed25519,
+ * as specified in RFC 8032), Purpose::ATTEST_KEY (Ed25519) or for KeyPurpose::AGREE_KEY
+ * (X25519, as specified in RFC 7748). However, a key must have exactly one of these
+ * purpose values; the same key cannot be used for multiple purposes.
+ * STRONGBOX IKeyMintDevices do not support curve 25519.
*
* o AES
*
@@ -287,7 +292,7 @@
* except AGREE_KEY must be supported for RSA keys.
*
* o Tag::DIGEST specifies digest algorithms that may be used with the new key. TEE
- * IKeyMintDevice implementations must support all Digest values (see digest.aidl) for RSA
+ * IKeyMintDevice implementations must support all Digest values (see Digest.aidl) for RSA
* keys. StrongBox IKeyMintDevice implementations must support SHA_2_256.
*
* o Tag::PADDING specifies the padding modes that may be used with the new
@@ -298,13 +303,24 @@
* == ECDSA Keys ==
*
* Tag::EC_CURVE must be provided to generate an ECDSA key. If it is not provided, generateKey
- * must return ErrorCode::UNSUPPORTED_KEY_SIZE. TEE IKeyMintDevice implementations must support
- * all curves. StrongBox implementations must support P_256.
-
+ * must return ErrorCode::UNSUPPORTED_KEY_SIZE or ErrorCode::UNSUPPORTED_EC_CURVE. TEE
+ * IKeyMintDevice implementations must support all required curves. StrongBox implementations
+ * must support P_256 and no other curves.
+ *
* Tag::CERTIFICATE_NOT_BEFORE and Tag::CERTIFICATE_NOT_AFTER must be provided to specify the
* valid date range for the returned X.509 certificate holding the public key. If omitted,
* generateKey must return ErrorCode::MISSING_NOT_BEFORE or ErrorCode::MISSING_NOT_AFTER.
*
+ * Keys with EC_CURVE of EcCurve::CURVE_25519 must have exactly one purpose in the set
+ * {KeyPurpose::SIGN, KeyPurpose::ATTEST_KEY, KeyPurpose::AGREE_KEY}. Key generation with more
+ * than one purpose should be rejected with ErrorCode::INCOMPATIBLE_PURPOSE.
+ * StrongBox implementation do not support CURVE_25519.
+ *
+ * Tag::DIGEST specifies digest algorithms that may be used with the new key. TEE
+ * IKeyMintDevice implementations must support all Digest values (see Digest.aidl) for ECDSA
+ * keys; Ed25519 keys only support Digest::NONE. StrongBox IKeyMintDevice implementations must
+ * support SHA_2_256.
+ *
* == AES Keys ==
*
* Only Tag::KEY_SIZE is required to generate an AES key. If omitted, generateKey must return
diff --git a/security/keymint/aidl/android/hardware/security/keymint/KeyCreationResult.aidl b/security/keymint/aidl/android/hardware/security/keymint/KeyCreationResult.aidl
index fd6bf65..16bbc5c 100644
--- a/security/keymint/aidl/android/hardware/security/keymint/KeyCreationResult.aidl
+++ b/security/keymint/aidl/android/hardware/security/keymint/KeyCreationResult.aidl
@@ -122,9 +122,9 @@
* straightforward translation of the KeyMint tag/value parameter lists to ASN.1.
*
* KeyDescription ::= SEQUENCE {
- * attestationVersion INTEGER, # Value 100
+ * attestationVersion INTEGER, # Value 200
* attestationSecurityLevel SecurityLevel, # See below
- * keyMintVersion INTEGER, # Value 100
+ * keyMintVersion INTEGER, # Value 200
* keymintSecurityLevel SecurityLevel, # See below
* attestationChallenge OCTET_STRING, # Tag::ATTESTATION_CHALLENGE from attestParams
* uniqueId OCTET_STRING, # Empty unless key has Tag::INCLUDE_UNIQUE_ID
diff --git a/security/keymint/aidl/android/hardware/security/keymint/KeyFormat.aidl b/security/keymint/aidl/android/hardware/security/keymint/KeyFormat.aidl
index da3d521..3faef38 100644
--- a/security/keymint/aidl/android/hardware/security/keymint/KeyFormat.aidl
+++ b/security/keymint/aidl/android/hardware/security/keymint/KeyFormat.aidl
@@ -25,8 +25,10 @@
enum KeyFormat {
/** X.509 certificate format, for public key export. */
X509 = 0,
- /** PCKS#8 format, asymmetric key pair import. */
+ /** PKCS#8 format, asymmetric key pair import. */
PKCS8 = 1,
- /** Raw bytes, for symmetric key import. */
+ /**
+ * Raw bytes, for symmetric key import, and for import of raw asymmetric keys for curve 25519.
+ */
RAW = 3,
}
diff --git a/security/keymint/aidl/android/hardware/security/keymint/KeyPurpose.aidl b/security/keymint/aidl/android/hardware/security/keymint/KeyPurpose.aidl
index e141e55..fd103ef 100644
--- a/security/keymint/aidl/android/hardware/security/keymint/KeyPurpose.aidl
+++ b/security/keymint/aidl/android/hardware/security/keymint/KeyPurpose.aidl
@@ -44,6 +44,10 @@
AGREE_KEY = 6,
/* Usable as an attestation signing key. Keys with this purpose must not have any other
- * purpose. */
+ * purpose; if they do, key generation/import must be rejected with
+ * ErrorCode::INCOMPATIBLE_PURPOSE. (Rationale: If key also included KeyPurpose::SIGN, then
+ * it could be used to sign arbitrary data, including any tbsCertificate, and so an
+ * attestation produced by the key would have no security properties.)
+ */
ATTEST_KEY = 7,
}
diff --git a/security/keymint/aidl/default/service.cpp b/security/keymint/aidl/default/service.cpp
index 8092e34..dc0c618 100644
--- a/security/keymint/aidl/default/service.cpp
+++ b/security/keymint/aidl/default/service.cpp
@@ -39,7 +39,7 @@
LOG(INFO) << "adding keymint service instance: " << instanceName;
binder_status_t status =
AServiceManager_addService(ser->asBinder().get(), instanceName.c_str());
- CHECK(status == STATUS_OK);
+ CHECK_EQ(status, STATUS_OK);
return ser;
}
diff --git a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
index 64550ef..727c6b7 100644
--- a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
+++ b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
@@ -81,7 +81,8 @@
AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
- EXPECT_TRUE(verify_attestation_record("foo", "bar", sw_enforced, hw_enforced, SecLevel(),
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced, hw_enforced,
+ SecLevel(),
attested_key_cert_chain[0].encodedCertificate));
// Attestation by itself is not valid (last entry is not self-signed).
@@ -113,7 +114,8 @@
hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
- EXPECT_TRUE(verify_attestation_record("foo2", "bar2", sw_enforced, hw_enforced, SecLevel(),
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), "foo2", "bar2", sw_enforced,
+ hw_enforced, SecLevel(),
attested_key_cert_chain[0].encodedCertificate));
// Attestation by itself is not valid (last entry is not self-signed).
@@ -154,12 +156,13 @@
sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
// The client-specified CREATION_DATETIME should be in sw_enforced.
- // Its presence will also trigger verify_attestation_record() to check that it
- // is in the attestation extension with a matching value.
+ // Its presence will also trigger verify_attestation_record() to check that
+ // it is in the attestation extension with a matching value.
EXPECT_TRUE(sw_enforced.Contains(TAG_CREATION_DATETIME, timestamp))
<< "expected CREATION_TIMESTAMP in sw_enforced:" << sw_enforced
<< " not in hw_enforced:" << hw_enforced;
- EXPECT_TRUE(verify_attestation_record("foo", "bar", sw_enforced, hw_enforced, SecLevel(),
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced, hw_enforced,
+ SecLevel(),
attested_key_cert_chain[0].encodedCertificate));
// Attestation by itself is not valid (last entry is not self-signed).
@@ -175,6 +178,24 @@
}
/*
+ * AttestKeyTest.RsaAttestKeyMultiPurposeFail
+ *
+ * This test attempts to create an RSA attestation key that also allows signing.
+ */
+TEST_P(AttestKeyTest, RsaAttestKeyMultiPurposeFail) {
+ vector<uint8_t> attest_key_blob;
+ vector<KeyCharacteristics> attest_key_characteristics;
+ vector<Certificate> attest_key_cert_chain;
+ ASSERT_EQ(ErrorCode::INCOMPATIBLE_PURPOSE,
+ GenerateKey(AuthorizationSetBuilder()
+ .RsaSigningKey(2048, 65537)
+ .AttestKey()
+ .SetDefaultValidity(),
+ {} /* attestation signing key */, &attest_key_blob,
+ &attest_key_characteristics, &attest_key_cert_chain));
+}
+
+/*
* AttestKeyTest.RsaAttestedAttestKeys
*
* This test creates an RSA attestation key signed by factory keys, and varifies it can be
@@ -217,7 +238,7 @@
AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attest_key_characteristics);
AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attest_key_characteristics);
- EXPECT_TRUE(verify_attestation_record(challenge, app_id, //
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), challenge, app_id, //
sw_enforced, hw_enforced, SecLevel(),
attest_key_cert_chain[0].encodedCertificate));
@@ -252,7 +273,8 @@
AuthorizationSet hw_enforced2 = HwEnforcedAuthorizations(attested_key_characteristics);
AuthorizationSet sw_enforced2 = SwEnforcedAuthorizations(attested_key_characteristics);
- EXPECT_TRUE(verify_attestation_record("foo", "bar", sw_enforced2, hw_enforced2, SecLevel(),
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced2, hw_enforced2,
+ SecLevel(),
attested_key_cert_chain[0].encodedCertificate));
// Attestation by itself is not valid (last entry is not self-signed).
@@ -313,7 +335,8 @@
AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
ASSERT_GT(cert_chain_list[i].size(), 0);
- EXPECT_TRUE(verify_attestation_record("foo", "bar", sw_enforced, hw_enforced, SecLevel(),
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced, hw_enforced,
+ SecLevel(),
cert_chain_list[i][0].encodedCertificate));
if (i > 0) {
@@ -385,7 +408,8 @@
AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
ASSERT_GT(cert_chain_list[i].size(), 0);
- EXPECT_TRUE(verify_attestation_record("foo", "bar", sw_enforced, hw_enforced, SecLevel(),
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced, hw_enforced,
+ SecLevel(),
cert_chain_list[i][0].encodedCertificate));
if (i > 0) {
@@ -412,6 +436,24 @@
}
/*
+ * AttestKeyTest.EcAttestKeyMultiPurposeFail
+ *
+ * This test attempts to create an EC attestation key that also allows signing.
+ */
+TEST_P(AttestKeyTest, EcAttestKeyMultiPurposeFail) {
+ vector<uint8_t> attest_key_blob;
+ vector<KeyCharacteristics> attest_key_characteristics;
+ vector<Certificate> attest_key_cert_chain;
+ ASSERT_EQ(ErrorCode::INCOMPATIBLE_PURPOSE,
+ GenerateKey(AuthorizationSetBuilder()
+ .EcdsaSigningKey(EcCurve::P_256)
+ .AttestKey()
+ .SetDefaultValidity(),
+ {} /* attestation signing key */, &attest_key_blob,
+ &attest_key_characteristics, &attest_key_cert_chain));
+}
+
+/*
* AttestKeyTest.AlternateAttestKeyChaining
*
* This test creates a chain of multiple attest keys, in the order Ec - RSA - Ec - RSA ....
@@ -474,7 +516,8 @@
AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
ASSERT_GT(cert_chain_list[i].size(), 0);
- EXPECT_TRUE(verify_attestation_record("foo", "bar", sw_enforced, hw_enforced, SecLevel(),
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced, hw_enforced,
+ SecLevel(),
cert_chain_list[i][0].encodedCertificate));
if (i > 0) {
@@ -583,11 +626,13 @@
attest_key, &attested_key_blob, &attested_key_characteristics,
&attested_key_cert_chain));
+ ASSERT_GT(attested_key_cert_chain.size(), 0);
CheckedDeleteKey(&attested_key_blob);
AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
- EXPECT_TRUE(verify_attestation_record("foo", "bar", sw_enforced, hw_enforced, SecLevel(),
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced, hw_enforced,
+ SecLevel(),
attested_key_cert_chain[0].encodedCertificate));
// Attestation by itself is not valid (last entry is not self-signed).
@@ -612,12 +657,14 @@
attest_key, &attested_key_blob, &attested_key_characteristics,
&attested_key_cert_chain));
+ ASSERT_GT(attested_key_cert_chain.size(), 0);
CheckedDeleteKey(&attested_key_blob);
CheckedDeleteKey(&attest_key.keyBlob);
hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
- EXPECT_TRUE(verify_attestation_record("foo", "bar", sw_enforced, hw_enforced, SecLevel(),
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced, hw_enforced,
+ SecLevel(),
attested_key_cert_chain[0].encodedCertificate));
// Attestation by itself is not valid (last entry is not self-signed).
@@ -722,8 +769,8 @@
// attestation extension should contain them, so make sure the extra tag is added.
hw_enforced.push_back(tag);
- EXPECT_TRUE(verify_attestation_record("challenge", "foo", sw_enforced, hw_enforced,
- SecLevel(),
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), "challenge", "foo", sw_enforced,
+ hw_enforced, SecLevel(),
attested_key_cert_chain[0].encodedCertificate));
}
CheckedDeleteKey(&attest_key.keyBlob);
diff --git a/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp b/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp
index 3cbffbf..d4bbd69 100644
--- a/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp
+++ b/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp
@@ -52,8 +52,9 @@
EXPECT_TRUE(ChainSignaturesAreValid(cert_chain_, /* strict_issuer_check= */ false));
AuthorizationSet sw_enforced = SwEnforcedAuthorizations(key_characteristics);
- EXPECT_TRUE(verify_attestation_record("challenge", "foo", sw_enforced, hw_enforced,
- SecLevel(), cert_chain_[0].encodedCertificate));
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), "challenge", "foo", sw_enforced,
+ hw_enforced, SecLevel(),
+ cert_chain_[0].encodedCertificate));
}
};
diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
index 6140df1..3695f1e 100644
--- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
@@ -127,6 +127,16 @@
return attest_rec;
}
+void check_attestation_version(uint32_t attestation_version, int32_t aidl_version) {
+ // Version numbers in attestation extensions should be a multiple of 100.
+ EXPECT_EQ(attestation_version % 100, 0);
+
+ // The multiplier should never be higher than the AIDL version, but can be less
+ // (for example, if the implementation is from an earlier version but the HAL service
+ // uses the default libraries and so reports the current AIDL version).
+ EXPECT_TRUE((attestation_version / 100) <= aidl_version);
+}
+
bool avb_verification_enabled() {
char value[PROPERTY_VALUE_MAX];
return property_get("ro.boot.vbmeta.device_state", value, "") != 0;
@@ -223,6 +233,15 @@
vendor_patch_level_ = getVendorPatchlevel();
}
+int32_t KeyMintAidlTestBase::AidlVersion() {
+ int32_t version = 0;
+ auto status = keymint_->getInterfaceVersion(&version);
+ if (!status.isOk()) {
+ ADD_FAILURE() << "Failed to determine interface version";
+ }
+ return version;
+}
+
void KeyMintAidlTestBase::SetUp() {
if (AServiceManager_isDeclared(GetParam().c_str())) {
::ndk::SpAIBinder binder(AServiceManager_waitForService(GetParam().c_str()));
@@ -1304,7 +1323,8 @@
verify_subject(cert.get(), subject, self_signed);
}
-bool verify_attestation_record(const string& challenge, //
+bool verify_attestation_record(int32_t aidl_version, //
+ const string& challenge, //
const string& app_id, //
AuthorizationSet expected_sw_enforced, //
AuthorizationSet expected_hw_enforced, //
@@ -1342,7 +1362,7 @@
EXPECT_EQ(ErrorCode::OK, error);
if (error != ErrorCode::OK) return false;
- EXPECT_EQ(att_attestation_version, 100U);
+ check_attestation_version(att_attestation_version, aidl_version);
vector<uint8_t> appId(app_id.begin(), app_id.end());
// check challenge and app id only if we expects a non-fake certificate
@@ -1353,7 +1373,7 @@
expected_sw_enforced.push_back(TAG_ATTESTATION_APPLICATION_ID, appId);
}
- EXPECT_EQ(att_keymint_version, 100U);
+ check_attestation_version(att_keymint_version, aidl_version);
EXPECT_EQ(security_level, att_keymint_security_level);
EXPECT_EQ(security_level, att_attestation_security_level);
diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
index 7b3b9d4..61f9d4d 100644
--- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
+++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
@@ -73,6 +73,7 @@
void InitializeKeyMint(std::shared_ptr<IKeyMintDevice> keyMint);
IKeyMintDevice& keyMint() { return *keymint_; }
+ int32_t AidlVersion();
uint32_t os_version() { return os_version_; }
uint32_t os_patch_level() { return os_patch_level_; }
uint32_t vendor_patch_level() { return vendor_patch_level_; }
@@ -333,7 +334,8 @@
const uint64_t expected_serial, //
const string& subject, bool self_signed);
-bool verify_attestation_record(const string& challenge, //
+bool verify_attestation_record(int aidl_version, //
+ const string& challenge, //
const string& app_id, //
AuthorizationSet expected_sw_enforced, //
AuthorizationSet expected_hw_enforced, //
diff --git a/security/keymint/aidl/vts/functional/KeyMintTest.cpp b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
index c99e1d0..dd3719b 100644
--- a/security/keymint/aidl/vts/functional/KeyMintTest.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
@@ -942,7 +942,7 @@
AuthorizationSet hw_enforced = HwEnforcedAuthorizations(key_characteristics);
AuthorizationSet sw_enforced = SwEnforcedAuthorizations(key_characteristics);
- EXPECT_TRUE(verify_attestation_record(challenge, app_id, //
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), challenge, app_id, //
sw_enforced, hw_enforced, SecLevel(),
cert_chain_[0].encodedCertificate));
@@ -1093,7 +1093,7 @@
AuthorizationSet hw_enforced = HwEnforcedAuthorizations(key_characteristics);
AuthorizationSet sw_enforced = SwEnforcedAuthorizations(key_characteristics);
- EXPECT_TRUE(verify_attestation_record(challenge, app_id, //
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), challenge, app_id, //
sw_enforced, hw_enforced, SecLevel(),
cert_chain_[0].encodedCertificate));
@@ -1315,7 +1315,7 @@
AuthorizationSet hw_enforced = HwEnforcedAuthorizations(key_characteristics);
AuthorizationSet sw_enforced = SwEnforcedAuthorizations(key_characteristics);
- EXPECT_TRUE(verify_attestation_record(challenge, app_id, //
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), challenge, app_id, //
sw_enforced, hw_enforced, SecLevel(),
cert_chain_[0].encodedCertificate));
@@ -1444,7 +1444,7 @@
AuthorizationSet hw_enforced = HwEnforcedAuthorizations(key_characteristics);
AuthorizationSet sw_enforced = SwEnforcedAuthorizations(key_characteristics);
- EXPECT_TRUE(verify_attestation_record(challenge, app_id, //
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), challenge, app_id, //
sw_enforced, hw_enforced, SecLevel(),
cert_chain_[0].encodedCertificate));
@@ -1523,8 +1523,9 @@
// Verifying the attestation record will check for the specific tag because
// it's included in the authorizations.
- EXPECT_TRUE(verify_attestation_record(challenge, app_id, sw_enforced, hw_enforced,
- SecLevel(), cert_chain_[0].encodedCertificate));
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), challenge, app_id, sw_enforced,
+ hw_enforced, SecLevel(),
+ cert_chain_[0].encodedCertificate));
CheckedDeleteKey(&key_blob);
}
@@ -1621,8 +1622,9 @@
// Verifying the attestation record will check for the specific tag because
// it's included in the authorizations.
- EXPECT_TRUE(verify_attestation_record(challenge, app_id, sw_enforced, hw_enforced,
- SecLevel(), cert_chain_[0].encodedCertificate));
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), challenge, app_id, sw_enforced,
+ hw_enforced, SecLevel(),
+ cert_chain_[0].encodedCertificate));
CheckedDeleteKey(&key_blob);
}
@@ -1668,9 +1670,9 @@
AuthorizationSet sw_enforced = SwEnforcedAuthorizations(key_characteristics_);
// Check that the unique ID field in the extension is non-empty.
- EXPECT_TRUE(verify_attestation_record(challenge, app_id, sw_enforced, hw_enforced,
- SecLevel(), cert_chain_[0].encodedCertificate,
- unique_id));
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), challenge, app_id, sw_enforced,
+ hw_enforced, SecLevel(),
+ cert_chain_[0].encodedCertificate, unique_id));
EXPECT_GT(unique_id->size(), 0);
CheckedDeleteKey();
};
@@ -1765,8 +1767,9 @@
AuthorizationSet hw_enforced = HwEnforcedAuthorizations(key_characteristics);
AuthorizationSet sw_enforced = SwEnforcedAuthorizations(key_characteristics);
- EXPECT_TRUE(verify_attestation_record(challenge, attest_app_id, sw_enforced, hw_enforced,
- SecLevel(), cert_chain_[0].encodedCertificate));
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), challenge, attest_app_id, sw_enforced,
+ hw_enforced, SecLevel(),
+ cert_chain_[0].encodedCertificate));
// Check that the app id is not in the cert.
string app_id = "clientid";
@@ -1919,7 +1922,7 @@
AuthorizationSet hw_enforced = HwEnforcedAuthorizations(key_characteristics);
AuthorizationSet sw_enforced = SwEnforcedAuthorizations(key_characteristics);
- EXPECT_TRUE(verify_attestation_record(challenge, app_id, //
+ EXPECT_TRUE(verify_attestation_record(AidlVersion(), challenge, app_id, //
sw_enforced, hw_enforced, SecLevel(),
cert_chain_[0].encodedCertificate));
@@ -3151,6 +3154,58 @@
CheckedDeleteKey(&verification_key);
}
+/*
+ * VerificationOperationsTest.HmacVerificationFailsForCorruptSignature
+ *
+ * Verifies HMAC signature verification should fails if message or signature is corrupted.
+ */
+TEST_P(VerificationOperationsTest, HmacVerificationFailsForCorruptSignature) {
+ string key_material = "HelloThisIsAKey";
+
+ vector<uint8_t> signing_key, verification_key;
+ vector<KeyCharacteristics> signing_key_chars, verification_key_chars;
+ EXPECT_EQ(ErrorCode::OK,
+ ImportKey(AuthorizationSetBuilder()
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .Authorization(TAG_ALGORITHM, Algorithm::HMAC)
+ .Authorization(TAG_PURPOSE, KeyPurpose::SIGN)
+ .Digest(Digest::SHA_2_256)
+ .Authorization(TAG_MIN_MAC_LENGTH, 160),
+ KeyFormat::RAW, key_material, &signing_key, &signing_key_chars));
+ EXPECT_EQ(ErrorCode::OK,
+ ImportKey(AuthorizationSetBuilder()
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .Authorization(TAG_ALGORITHM, Algorithm::HMAC)
+ .Authorization(TAG_PURPOSE, KeyPurpose::VERIFY)
+ .Digest(Digest::SHA_2_256)
+ .Authorization(TAG_MIN_MAC_LENGTH, 160),
+ KeyFormat::RAW, key_material, &verification_key, &verification_key_chars));
+
+ string message = "This is a message.";
+ string signature = SignMessage(
+ signing_key, message,
+ AuthorizationSetBuilder().Digest(Digest::SHA_2_256).Authorization(TAG_MAC_LENGTH, 160));
+
+ AuthorizationSet begin_out_params;
+ ASSERT_EQ(ErrorCode::OK,
+ Begin(KeyPurpose::VERIFY, verification_key,
+ AuthorizationSetBuilder().Digest(Digest::SHA_2_256), &begin_out_params));
+
+ string corruptMessage = "This is b message."; // Corrupted message
+ string output;
+ EXPECT_EQ(ErrorCode::VERIFICATION_FAILED, Finish(corruptMessage, signature, &output));
+
+ ASSERT_EQ(ErrorCode::OK,
+ Begin(KeyPurpose::VERIFY, verification_key,
+ AuthorizationSetBuilder().Digest(Digest::SHA_2_256), &begin_out_params));
+
+ signature[0] += 1; // Corrupt a signature
+ EXPECT_EQ(ErrorCode::VERIFICATION_FAILED, Finish(message, signature, &output));
+
+ CheckedDeleteKey(&signing_key);
+ CheckedDeleteKey(&verification_key);
+}
+
INSTANTIATE_KEYMINT_AIDL_TEST(VerificationOperationsTest);
typedef KeyMintAidlTestBase ExportKeyTest;
@@ -3300,6 +3355,26 @@
}
/*
+ * ImportKeyTest.RsaAttestMultiPurposeFail
+ *
+ * Verifies that importing an RSA key pair with purpose ATTEST_KEY+SIGN fails.
+ */
+TEST_P(ImportKeyTest, RsaAttestMultiPurposeFail) {
+ uint32_t key_size = 2048;
+ string key = rsa_2048_key;
+
+ ASSERT_EQ(ErrorCode::INCOMPATIBLE_PURPOSE,
+ ImportKey(AuthorizationSetBuilder()
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .RsaSigningKey(key_size, 65537)
+ .AttestKey()
+ .Digest(Digest::SHA_2_256)
+ .Padding(PaddingMode::RSA_PSS)
+ .SetDefaultValidity(),
+ KeyFormat::PKCS8, key));
+}
+
+/*
* ImportKeyTest.EcdsaSuccess
*
* Verifies that importing and using an ECDSA P-256 key pair works correctly.
@@ -3418,6 +3493,22 @@
}
/*
+ * ImportKeyTest.EcdsaAttestMultiPurposeFail
+ *
+ * Verifies that importing and using an ECDSA P-256 key pair with purpose ATTEST_KEY+SIGN fails.
+ */
+TEST_P(ImportKeyTest, EcdsaAttestMultiPurposeFail) {
+ ASSERT_EQ(ErrorCode::INCOMPATIBLE_PURPOSE,
+ ImportKey(AuthorizationSetBuilder()
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .EcdsaSigningKey(EcCurve::P_256)
+ .AttestKey()
+ .Digest(Digest::SHA_2_256)
+ .SetDefaultValidity(),
+ KeyFormat::PKCS8, ec_256_key));
+}
+
+/*
* ImportKeyTest.AesSuccess
*
* Verifies that importing and using an AES key works.
@@ -6609,7 +6700,7 @@
typedef KeyMintAidlTestBase KeyAgreementTest;
-int CurveToOpenSslCurveName(EcCurve curve) {
+static int EcdhCurveToOpenSslCurveName(EcCurve curve) {
switch (curve) {
case EcCurve::P_224:
return NID_secp224r1;
@@ -6619,6 +6710,8 @@
return NID_secp384r1;
case EcCurve::P_521:
return NID_secp521r1;
+ case EcCurve::CURVE_25519:
+ return NID_X25519;
}
}
@@ -6640,7 +6733,7 @@
for (auto localCurve : ValidCurves()) {
// Generate EC key locally (with access to private key material)
auto ecKey = EC_KEY_Ptr(EC_KEY_new());
- int curveName = CurveToOpenSslCurveName(localCurve);
+ int curveName = EcdhCurveToOpenSslCurveName(localCurve);
auto group = EC_GROUP_Ptr(EC_GROUP_new_by_curve_name(curveName));
ASSERT_NE(group, nullptr);
ASSERT_EQ(EC_KEY_set_group(ecKey.get(), group.get()), 1);
diff --git a/security/keymint/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp b/security/keymint/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
index 76fb79b..c9d506f 100644
--- a/security/keymint/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
+++ b/security/keymint/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
@@ -236,9 +236,11 @@
vector<Certificate> attested_key_cert_chain = std::move(creationResult.certificateChain);
EXPECT_EQ(attested_key_cert_chain.size(), 1);
+ int32_t aidl_version = 0;
+ ASSERT_TRUE(keyMint->getInterfaceVersion(&aidl_version).isOk());
AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
- EXPECT_TRUE(verify_attestation_record("foo", "bar", sw_enforced, hw_enforced,
+ EXPECT_TRUE(verify_attestation_record(aidl_version, "foo", "bar", sw_enforced, hw_enforced,
info.securityLevel,
attested_key_cert_chain[0].encodedCertificate));
diff --git a/tv/tuner/1.0/vts/functional/FrontendTests.cpp b/tv/tuner/1.0/vts/functional/FrontendTests.cpp
old mode 100644
new mode 100755
index 4a642a0..acc524b
--- a/tv/tuner/1.0/vts/functional/FrontendTests.cpp
+++ b/tv/tuner/1.0/vts/functional/FrontendTests.cpp
@@ -377,6 +377,7 @@
result &= getDvrTests()->getDvrPlaybackMQDescriptor() == success();
getDvrTests()->startPlaybackInputThread(mDvrConfig.playbackInputFile,
mDvrConfig.settings.playback());
+ getDvrTests()->startDvrPlayback();
if (!result) {
ALOGW("[vts] Software frontend dvr configure failed.");
return failure();
@@ -400,6 +401,7 @@
status = mFrontend->stopTune();
if (mIsSoftwareFe && testWithDemux) {
getDvrTests()->stopPlaybackThread();
+ getDvrTests()->stopDvrPlayback();
getDvrTests()->closeDvrPlayback();
}
return AssertionResult(status == Result::SUCCESS);
diff --git a/tv/tuner/1.1/default/Frontend.cpp b/tv/tuner/1.1/default/Frontend.cpp
index f5463a9..919c956 100644
--- a/tv/tuner/1.1/default/Frontend.cpp
+++ b/tv/tuner/1.1/default/Frontend.cpp
@@ -88,46 +88,60 @@
Return<Result> Frontend::scan(const FrontendSettings& settings, FrontendScanType type) {
ALOGV("%s", __FUNCTION__);
+
+ // If it's in middle of scanning, stop it first.
+ if (mScanThread.joinable()) {
+ mScanThread.join();
+ }
+
+ mFrontendSettings = settings;
+ mFrontendScanType = type;
+ mScanThread = std::thread(&Frontend::scanThreadLoop, this);
+
+ return Result::SUCCESS;
+}
+
+void Frontend::scanThreadLoop() {
FrontendScanMessage msg;
if (mIsLocked) {
msg.isEnd(true);
mCallback->onScanMessage(FrontendScanMessageType::END, msg);
- return Result::SUCCESS;
+ return;
}
uint32_t frequency;
- switch (settings.getDiscriminator()) {
+ switch (mFrontendSettings.getDiscriminator()) {
case FrontendSettings::hidl_discriminator::analog:
- frequency = settings.analog().frequency;
+ frequency = mFrontendSettings.analog().frequency;
break;
case FrontendSettings::hidl_discriminator::atsc:
- frequency = settings.atsc().frequency;
+ frequency = mFrontendSettings.atsc().frequency;
break;
case FrontendSettings::hidl_discriminator::atsc3:
- frequency = settings.atsc3().frequency;
+ frequency = mFrontendSettings.atsc3().frequency;
break;
case FrontendSettings::hidl_discriminator::dvbs:
- frequency = settings.dvbs().frequency;
+ frequency = mFrontendSettings.dvbs().frequency;
break;
case FrontendSettings::hidl_discriminator::dvbc:
- frequency = settings.dvbc().frequency;
+ frequency = mFrontendSettings.dvbc().frequency;
break;
case FrontendSettings::hidl_discriminator::dvbt:
- frequency = settings.dvbt().frequency;
+ frequency = mFrontendSettings.dvbt().frequency;
break;
case FrontendSettings::hidl_discriminator::isdbs:
- frequency = settings.isdbs().frequency;
+ frequency = mFrontendSettings.isdbs().frequency;
break;
case FrontendSettings::hidl_discriminator::isdbs3:
- frequency = settings.isdbs3().frequency;
+ frequency = mFrontendSettings.isdbs3().frequency;
break;
case FrontendSettings::hidl_discriminator::isdbt:
- frequency = settings.isdbt().frequency;
+ frequency = mFrontendSettings.isdbt().frequency;
break;
}
- if (type == FrontendScanType::SCAN_BLIND) {
+ if (mFrontendScanType == FrontendScanType::SCAN_BLIND) {
frequency += 100 * 1000;
}
@@ -204,8 +218,6 @@
msg.isLocked(true);
mCallback->onScanMessage(FrontendScanMessageType::LOCKED, msg);
mIsLocked = true;
-
- return Result::SUCCESS;
}
Return<Result> Frontend::scan_1_1(const FrontendSettings& settings, FrontendScanType type,
@@ -218,6 +230,10 @@
Return<Result> Frontend::stopScan() {
ALOGV("%s", __FUNCTION__);
+ if (mScanThread.joinable()) {
+ mScanThread.join();
+ }
+
mIsLocked = false;
return Result::SUCCESS;
}
diff --git a/tv/tuner/1.1/default/Frontend.h b/tv/tuner/1.1/default/Frontend.h
index a28fb64..bf739a8 100644
--- a/tv/tuner/1.1/default/Frontend.h
+++ b/tv/tuner/1.1/default/Frontend.h
@@ -20,6 +20,7 @@
#include <android/hardware/tv/tuner/1.1/IFrontend.h>
#include <fstream>
#include <iostream>
+#include <thread>
#include "Tuner.h"
using namespace std;
@@ -81,13 +82,17 @@
private:
virtual ~Frontend();
bool supportsSatellite();
+ void scanThreadLoop();
+
sp<IFrontendCallback> mCallback;
sp<Tuner> mTunerService;
FrontendType mType = FrontendType::UNDEFINED;
FrontendId mId = 0;
bool mIsLocked = false;
uint32_t mCiCamId;
-
+ std::thread mScanThread;
+ FrontendSettings mFrontendSettings;
+ FrontendScanType mFrontendScanType;
std::ifstream mFrontendData;
};
diff --git a/tv/tuner/1.1/vts/functional/FrontendTests.cpp b/tv/tuner/1.1/vts/functional/FrontendTests.cpp
index a595a93..9f0f30d 100644
--- a/tv/tuner/1.1/vts/functional/FrontendTests.cpp
+++ b/tv/tuner/1.1/vts/functional/FrontendTests.cpp
@@ -444,6 +444,7 @@
result &= getDvrTests()->getDvrPlaybackMQDescriptor() == success();
getDvrTests()->startPlaybackInputThread(mDvrConfig.playbackInputFile,
mDvrConfig.settings.playback());
+ getDvrTests()->startDvrPlayback();
if (!result) {
ALOGW("[vts] Software frontend dvr configure failed.");
return failure();
@@ -459,6 +460,7 @@
status = mFrontend->stopTune();
if (mIsSoftwareFe && testWithDemux) {
getDvrTests()->stopPlaybackThread();
+ getDvrTests()->stopDvrPlayback();
getDvrTests()->closeDvrPlayback();
}
return AssertionResult(status == Result::SUCCESS);
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioStreamType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioStreamType.aidl
index bfd2aa8..6c538ea 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioStreamType.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioStreamType.aidl
@@ -51,4 +51,8 @@
OPUS = 13,
VORBIS = 14,
DRA = 15,
+ AAC_ADTS = 16,
+ AAC_LATM = 17,
+ AAC_HE_ADTS = 18,
+ AAC_HE_LATM = 19,
}
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl
index b51e633..8a05dbd 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl
@@ -36,6 +36,7 @@
@VintfStability
parcelable DemuxFilterDownloadEvent {
int itemId;
+ int downloadId;
int mpuSequenceNumber;
int itemFragmentIndex;
int lastItemFragmentIndex;
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl
index ff06888..86ce646 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl
@@ -35,5 +35,6 @@
/* @hide */
@VintfStability
parcelable DemuxFilterDownloadSettings {
+ boolean useDownloadId;
int downloadId;
}
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl
index a463d68..61a9555 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl
@@ -38,6 +38,8 @@
int streamId;
boolean isPtsPresent;
long pts;
+ boolean isDtsPresent;
+ long dts;
long dataLength;
long offset;
android.hardware.common.NativeHandle avMemory;
@@ -46,4 +48,5 @@
int mpuSequenceNumber;
boolean isPesPrivateData;
android.hardware.tv.tuner.DemuxFilterMediaEventExtraMetaData extraMetaData;
+ android.hardware.tv.tuner.DemuxFilterScIndexMask scIndexMask;
}
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl
index 01b8a77..199a09c 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl
@@ -38,5 +38,5 @@
int tableId;
int version;
int sectionNum;
- int dataLength;
+ long dataLength;
}
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl
index 2c6cc00..e763cfb 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl
@@ -50,4 +50,5 @@
android.hardware.tv.tuner.FrontendModulation modulation;
android.hardware.tv.tuner.FrontendDvbcAnnex annex;
boolean isHighPriority;
+ int[] dvbtCellIds;
}
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageType.aidl
index b121c85..6976ecd 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageType.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageType.aidl
@@ -50,4 +50,5 @@
MODULATION = 12,
DVBC_ANNEX = 13,
HIGH_PRIORITY = 14,
+ DVBT_CELL_IDS = 15,
}
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl
index 7677221..fc0efc9 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl
@@ -74,4 +74,6 @@
boolean isShortFrames;
android.hardware.tv.tuner.FrontendIsdbtMode isdbtMode;
android.hardware.tv.tuner.FrontendIsdbtPartialReceptionFlag partialReceptionFlag;
+ int[] streamIdList;
+ int[] dvbtCellIds;
}
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl
index 6342479..2cc62d5 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl
@@ -74,4 +74,6 @@
IS_SHORT_FRAMES = 36,
ISDBT_MODE = 37,
ISDBT_PARTIAL_RECEPTION_FLAG = 38,
+ STREAM_ID_LIST = 39,
+ DVBT_CELL_IDS = 40,
}
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl
index ed5b0c0..e7aa070 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl
@@ -43,7 +43,7 @@
void stopScan();
android.hardware.tv.tuner.FrontendStatus[] getStatus(in android.hardware.tv.tuner.FrontendStatusType[] statusTypes);
void setLnb(in int lnbId);
- void setLna(in boolean bEnable);
int linkCiCam(in int ciCamId);
void unlinkCiCam(in int ciCamId);
+ String getHardwareInfo();
}
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl
index 0e903d8..decf5b1 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl
@@ -44,4 +44,5 @@
int[] getLnbIds();
android.hardware.tv.tuner.ILnb openLnbById(in int lnbId);
android.hardware.tv.tuner.ILnb openLnbByName(in String lnbName, out int[] lnbId);
+ void setLna(in boolean bEnable);
}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/AudioStreamType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/AudioStreamType.aidl
index 1bb5c68f..9e9a8cf 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/AudioStreamType.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/AudioStreamType.aidl
@@ -99,4 +99,24 @@
* SJ/T 11368-2006
*/
DRA,
+
+ /*
+ * AAC with ADTS (Audio Data Transport Format).
+ */
+ AAC_ADTS,
+
+ /*
+ * AAC with ADTS with LATM (Low-overhead MPEG-4 Audio Transport Multiplex).
+ */
+ AAC_LATM,
+
+ /*
+ * High-Efficiency AAC (HE-AAC) with ADTS (Audio Data Transport Format).
+ */
+ AAC_HE_ADTS,
+
+ /*
+ * High-Efficiency AAC (HE-AAC) with LATM (Low-overhead MPEG-4 Audio Transport Multiplex).
+ */
+ AAC_HE_LATM,
}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl
index cf88928..b9df5a0 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadEvent.aidl
@@ -28,6 +28,11 @@
int itemId;
/**
+ * Uniquely identify data content within the same Package ID (PID).
+ */
+ int downloadId;
+
+ /**
* MPU sequence number of filtered data (only for MMTP)
*/
int mpuSequenceNumber;
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl
index bd79bd5..1188b03 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterDownloadSettings.aidl
@@ -23,6 +23,11 @@
@VintfStability
parcelable DemuxFilterDownloadSettings {
/**
+ * Whether download ID should be used.
+ */
+ boolean useDownloadId;
+
+ /**
* Download ID (also known as the carousel ID) is carried in the PMT in
* ISO/IEC 13818-1 for the service containing the object carousel.
*/
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl
index ec7bbf1..32f0cb2 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl
@@ -19,6 +19,7 @@
import android.hardware.common.NativeHandle;
import android.hardware.tv.tuner.DemuxFilterMediaEventExtraMetaData;
+import android.hardware.tv.tuner.DemuxFilterScIndexMask;
/**
* Filter Event for Audio or Video Filter.
@@ -40,6 +41,16 @@
long pts;
/**
+ * true if DTS is present in the PES header.
+ */
+ boolean isDtsPresent;
+
+ /**
+ * Decode TimeStamp for audio or video frame.
+ */
+ long dts;
+
+ /**
* Data size in bytes of audio or video frame
*/
long dataLength;
@@ -74,4 +85,10 @@
boolean isPesPrivateData;
DemuxFilterMediaEventExtraMetaData extraMetaData;
+
+ /**
+ * DemuxFilterScIndexMask for the key frame info. It's optional to hardware which can only
+ * access unit framing at decode stage.
+ */
+ DemuxFilterScIndexMask scIndexMask;
}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl
index d666316..a5f9ca7 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionEvent.aidl
@@ -40,5 +40,5 @@
/**
* Data size in bytes of filtered data
*/
- int dataLength;
+ long dataLength;
}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl
index 2102aa0..f6788ee 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettings.aidl
@@ -32,7 +32,16 @@
boolean isCheckCrc;
/**
- * true if the filter repeats the data with the same version
+ * true if the filter repeats the data.
+ *
+ * If false, for DemuxFilterSectionSettingsConditionTableInfo, HAL filters out all sections
+ * based on tableId and version, and stops filtering data. For DemuxFilterSectionBits, HAL
+ * filters out first section which matches the DemuxFilterSectionBits configuration, and stops
+ * filtering data.
+ *
+ * If true, for DemuxFilterSectionSettingsConditionTableInfo, HAL filters out all sections based
+ * on tableId and version, and repeats. For DemuxFilterSectionBits, HAL filters out sections
+ * which match the DemuxFilterSectionBits configuration, and repeats.
*/
boolean isRepeat;
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterStatus.aidl
index f07c26f..e6f3b63 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterStatus.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterStatus.aidl
@@ -24,7 +24,8 @@
@Backing(type="byte")
enum DemuxFilterStatus {
/**
- * The data in the filter buffer is ready to be read.
+ * The data in the filter buffer is ready to be read. It can also be used to know the STC
+ * (System Time Clock) ready status if it's PCR filter.
*/
DATA_READY = 1 << 0,
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendEventType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendEventType.aidl
index 40b5161..501dc1f 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendEventType.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendEventType.aidl
@@ -24,7 +24,9 @@
@Backing(type="int")
enum FrontendEventType {
/**
- * The frontend has locked to the signal specified by the tune method.
+ * The frontend has locked to the signal specified by the tune method. It can also be notified
+ * after signal is locked if the signal attributes transmission parameter of the signal is
+ * changed (e.g., Modulation).
*/
LOCKED,
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl
index 19c6766..a941066 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl
@@ -70,4 +70,10 @@
FrontendDvbcAnnex annex;
boolean isHighPriority;
+
+ /**
+ * DVB-T Cell Ids.
+ */
+ int[] dvbtCellIds;
+
}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageType.aidl
index 2b91216..f4d2ee0 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageType.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageType.aidl
@@ -86,4 +86,10 @@
DVBC_ANNEX,
HIGH_PRIORITY,
+
+ /**
+ * DVB-T CELL ID.
+ */
+ DVBT_CELL_IDS,
+
}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl
index 9302b76..ae6e46f 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl
@@ -91,11 +91,19 @@
/**
* AGC value is normalized from 0 to 255.
+ * Larger AGC values indicate it is applying more gain.
*/
int agc;
boolean isLnaOn;
+ /**
+ * Layer Error status.
+ *
+ * The order of the vectors is in ascending order of the required CNR (Contrast-to-noise ratio).
+ * The most robust layer is the first. For example, in ISDB-T, isLayerError[0] is the
+ * information of layer A. isLayerError[1] is the information of layer B.
+ */
boolean[] isLayerError;
/**
@@ -119,16 +127,28 @@
/**
* Modulation status.
+ *
+ * The order of the vectors is in ascending order of the required CNR (Contrast-to-noise ratio).
+ * The most robust layer is the first. For example, in ISDB-T, modulations[0] is the information
+ * of layer A. modulations[1] is the information of layer B.
*/
FrontendModulation[] modulations;
/**
* Bit error ratio status.
+ *
+ * The order of the vectors is in ascending order of the required CNR (Contrast-to-noise ratio).
+ * The most robust layer is the first. For example, in ISDB-T, bers[0] is the information of
+ * layer A. bers[1] is the information of layer B.
*/
int[] bers;
/**
* Code rate status.
+ *
+ * The order of the vectors is in ascending order of the required CN. The most robust layer is
+ * the first. For example, in ISDB-T, codeRates[0] is the information of layer A. codeRates[1]
+ * is the information of layer B.
*/
FrontendInnerFec[] codeRates;
@@ -160,11 +180,19 @@
/**
* Frontend Interleaving Modes.
+ *
+ * The order of the vectors is in ascending order of the required CNR (Contrast-to-noise ratio).
+ * The most robust layer is the first. For example, in ISDB-T, interleaving[0] is the
+ * information of layer A. interleaving[1] is the information of layer B.
*/
FrontendInterleaveMode[] interleaving;
/**
* Segments in ISDB-T Specification of all the channels.
+ *
+ * The order of the vectors is in ascending order of the required CNR (Contrast-to-noise ratio).
+ * The most robust layer is the first. For example, in ISDB-T, isdbtSegment[0] is the
+ * information of layer A. isdbtSegment[1] is the information of layer B.
*/
int[] isdbtSegment;
@@ -202,4 +230,16 @@
* ISDB-T Partial Reception Flag.
*/
FrontendIsdbtPartialReceptionFlag partialReceptionFlag;
+
+ /**
+ * Stream ID list included in a transponder.
+ */
+ int[] streamIdList;
+
+ /**
+ * DVB-T Cell Id.
+ */
+ int[] dvbtCellIds;
+
+
}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl
index 103a4ab..e7da517 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl
@@ -218,4 +218,14 @@
* ISDB-T Partial Reception Flag.
*/
ISDBT_PARTIAL_RECEPTION_FLAG,
+
+ /**
+ * Stream ID list included in a transponder.
+ */
+ STREAM_ID_LIST,
+
+ /**
+ * DVB-T Cell Id.
+ */
+ DVBT_CELL_IDS,
}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl
index b2717db..5b3ce39 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl
@@ -117,13 +117,6 @@
void setLnb(in int lnbId);
/**
- * Enable or Disable Low Noise Amplifier (LNA).
- *
- * @param bEnable true if activate LNA module; false if deactivate LNA
- */
- void setLna(in boolean bEnable);
-
- /**
* Link Conditional Access Modules (CAM) to Frontend support Common
* Interface (CI) bypass mode.
*
@@ -143,4 +136,14 @@
* @param ciCamId specify CI-CAM Id to unlink.
*/
void unlinkCiCam(in int ciCamId);
+
+ /**
+ * Request Hardware information about the frontend.
+ *
+ * The client may use this to collect vendor specific hardware information, e.g. RF
+ * chip version, Demod chip version, detailed status of dvbs blind scan, etc.
+ *
+ * @return the frontend hardware information.
+ */
+ String getHardwareInfo();
}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl
index ab8b0b8..1fcbb06 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl
@@ -120,4 +120,11 @@
* @return the newly opened Lnb iterface.
*/
ILnb openLnbByName(in String lnbName, out int[] lnbId);
+
+ /**
+ * Enable or Disable Low Noise Amplifier (LNA).
+ *
+ * @param bEnable true if activate LNA module; false if deactivate LNA
+ */
+ void setLna(in boolean bEnable);
}
diff --git a/tv/tuner/aidl/default/Demux.cpp b/tv/tuner/aidl/default/Demux.cpp
index 4385461..a94b4ad 100644
--- a/tv/tuner/aidl/default/Demux.cpp
+++ b/tv/tuner/aidl/default/Demux.cpp
@@ -410,6 +410,37 @@
return mIsRecording;
}
+binder_status_t Demux::dump(int fd, const char** args, uint32_t numArgs) {
+ dprintf(fd, " Demux %d:\n", mDemuxId);
+ dprintf(fd, " mIsRecording %d\n", mIsRecording);
+ {
+ dprintf(fd, " Filters:\n");
+ map<int64_t, std::shared_ptr<Filter>>::iterator it;
+ for (it = mFilters.begin(); it != mFilters.end(); it++) {
+ it->second->dump(fd, args, numArgs);
+ }
+ }
+ {
+ dprintf(fd, " TimeFilter:\n");
+ if (mTimeFilter != nullptr) {
+ mTimeFilter->dump(fd, args, numArgs);
+ }
+ }
+ {
+ dprintf(fd, " DvrPlayback:\n");
+ if (mDvrPlayback != nullptr) {
+ mDvrPlayback->dump(fd, args, numArgs);
+ }
+ }
+ {
+ dprintf(fd, " DvrRecord:\n");
+ if (mDvrRecord != nullptr) {
+ mDvrRecord->dump(fd, args, numArgs);
+ }
+ }
+ return STATUS_OK;
+}
+
bool Demux::attachRecordFilter(int64_t filterId) {
if (mFilters[filterId] == nullptr || mDvrRecord == nullptr ||
!mFilters[filterId]->isRecordFilter()) {
diff --git a/tv/tuner/aidl/default/Demux.h b/tv/tuner/aidl/default/Demux.h
index 1b789bd..7f0b0a7 100644
--- a/tv/tuner/aidl/default/Demux.h
+++ b/tv/tuner/aidl/default/Demux.h
@@ -71,6 +71,8 @@
::ndk::ScopedAStatus connectCiCam(int32_t in_ciCamId) override;
::ndk::ScopedAStatus disconnectCiCam() override;
+ binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
+
// Functions interacts with Tuner Service
void stopFrontendInput();
::ndk::ScopedAStatus removeFilter(int64_t filterId);
diff --git a/tv/tuner/aidl/default/Dvr.cpp b/tv/tuner/aidl/default/Dvr.cpp
index 4f34b8e..c591d07 100644
--- a/tv/tuner/aidl/default/Dvr.cpp
+++ b/tv/tuner/aidl/default/Dvr.cpp
@@ -177,6 +177,13 @@
return mDvrEventFlag;
}
+binder_status_t Dvr::dump(int fd, const char** /* args */, uint32_t /* numArgs */) {
+ dprintf(fd, " Dvr:\n");
+ dprintf(fd, " mType: %hhd\n", mType);
+ dprintf(fd, " mDvrThreadRunning: %d\n", (bool)mDvrThreadRunning);
+ return STATUS_OK;
+}
+
void Dvr::playbackThreadLoop() {
ALOGD("[Dvr] playback threadLoop start.");
diff --git a/tv/tuner/aidl/default/Dvr.h b/tv/tuner/aidl/default/Dvr.h
index ad8728e..6ff71cd 100644
--- a/tv/tuner/aidl/default/Dvr.h
+++ b/tv/tuner/aidl/default/Dvr.h
@@ -71,6 +71,8 @@
::ndk::ScopedAStatus flush() override;
::ndk::ScopedAStatus close() override;
+ binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
+
/**
* To create a DvrMQ and its Event Flag.
*
diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp
index 54037be..769ebe2 100644
--- a/tv/tuner/aidl/default/Filter.cpp
+++ b/tv/tuner/aidl/default/Filter.cpp
@@ -22,6 +22,7 @@
#include <aidl/android/hardware/tv/tuner/DemuxQueueNotifyBits.h>
#include <aidl/android/hardware/tv/tuner/Result.h>
#include <aidlcommonsupport/NativeHandle.h>
+#include <inttypes.h>
#include <utils/Log.h>
#include "Filter.h"
@@ -655,6 +656,17 @@
mSharedAvMemHandle = nullptr;
}
+binder_status_t Filter::dump(int fd, const char** /* args */, uint32_t /* numArgs */) {
+ dprintf(fd, " Filter %" PRIu64 ":\n", mFilterId);
+ dprintf(fd, " Main type: %d\n", mType.mainType);
+ dprintf(fd, " mIsMediaFilter: %d\n", mIsMediaFilter);
+ dprintf(fd, " mIsPcrFilter: %d\n", mIsPcrFilter);
+ dprintf(fd, " mIsRecordFilter: %d\n", mIsRecordFilter);
+ dprintf(fd, " mIsUsingFMQ: %d\n", mIsUsingFMQ);
+ dprintf(fd, " mFilterThreadRunning: %d\n", (bool)mFilterThreadRunning);
+ return STATUS_OK;
+}
+
void Filter::maySendFilterStatusCallback() {
if (!mIsUsingFMQ) {
return;
@@ -1148,6 +1160,7 @@
DemuxFilterMediaEvent mediaEvent;
mediaEvent.streamId = 1;
mediaEvent.isPtsPresent = true;
+ mediaEvent.isDtsPresent = false;
mediaEvent.dataLength = 3;
mediaEvent.offset = 4;
mediaEvent.isSecureMemory = true;
@@ -1238,6 +1251,7 @@
void Filter::createDownloadEvent(vector<DemuxFilterEvent>& events) {
DemuxFilterDownloadEvent download;
download.itemId = 1;
+ download.downloadId = 1;
download.mpuSequenceNumber = 2;
download.itemFragmentIndex = 3;
download.lastItemFragmentIndex = 4;
diff --git a/tv/tuner/aidl/default/Filter.h b/tv/tuner/aidl/default/Filter.h
index 8388c98..e301249 100644
--- a/tv/tuner/aidl/default/Filter.h
+++ b/tv/tuner/aidl/default/Filter.h
@@ -126,6 +126,8 @@
::ndk::ScopedAStatus setDataSource(const std::shared_ptr<IFilter>& in_filter) override;
::ndk::ScopedAStatus setDelayHint(const FilterDelayHint& in_hint) override;
+ binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
+
/**
* To create a FilterMQ and its Event Flag.
*
diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp
index 77d20e2..714612d 100644
--- a/tv/tuner/aidl/default/Frontend.cpp
+++ b/tv/tuner/aidl/default/Frontend.cpp
@@ -87,47 +87,60 @@
::ndk::ScopedAStatus Frontend::scan(const FrontendSettings& in_settings, FrontendScanType in_type) {
ALOGV("%s", __FUNCTION__);
+ // If it's in middle of scanning, stop it first.
+ if (mScanThread.joinable()) {
+ mScanThread.join();
+ }
+
+ mFrontendSettings = in_settings;
+ mFrontendScanType = in_type;
+ mScanThread = std::thread(&Frontend::scanThreadLoop, this);
+
+ return ::ndk::ScopedAStatus::ok();
+}
+
+void Frontend::scanThreadLoop() {
if (mIsLocked) {
FrontendScanMessage msg;
msg.set<FrontendScanMessage::Tag::isEnd>(true);
mCallback->onScanMessage(FrontendScanMessageType::END, msg);
- return ::ndk::ScopedAStatus::ok();
+ return;
}
int64_t frequency = 0;
- switch (in_settings.getTag()) {
+ switch (mFrontendSettings.getTag()) {
case FrontendSettings::Tag::analog:
- frequency = in_settings.get<FrontendSettings::Tag::analog>().frequency;
+ frequency = mFrontendSettings.get<FrontendSettings::Tag::analog>().frequency;
break;
case FrontendSettings::Tag::atsc:
- frequency = in_settings.get<FrontendSettings::Tag::atsc>().frequency;
+ frequency = mFrontendSettings.get<FrontendSettings::Tag::atsc>().frequency;
break;
case FrontendSettings::Tag::atsc3:
- frequency = in_settings.get<FrontendSettings::Tag::atsc3>().frequency;
+ frequency = mFrontendSettings.get<FrontendSettings::Tag::atsc3>().frequency;
break;
case FrontendSettings::Tag::dvbs:
- frequency = in_settings.get<FrontendSettings::Tag::dvbs>().frequency;
+ frequency = mFrontendSettings.get<FrontendSettings::Tag::dvbs>().frequency;
break;
case FrontendSettings::Tag::dvbc:
- frequency = in_settings.get<FrontendSettings::Tag::dvbc>().frequency;
+ frequency = mFrontendSettings.get<FrontendSettings::Tag::dvbc>().frequency;
break;
case FrontendSettings::Tag::dvbt:
- frequency = in_settings.get<FrontendSettings::Tag::dvbt>().frequency;
+ frequency = mFrontendSettings.get<FrontendSettings::Tag::dvbt>().frequency;
break;
case FrontendSettings::Tag::isdbs:
- frequency = in_settings.get<FrontendSettings::Tag::isdbs>().frequency;
+ frequency = mFrontendSettings.get<FrontendSettings::Tag::isdbs>().frequency;
break;
case FrontendSettings::Tag::isdbs3:
- frequency = in_settings.get<FrontendSettings::Tag::isdbs3>().frequency;
+ frequency = mFrontendSettings.get<FrontendSettings::Tag::isdbs3>().frequency;
break;
case FrontendSettings::Tag::isdbt:
- frequency = in_settings.get<FrontendSettings::Tag::isdbt>().frequency;
+ frequency = mFrontendSettings.get<FrontendSettings::Tag::isdbt>().frequency;
break;
default:
break;
}
- if (in_type == FrontendScanType::SCAN_BLIND) {
+ if (mFrontendScanType == FrontendScanType::SCAN_BLIND) {
frequency += 100 * 1000;
}
@@ -237,19 +250,28 @@
mCallback->onScanMessage(FrontendScanMessageType::HIGH_PRIORITY, msg);
}
+ if (mType == FrontendType::DVBT) {
+ FrontendScanMessage msg;
+ vector<int32_t> dvbtCellIds = {0, 1};
+ msg.set<FrontendScanMessage::Tag::dvbtCellIds>(dvbtCellIds);
+ mCallback->onScanMessage(FrontendScanMessageType::DVBT_CELL_IDS, msg);
+ }
+
{
FrontendScanMessage msg;
msg.set<FrontendScanMessage::Tag::isLocked>(true);
mCallback->onScanMessage(FrontendScanMessageType::LOCKED, msg);
mIsLocked = true;
}
-
- return ::ndk::ScopedAStatus::ok();
}
::ndk::ScopedAStatus Frontend::stopScan() {
ALOGV("%s", __FUNCTION__);
+ if (mScanThread.joinable()) {
+ mScanThread.join();
+ }
+
mIsLocked = false;
return ::ndk::ScopedAStatus::ok();
}
@@ -676,6 +698,16 @@
FrontendIsdbtPartialReceptionFlag::AUTO);
break;
}
+ case FrontendStatusType::STREAM_ID_LIST: {
+ vector<int32_t> streamIds = {0, 1};
+ status.set<FrontendStatus::streamIdList>(streamIds);
+ break;
+ }
+ case FrontendStatusType::DVBT_CELL_IDS: {
+ vector<int32_t> dvbtCellIds = {0, 1};
+ status.set<FrontendStatus::dvbtCellIds>(dvbtCellIds);
+ break;
+ }
default: {
continue;
}
@@ -686,12 +718,6 @@
return ::ndk::ScopedAStatus::ok();
}
-::ndk::ScopedAStatus Frontend::setLna(bool /* in_bEnable */) {
- ALOGV("%s", __FUNCTION__);
-
- return ::ndk::ScopedAStatus::ok();
-}
-
::ndk::ScopedAStatus Frontend::setLnb(int32_t /* in_lnbId */) {
ALOGV("%s", __FUNCTION__);
if (!supportsSatellite()) {
@@ -718,6 +744,21 @@
return ::ndk::ScopedAStatus::ok();
}
+binder_status_t Frontend::dump(int fd, const char** /* args */, uint32_t /* numArgs */) {
+ dprintf(fd, " Frontend %d\n", mId);
+ dprintf(fd, " mType: %d\n", mType);
+ dprintf(fd, " mIsLocked: %d\n", mIsLocked);
+ dprintf(fd, " mCiCamId: %d\n", mCiCamId);
+ return STATUS_OK;
+}
+
+::ndk::ScopedAStatus Frontend::getHardwareInfo(std::string* _aidl_return) {
+ ALOGV("%s", __FUNCTION__);
+
+ *_aidl_return = "Sample Frontend";
+ return ::ndk::ScopedAStatus::ok();
+}
+
FrontendType Frontend::getFrontendType() {
return mType;
}
diff --git a/tv/tuner/aidl/default/Frontend.h b/tv/tuner/aidl/default/Frontend.h
index 3c602cf..fdedf1e 100644
--- a/tv/tuner/aidl/default/Frontend.h
+++ b/tv/tuner/aidl/default/Frontend.h
@@ -19,6 +19,7 @@
#include <aidl/android/hardware/tv/tuner/BnFrontend.h>
#include <fstream>
#include <iostream>
+#include <thread>
#include "Tuner.h"
using namespace std;
@@ -46,9 +47,11 @@
::ndk::ScopedAStatus getStatus(const std::vector<FrontendStatusType>& in_statusTypes,
std::vector<FrontendStatus>* _aidl_return) override;
::ndk::ScopedAStatus setLnb(int32_t in_lnbId) override;
- ::ndk::ScopedAStatus setLna(bool in_bEnable) override;
::ndk::ScopedAStatus linkCiCam(int32_t in_ciCamId, int32_t* _aidl_return) override;
::ndk::ScopedAStatus unlinkCiCam(int32_t in_ciCamId) override;
+ ::ndk::ScopedAStatus getHardwareInfo(std::string* _aidl_return) override;
+
+ binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
FrontendType getFrontendType();
int32_t getFrontendId();
@@ -58,13 +61,17 @@
private:
virtual ~Frontend();
bool supportsSatellite();
+ void scanThreadLoop();
+
std::shared_ptr<IFrontendCallback> mCallback;
std::shared_ptr<Tuner> mTuner;
FrontendType mType = FrontendType::UNDEFINED;
int32_t mId = 0;
bool mIsLocked = false;
int32_t mCiCamId;
-
+ std::thread mScanThread;
+ FrontendSettings mFrontendSettings;
+ FrontendScanType mFrontendScanType;
std::ifstream mFrontendData;
};
diff --git a/tv/tuner/aidl/default/TimeFilter.cpp b/tv/tuner/aidl/default/TimeFilter.cpp
index dde7be3..9611ed9 100644
--- a/tv/tuner/aidl/default/TimeFilter.cpp
+++ b/tv/tuner/aidl/default/TimeFilter.cpp
@@ -83,6 +83,12 @@
return ::ndk::ScopedAStatus::ok();
}
+binder_status_t TimeFilter::dump(int fd, const char** /* args */, uint32_t /* numArgs */) {
+ dprintf(fd, " TimeFilter:\n");
+ dprintf(fd, " mTimeStamp: %" PRIu64 "\n", mTimeStamp);
+ return STATUS_OK;
+}
+
} // namespace tuner
} // namespace tv
} // namespace hardware
diff --git a/tv/tuner/aidl/default/TimeFilter.h b/tv/tuner/aidl/default/TimeFilter.h
index ff35c47..5f4c2d4 100644
--- a/tv/tuner/aidl/default/TimeFilter.h
+++ b/tv/tuner/aidl/default/TimeFilter.h
@@ -44,8 +44,10 @@
::ndk::ScopedAStatus getSourceTime(int64_t* _aidl_return) override;
::ndk::ScopedAStatus close() override;
+ binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
+
private:
- std::shared_ptr<Demux> mDemux;
+ ::std::shared_ptr<Demux> mDemux;
uint64_t mTimeStamp = INVALID_TIME_STAMP;
time_t mBeginTime;
};
diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp
index badb08f..45f3dfa 100644
--- a/tv/tuner/aidl/default/Tuner.cpp
+++ b/tv/tuner/aidl/default/Tuner.cpp
@@ -55,9 +55,13 @@
capsIsdbs.set<FrontendCapabilities::Tag::isdbsCaps>(FrontendIsdbsCapabilities());
mFrontendCaps[0] = capsIsdbs;
statusCaps = {
- FrontendStatusType::DEMOD_LOCK, FrontendStatusType::SNR,
- FrontendStatusType::FEC, FrontendStatusType::MODULATION,
- FrontendStatusType::MODULATIONS, FrontendStatusType::ROLL_OFF,
+ FrontendStatusType::DEMOD_LOCK,
+ FrontendStatusType::SNR,
+ FrontendStatusType::FEC,
+ FrontendStatusType::MODULATION,
+ FrontendStatusType::MODULATIONS,
+ FrontendStatusType::ROLL_OFF,
+ FrontendStatusType::STREAM_ID_LIST,
};
mFrontendStatusCaps[0] = statusCaps;
@@ -108,6 +112,7 @@
FrontendStatusType::GUARD_INTERVAL,
FrontendStatusType::TRANSMISSION_MODE,
FrontendStatusType::T2_SYSTEM_ID,
+ FrontendStatusType::DVBT_CELL_IDS,
};
mFrontendStatusCaps[4] = statusCaps;
@@ -169,7 +174,7 @@
statusCaps = {
FrontendStatusType::DEMOD_LOCK, FrontendStatusType::MODULATION,
FrontendStatusType::MODULATIONS, FrontendStatusType::ROLL_OFF,
- FrontendStatusType::IS_SHORT_FRAMES,
+ FrontendStatusType::IS_SHORT_FRAMES, FrontendStatusType::STREAM_ID_LIST,
};
mFrontendStatusCaps[8] = statusCaps;
@@ -313,6 +318,39 @@
return ::ndk::ScopedAStatus::ok();
}
+::ndk::ScopedAStatus Tuner::setLna(bool /* in_bEnable */) {
+ ALOGV("%s", __FUNCTION__);
+
+ return ::ndk::ScopedAStatus::ok();
+}
+
+binder_status_t Tuner::dump(int fd, const char** args, uint32_t numArgs) {
+ ALOGV("%s", __FUNCTION__);
+ {
+ dprintf(fd, "Frontends:\n");
+ for (int i = 0; i < mFrontendSize; i++) {
+ mFrontends[i]->dump(fd, args, numArgs);
+ for (int j = 0; j < mFrontendStatusCaps[i].size(); j++) {
+ dprintf(fd, " statusCap: %d\n", mFrontendStatusCaps[i][j]);
+ }
+ }
+ }
+ {
+ dprintf(fd, "Demuxs:\n");
+ map<int32_t, std::shared_ptr<Demux>>::iterator it;
+ for (it = mDemuxes.begin(); it != mDemuxes.end(); it++) {
+ it->second->dump(fd, args, numArgs);
+ }
+ }
+ {
+ dprintf(fd, "Lnbs:\n");
+ for (int i = 0; i < mLnbs.size(); i++) {
+ mLnbs[i]->dump(fd, args, numArgs);
+ }
+ }
+ return STATUS_OK;
+}
+
void Tuner::setFrontendAsDemuxSource(int32_t frontendId, int32_t demuxId) {
mFrontendToDemux[frontendId] = demuxId;
if (mFrontends[frontendId] != nullptr && mFrontends[frontendId]->isLocked()) {
@@ -332,6 +370,10 @@
}
void Tuner::removeFrontend(int32_t frontendId) {
+ map<int32_t, int32_t>::iterator it = mFrontendToDemux.find(frontendId);
+ if (it != mFrontendToDemux.end()) {
+ mDemuxes.erase(it->second);
+ }
mFrontendToDemux.erase(frontendId);
}
diff --git a/tv/tuner/aidl/default/Tuner.h b/tv/tuner/aidl/default/Tuner.h
index 7af7ab8..b33a1be 100644
--- a/tv/tuner/aidl/default/Tuner.h
+++ b/tv/tuner/aidl/default/Tuner.h
@@ -56,6 +56,9 @@
::ndk::ScopedAStatus openLnbByName(const std::string& in_lnbName,
std::vector<int32_t>* out_lnbId,
std::shared_ptr<ILnb>* _aidl_return) override;
+ ::ndk::ScopedAStatus setLna(bool in_bEnable) override;
+
+ binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
std::shared_ptr<Frontend> getFrontendById(int32_t frontendId);
void setFrontendAsDemuxSource(int32_t frontendId, int32_t demuxId);
diff --git a/tv/tuner/aidl/vts/functional/FilterTests.cpp b/tv/tuner/aidl/vts/functional/FilterTests.cpp
index a5acdc1..53afef7 100644
--- a/tv/tuner/aidl/vts/functional/FilterTests.cpp
+++ b/tv/tuner/aidl/vts/functional/FilterTests.cpp
@@ -17,6 +17,7 @@
#include "FilterTests.h"
#include <inttypes.h>
+#include <algorithm>
#include <aidl/android/hardware/tv/tuner/DemuxFilterMonitorEventType.h>
#include <aidlcommonsupport/NativeHandle.h>
@@ -31,23 +32,24 @@
mPidFilterOutputCount++;
mMsgCondition.signal();
- // HACK: we need to cast the const away as DemuxFilterEvent contains a ScopedFileDescriptor
- // that cannot be copied.
- for (auto&& e : const_cast<std::vector<DemuxFilterEvent>&>(events)) {
- auto it = mFilterEventPromises.find(e.getTag());
- if (it != mFilterEventPromises.cend()) {
- it->second.set_value(std::move(e));
- mFilterEventPromises.erase(it);
+ for (auto it = mFilterCallbackVerifiers.begin(); it != mFilterCallbackVerifiers.end();) {
+ auto& [verifier, promise] = *it;
+ if (verifier(events)) {
+ promise.set_value();
+ it = mFilterCallbackVerifiers.erase(it);
+ } else {
+ ++it;
}
- }
+ };
return ::ndk::ScopedAStatus::ok();
}
-std::future<DemuxFilterEvent> FilterCallback::getNextFilterEventWithTag(DemuxFilterEvent::Tag tag) {
- // Note: this currently only supports one future per DemuxFilterEvent::Tag.
- mFilterEventPromises[tag] = std::promise<DemuxFilterEvent>();
- return mFilterEventPromises[tag].get_future();
+std::future<void> FilterCallback::verifyFilterCallback(FilterCallbackVerifier&& verifier) {
+ std::promise<void> promise;
+ auto future = promise.get_future();
+ mFilterCallbackVerifiers.emplace_back(std::move(verifier), std::move(promise));
+ return future;
}
void FilterCallback::testFilterDataOutput() {
diff --git a/tv/tuner/aidl/vts/functional/FilterTests.h b/tv/tuner/aidl/vts/functional/FilterTests.h
index 6258bac..f579441 100644
--- a/tv/tuner/aidl/vts/functional/FilterTests.h
+++ b/tv/tuner/aidl/vts/functional/FilterTests.h
@@ -60,9 +60,18 @@
class FilterCallback : public BnFilterCallback {
public:
+ /**
+ * A FilterCallbackVerifier is used to test and verify filter callbacks.
+ * The function should return true when a callback has been handled by this
+ * filter verifier. This will cause the associated future to be unblocked.
+ * If the function returns false, we continue to wait for future callbacks
+ * (the future remains blocked).
+ */
+ using FilterCallbackVerifier = std::function<bool(const std::vector<DemuxFilterEvent>&)>;
+
virtual ::ndk::ScopedAStatus onFilterEvent(const vector<DemuxFilterEvent>& events) override;
- std::future<DemuxFilterEvent> getNextFilterEventWithTag(DemuxFilterEvent::Tag tag);
+ std::future<void> verifyFilterCallback(FilterCallbackVerifier&& verifier);
virtual ::ndk::ScopedAStatus onFilterStatus(const DemuxFilterStatus /*status*/) override {
return ::ndk::ScopedAStatus::ok();
@@ -85,7 +94,7 @@
int32_t mFilterId;
std::shared_ptr<IFilter> mFilter;
- std::unordered_map<DemuxFilterEvent::Tag, std::promise<DemuxFilterEvent>> mFilterEventPromises;
+ std::vector<std::pair<FilterCallbackVerifier, std::promise<void>>> mFilterCallbackVerifiers;
native_handle_t* mAvSharedHandle = nullptr;
uint64_t mAvSharedMemSize = -1;
diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
index 6204803..075ffad 100644
--- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp
+++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
@@ -398,6 +398,20 @@
expectStatuses[i].get<FrontendStatus::Tag::partialReceptionFlag>());
break;
}
+ case FrontendStatusType::STREAM_ID_LIST: {
+ ASSERT_TRUE(std::equal(
+ realStatuses[i].get<FrontendStatus::Tag::streamIdList>().begin(),
+ realStatuses[i].get<FrontendStatus::Tag::streamIdList>().end(),
+ expectStatuses[i].get<FrontendStatus::Tag::streamIdList>().begin()));
+ break;
+ }
+ case FrontendStatusType::DVBT_CELL_IDS: {
+ ASSERT_TRUE(std::equal(
+ realStatuses[i].get<FrontendStatus::Tag::dvbtCellIds>().begin(),
+ realStatuses[i].get<FrontendStatus::Tag::dvbtCellIds>().end(),
+ expectStatuses[i].get<FrontendStatus::Tag::dvbtCellIds>().begin()));
+ break;
+ }
default: {
continue;
}
@@ -430,6 +444,7 @@
getDvrTests()->startPlaybackInputThread(
mDvrConfig.playbackInputFile,
mDvrConfig.settings.get<DvrSettings::Tag::playback>());
+ getDvrTests()->startDvrPlayback();
}
mFrontendCallback->tuneTestOnLock(mFrontend, config.settings);
return AssertionResult(true);
@@ -441,6 +456,7 @@
status = mFrontend->stopTune();
if (mIsSoftwareFe && testWithDemux) {
getDvrTests()->stopPlaybackThread();
+ getDvrTests()->stopDvrPlayback();
getDvrTests()->closeDvrPlayback();
}
return AssertionResult(status.isOk());
@@ -468,6 +484,13 @@
feId = INVALID_ID;
}
+AssertionResult FrontendTests::verifyHardwareInfo() {
+ EXPECT_TRUE(mFrontend) << "Test with openFrontendById first.";
+ std::string info;
+ ndk::ScopedAStatus status = mFrontend->getHardwareInfo(&info);
+ return AssertionResult(status.isOk() && !info.empty());
+}
+
void FrontendTests::tuneTest(FrontendConfig frontendConf) {
int32_t feId;
getFrontendIdByType(frontendConf.type, feId);
@@ -484,6 +507,18 @@
ASSERT_TRUE(closeFrontend());
}
+void FrontendTests::debugInfoTest(FrontendConfig frontendConf) {
+ int32_t feId;
+ getFrontendIdByType(frontendConf.type, feId);
+ ASSERT_TRUE(feId != INVALID_ID);
+ ASSERT_TRUE(openFrontendById(feId));
+ ASSERT_TRUE(setFrontendCallback());
+ ASSERT_TRUE(tuneFrontend(frontendConf, false /*testWithDemux*/));
+ ASSERT_TRUE(verifyHardwareInfo());
+ ASSERT_TRUE(stopTuneFrontend(false /*testWithDemux*/));
+ ASSERT_TRUE(closeFrontend());
+}
+
void FrontendTests::scanTest(FrontendConfig frontendConf, FrontendScanType scanType) {
int32_t feId;
getFrontendIdByType(frontendConf.type, feId);
diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.h b/tv/tuner/aidl/vts/functional/FrontendTests.h
index e5a9cd3..8f769a0 100644
--- a/tv/tuner/aidl/vts/functional/FrontendTests.h
+++ b/tv/tuner/aidl/vts/functional/FrontendTests.h
@@ -94,10 +94,12 @@
AssertionResult linkCiCam(int32_t ciCamId);
AssertionResult unlinkCiCam(int32_t ciCamId);
+ AssertionResult verifyHardwareInfo();
void getFrontendIdByType(FrontendType feType, int32_t& feId);
void tuneTest(FrontendConfig frontendConf);
void scanTest(FrontendConfig frontend, FrontendScanType type);
+ void debugInfoTest(FrontendConfig frontendConf);
void setDvrTests(DvrTests* dvrTests) { mExternalDvrTests = dvrTests; }
void setDemux(std::shared_ptr<IDemux> demux) { getDvrTests()->setDemux(demux); }
diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp
index 88890e4..f489bf7 100644
--- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp
+++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp
@@ -640,10 +640,51 @@
testTimeFilter(timeFilterMap[timeFilter.timeFilterId]);
}
-// TODO: move boilerplate into text fixture
-TEST_P(TunerFilterAidlTest, FilterTimeDelayHintTest) {
- description("Test filter delay hint.");
+static bool isMediaFilter(const FilterConfig& filterConfig) {
+ switch (filterConfig.type.mainType) {
+ case DemuxFilterMainType::TS: {
+ // TS Audio and Video filters are media filters
+ auto tsFilterType =
+ filterConfig.type.subType.get<DemuxFilterSubType::Tag::tsFilterType>();
+ return (tsFilterType == DemuxTsFilterType::AUDIO ||
+ tsFilterType == DemuxTsFilterType::VIDEO);
+ }
+ case DemuxFilterMainType::MMTP: {
+ // MMTP Audio and Video filters are media filters
+ auto mmtpFilterType =
+ filterConfig.type.subType.get<DemuxFilterSubType::Tag::mmtpFilterType>();
+ return (mmtpFilterType == DemuxMmtpFilterType::AUDIO ||
+ mmtpFilterType == DemuxMmtpFilterType::VIDEO);
+ }
+ default:
+ return false;
+ }
+}
+static int getDemuxFilterEventDataLength(const DemuxFilterEvent& event) {
+ switch (event.getTag()) {
+ case DemuxFilterEvent::Tag::section:
+ return event.get<DemuxFilterEvent::Tag::section>().dataLength;
+ case DemuxFilterEvent::Tag::media:
+ return event.get<DemuxFilterEvent::Tag::media>().dataLength;
+ case DemuxFilterEvent::Tag::pes:
+ return event.get<DemuxFilterEvent::Tag::pes>().dataLength;
+ case DemuxFilterEvent::Tag::download:
+ return event.get<DemuxFilterEvent::Tag::download>().dataLength;
+ case DemuxFilterEvent::Tag::ipPayload:
+ return event.get<DemuxFilterEvent::Tag::ipPayload>().dataLength;
+
+ case DemuxFilterEvent::Tag::tsRecord:
+ case DemuxFilterEvent::Tag::mmtpRecord:
+ case DemuxFilterEvent::Tag::temi:
+ case DemuxFilterEvent::Tag::monitorEvent:
+ case DemuxFilterEvent::Tag::startId:
+ return 0;
+ }
+}
+
+// TODO: move boilerplate into text fixture
+void TunerFilterAidlTest::testDelayHint(const FilterConfig& filterConf) {
int32_t feId;
int32_t demuxId;
std::shared_ptr<IDemux> demux;
@@ -657,40 +698,95 @@
ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId));
mFilterTests.setDemux(demux);
- const auto& filterConf = filterMap[live.ipFilterId];
ASSERT_TRUE(mFilterTests.openFilterInDemux(filterConf.type, filterConf.bufferSize));
ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(filterId));
- ASSERT_TRUE(mFilterTests.configFilter(filterConf.settings, filterId));
- ASSERT_TRUE(mFilterTests.configIpFilterCid(filterConf.ipCid, filterId));
+ bool mediaFilter = isMediaFilter(filterConf);
auto filter = mFilterTests.getFilterById(filterId);
- auto delayValue = std::chrono::milliseconds(5000);
- FilterDelayHint delayHint;
- delayHint.hintType = FilterDelayHintType::TIME_DELAY_IN_MS;
- delayHint.hintValue = delayValue.count();
-
- auto status = filter->setDelayHint(delayHint);
- ASSERT_TRUE(status.isOk());
-
+ // startTime needs to be set before calling setDelayHint.
auto startTime = std::chrono::steady_clock::now();
- ASSERT_TRUE(mFilterTests.startFilter(filterId));
+ auto timeDelayInMs = std::chrono::milliseconds(filterConf.timeDelayInMs);
+ if (timeDelayInMs.count() > 0) {
+ FilterDelayHint delayHint;
+ delayHint.hintType = FilterDelayHintType::TIME_DELAY_IN_MS;
+ delayHint.hintValue = timeDelayInMs.count();
+
+ // setDelayHint should fail for media filters.
+ ASSERT_EQ(filter->setDelayHint(delayHint).isOk(), !mediaFilter);
+ }
+
+ int dataDelayInBytes = filterConf.dataDelayInBytes;
+ if (dataDelayInBytes > 0) {
+ FilterDelayHint delayHint;
+ delayHint.hintType = FilterDelayHintType::DATA_SIZE_DELAY_IN_BYTES;
+ delayHint.hintValue = dataDelayInBytes;
+
+ // setDelayHint should fail for media filters.
+ ASSERT_EQ(filter->setDelayHint(delayHint).isOk(), !mediaFilter);
+ }
+
+ // start and stop filter (and wait for first callback) in order to
+ // circumvent callback scheduler race conditions after adjusting filter
+ // delays.
auto cb = mFilterTests.getFilterCallbacks().at(filterId);
- auto future = cb->getNextFilterEventWithTag(DemuxFilterEvent::Tag::ipPayload);
+ auto future =
+ cb->verifyFilterCallback([](const std::vector<DemuxFilterEvent>&) { return true; });
+ mFilterTests.startFilter(filterId);
- // block and wait for callback to be received.
- ASSERT_EQ(future.wait_for(std::chrono::seconds(10)), std::future_status::ready);
- auto duration = std::chrono::steady_clock::now() - startTime;
- ASSERT_GE(duration, delayValue);
+ auto timeout = std::chrono::seconds(30);
+ ASSERT_EQ(future.wait_for(timeout), std::future_status::ready);
- // cleanup
- ASSERT_TRUE(mFilterTests.stopFilter(filterId));
+ mFilterTests.stopFilter(filterId);
+
+ if (!mediaFilter) {
+ int callbackSize = 0;
+ future = cb->verifyFilterCallback(
+ [&callbackSize](const std::vector<DemuxFilterEvent>& events) {
+ for (const auto& event : events) {
+ callbackSize += getDemuxFilterEventDataLength(event);
+ }
+ return true;
+ });
+
+ // The configure stage can also produce events, so we should set the delay
+ // hint beforehand.
+ ASSERT_TRUE(mFilterTests.configFilter(filterConf.settings, filterId));
+
+ ASSERT_TRUE(mFilterTests.startFilter(filterId));
+
+ // block and wait for callback to be received.
+ ASSERT_EQ(future.wait_for(timeout), std::future_status::ready);
+ auto duration = std::chrono::steady_clock::now() - startTime;
+
+ bool delayHintTest = duration >= timeDelayInMs;
+ bool dataSizeTest = callbackSize >= dataDelayInBytes;
+
+ if (timeDelayInMs.count() > 0 && dataDelayInBytes > 0) {
+ ASSERT_TRUE(delayHintTest || dataSizeTest);
+ } else {
+ // if only one of time delay / data delay is configured, one of them
+ // holds true by default, so we want both assertions to be true.
+ ASSERT_TRUE(delayHintTest && dataSizeTest);
+ }
+
+ ASSERT_TRUE(mFilterTests.stopFilter(filterId));
+ }
+
ASSERT_TRUE(mFilterTests.closeFilter(filterId));
ASSERT_TRUE(mDemuxTests.closeDemux());
ASSERT_TRUE(mFrontendTests.closeFrontend());
}
+TEST_P(TunerFilterAidlTest, FilterDelayHintTest) {
+ description("Test filter time delay hint.");
+
+ for (const auto& obj : filterMap) {
+ testDelayHint(obj.second);
+ }
+}
+
TEST_P(TunerPlaybackAidlTest, PlaybackDataFlowWithTsSectionFilterTest) {
description("Feed ts data from playback and configure Ts section filter to get output");
if (!playback.support || playback.sectionFilterId.compare(emptyHardwareId) == 0) {
@@ -795,6 +891,14 @@
mFrontendTests.tuneTest(frontendMap[live.frontendId]);
}
+TEST_P(TunerFrontendAidlTest, getHardwareInfo) {
+ description("Test Frontend get hardware info");
+ if (!live.hasFrontendConnection) {
+ return;
+ }
+ mFrontendTests.debugInfoTest(frontendMap[live.frontendId]);
+}
+
TEST_P(TunerBroadcastAidlTest, BroadcastDataFlowVideoFilterTest) {
description("Test Video Filter functionality in Broadcast use case.");
if (!live.hasFrontendConnection) {
diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h
index 13c5a80..7f80d90 100644
--- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h
+++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h
@@ -140,6 +140,7 @@
void reconfigSingleFilterInDemuxTest(FilterConfig filterConf, FilterConfig filterReconf,
FrontendConfig frontendConf);
void testTimeFilter(TimeFilterConfig filterConf);
+ void testDelayHint(const FilterConfig& filterConf);
DemuxFilterType getLinkageFilterType(int bit) {
DemuxFilterType type;
diff --git a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
index 7ccf31a..b6cc5f8 100644
--- a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
+++ b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
@@ -96,6 +96,8 @@
AvStreamType streamType;
int32_t ipCid;
int32_t monitorEventTypes;
+ int timeDelayInMs = 0;
+ int dataDelayInBytes = 0;
bool operator<(const FilterConfig& /*c*/) const { return false; }
};
@@ -336,6 +338,12 @@
if (filterConfig.hasMonitorEventTypes()) {
filterMap[id].monitorEventTypes = (int32_t)filterConfig.getMonitorEventTypes();
}
+ if (filterConfig.hasTimeDelayInMs()) {
+ filterMap[id].timeDelayInMs = filterConfig.getTimeDelayInMs();
+ }
+ if (filterConfig.hasDataDelayInBytes()) {
+ filterMap[id].dataDelayInBytes = filterConfig.getDataDelayInBytes();
+ }
if (filterConfig.hasAvFilterSettings_optional()) {
auto av = filterConfig.getFirstAvFilterSettings_optional();
if (av->hasAudioStreamType_optional()) {
diff --git a/tv/tuner/config/api/current.txt b/tv/tuner/config/api/current.txt
index 6c637a4..db1d076 100644
--- a/tv/tuner/config/api/current.txt
+++ b/tv/tuner/config/api/current.txt
@@ -256,6 +256,7 @@
ctor public Filter();
method @Nullable public android.media.tuner.testing.configuration.V1_0.AvFilterSettings getAvFilterSettings_optional();
method @Nullable public java.math.BigInteger getBufferSize();
+ method @Nullable public java.math.BigInteger getDataDelayInBytes();
method @Nullable public String getId();
method @Nullable public android.media.tuner.testing.configuration.V1_0.IpFilterConfig getIpFilterConfig_optional();
method @Nullable public android.media.tuner.testing.configuration.V1_0.FilterMainTypeEnum getMainType();
@@ -264,9 +265,11 @@
method @Nullable public android.media.tuner.testing.configuration.V1_0.RecordFilterSettings getRecordFilterSettings_optional();
method @Nullable public android.media.tuner.testing.configuration.V1_0.SectionFilterSettings getSectionFilterSettings_optional();
method @Nullable public android.media.tuner.testing.configuration.V1_0.FilterSubTypeEnum getSubType();
+ method @Nullable public java.math.BigInteger getTimeDelayInMs();
method @Nullable public boolean getUseFMQ();
method public void setAvFilterSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.AvFilterSettings);
method public void setBufferSize(@Nullable java.math.BigInteger);
+ method public void setDataDelayInBytes(@Nullable java.math.BigInteger);
method public void setId(@Nullable String);
method public void setIpFilterConfig_optional(@Nullable android.media.tuner.testing.configuration.V1_0.IpFilterConfig);
method public void setMainType(@Nullable android.media.tuner.testing.configuration.V1_0.FilterMainTypeEnum);
@@ -275,6 +278,7 @@
method public void setRecordFilterSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.RecordFilterSettings);
method public void setSectionFilterSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.SectionFilterSettings);
method public void setSubType(@Nullable android.media.tuner.testing.configuration.V1_0.FilterSubTypeEnum);
+ method public void setTimeDelayInMs(@Nullable java.math.BigInteger);
method public void setUseFMQ(@Nullable boolean);
}
diff --git a/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml b/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml
index 8a6229e..da77200 100644
--- a/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml
+++ b/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml
@@ -101,7 +101,7 @@
bufferSize="16777216" pid="257" useFMQ="false">
<recordFilterSettings tsIndexMask="1" scIndexType="NONE"/>
</filter>
- <filter id="FILTER_IP_IP_0" mainType="IP" subType="IP" bufferSize="16777216" useFMQ="false">
+ <filter id="FILTER_IP_IP_0" mainType="IP" subType="IP" bufferSize="16777216" useFMQ="false" timeDelayInMs="5000">
<ipFilterConfig ipCid="1">
<srcIpAddress isIpV4="true" ip="192 168 1 1"/>
<destIpAddress isIpV4="true" ip="192 168 1 1"/>
diff --git a/tv/tuner/config/tuner_testing_dynamic_configuration.xsd b/tv/tuner/config/tuner_testing_dynamic_configuration.xsd
index fc2827f..54cedfc 100644
--- a/tv/tuner/config/tuner_testing_dynamic_configuration.xsd
+++ b/tv/tuner/config/tuner_testing_dynamic_configuration.xsd
@@ -243,6 +243,10 @@
"bufferSize": the buffer size of the filter in hex.
"pid": the pid that would be used to configure the filter.
"useFMQ": if the filter uses FMQ.
+ "timeDelayInMs": the filter's time delay hint. 0 by default. Must not be
+ longer than 30 seconds.
+ "dataDelayInBytes": the filter's data delay hint. 0 by default. Configured data
+ size must be received within 30 seconds.
Each filter element also contains at most one type-related "filterSettings".
- The settings type should match the filter "subType" attribute.
@@ -274,6 +278,8 @@
<xs:attribute name="pid" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="useFMQ" type="xs:boolean" use="required"/>
<xs:attribute name="monitorEventTypes" type="monitoEvents" use="optional"/>
+ <xs:attribute name="timeDelayInMs" type="xs:nonNegativeInteger" use="optional"/>
+ <xs:attribute name="dataDelayInBytes" type="xs:nonNegativeInteger" use="optional"/>
</xs:complexType>
<!-- DVR SESSION -->
diff --git a/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl
index c4cb47b..c7708f1 100644
--- a/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl
+++ b/uwb/aidl/aidl_api/android.hardware.uwb/current/android/hardware/uwb/IUwbChip.aidl
@@ -40,6 +40,7 @@
void open(in android.hardware.uwb.IUwbClientCallback clientCallback);
void close();
void coreInit();
+ void sessionInit(int sessionId);
int getSupportedAndroidUciVersion();
long getSupportedAndroidCapabilities();
int sendUciMessage(in byte[] data);
diff --git a/uwb/aidl/android/hardware/uwb/IUwbChip.aidl b/uwb/aidl/android/hardware/uwb/IUwbChip.aidl
index 0c98611..f2bb0f1 100644
--- a/uwb/aidl/android/hardware/uwb/IUwbChip.aidl
+++ b/uwb/aidl/android/hardware/uwb/IUwbChip.aidl
@@ -50,6 +50,14 @@
void coreInit();
/**
+ * Perform any necessary UWB session initializations.
+ * This must be invoked by the framework at the beginging of every new ranging session.
+ *
+ * @param sessionId Session identifier as defined in the UCI specification.
+ */
+ void sessionInit(int sessionId);
+
+ /**
* Supported version of vendor UCI specification.
*
* @return Returns the version of the "android.hardware.uwb.fira_android" types-only
diff --git a/uwb/aidl/default/uwb_chip.cpp b/uwb/aidl/default/uwb_chip.cpp
index 10dbdb6..a5a3f4a 100644
--- a/uwb/aidl/default/uwb_chip.cpp
+++ b/uwb/aidl/default/uwb_chip.cpp
@@ -51,6 +51,10 @@
return ndk::ScopedAStatus::ok();
}
+::ndk::ScopedAStatus UwbChip::sessionInit(int /* sessionId */) {
+ return ndk::ScopedAStatus::ok();
+}
+
::ndk::ScopedAStatus UwbChip::getSupportedAndroidUciVersion(int32_t* version) {
*version = kAndroidUciVersion;
return ndk::ScopedAStatus::ok();
diff --git a/uwb/aidl/default/uwb_chip.h b/uwb/aidl/default/uwb_chip.h
index ca97120..46cecd4 100644
--- a/uwb/aidl/default/uwb_chip.h
+++ b/uwb/aidl/default/uwb_chip.h
@@ -37,6 +37,7 @@
::ndk::ScopedAStatus open(const std::shared_ptr<IUwbClientCallback>& clientCallback) override;
::ndk::ScopedAStatus close() override;
::ndk::ScopedAStatus coreInit() override;
+ ::ndk::ScopedAStatus sessionInit(int sesionId) override;
::ndk::ScopedAStatus getSupportedAndroidUciVersion(int32_t* version) override;
::ndk::ScopedAStatus getSupportedAndroidCapabilities(int64_t* capabilities) override;
::ndk::ScopedAStatus sendUciMessage(const std::vector<uint8_t>& data,
diff --git a/uwb/aidl/vts/VtsHalUwbTargetTest.cpp b/uwb/aidl/vts/VtsHalUwbTargetTest.cpp
index 3820c0f..1da4432 100644
--- a/uwb/aidl/vts/VtsHalUwbTargetTest.cpp
+++ b/uwb/aidl/vts/VtsHalUwbTargetTest.cpp
@@ -166,6 +166,11 @@
EXPECT_TRUE(iuwb_chip->coreInit().isOk());
}
+TEST_P(UwbAidl, ChipSessionInit) {
+ const auto iuwb_chip = getAnyChipAndOpen();
+ EXPECT_TRUE(iuwb_chip->sessionInit(0).isOk());
+}
+
TEST_P(UwbAidl, ChipGetSupportedAndroidUciVersion) {
const auto iuwb_chip = getAnyChipAndOpen();
EXPECT_TRUE(iuwb_chip->coreInit().isOk());
diff --git a/vibrator/aidl/default/main.cpp b/vibrator/aidl/default/main.cpp
index bd834d2..feba2c7 100644
--- a/vibrator/aidl/default/main.cpp
+++ b/vibrator/aidl/default/main.cpp
@@ -31,14 +31,14 @@
auto vib = ndk::SharedRefBase::make<Vibrator>();
const std::string vibName = std::string() + Vibrator::descriptor + "/default";
binder_status_t status = AServiceManager_addService(vib->asBinder().get(), vibName.c_str());
- CHECK(status == STATUS_OK);
+ CHECK_EQ(status, STATUS_OK);
// make the vibrator manager service with a different vibrator
auto managedVib = ndk::SharedRefBase::make<Vibrator>();
auto vibManager = ndk::SharedRefBase::make<VibratorManager>(std::move(managedVib));
const std::string vibManagerName = std::string() + VibratorManager::descriptor + "/default";
status = AServiceManager_addService(vibManager->asBinder().get(), vibManagerName.c_str());
- CHECK(status == STATUS_OK);
+ CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
diff --git a/weaver/aidl/default/Weaver.cpp b/weaver/aidl/default/Weaver.cpp
index 56d9c4d..6b77924 100644
--- a/weaver/aidl/default/Weaver.cpp
+++ b/weaver/aidl/default/Weaver.cpp
@@ -15,30 +15,52 @@
*/
#include "Weaver.h"
+#include <array>
namespace aidl {
namespace android {
namespace hardware {
namespace weaver {
+struct Slotinfo {
+ int slot_id;
+ std::vector<uint8_t> key;
+ std::vector<uint8_t> value;
+};
+
+std::array<struct Slotinfo, 16> slot_array;
// Methods from ::android::hardware::weaver::IWeaver follow.
::ndk::ScopedAStatus Weaver::getConfig(WeaverConfig* out_config) {
- (void)out_config;
+ *out_config = {16, 16, 16};
return ::ndk::ScopedAStatus::ok();
}
::ndk::ScopedAStatus Weaver::read(int32_t in_slotId, const std::vector<uint8_t>& in_key, WeaverReadResponse* out_response) {
- (void)in_slotId;
- (void)in_key;
- (void)out_response;
+
+ if (in_slotId > 15 || in_key.size() > 16) {
+ *out_response = {0, {}};
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(Weaver::STATUS_FAILED));
+ }
+
+ if (slot_array[in_slotId].key != in_key) {
+ *out_response = {0, {}};
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(Weaver::STATUS_INCORRECT_KEY));
+ }
+
+ *out_response = {0, slot_array[in_slotId].value};
+
return ::ndk::ScopedAStatus::ok();
}
::ndk::ScopedAStatus Weaver::write(int32_t in_slotId, const std::vector<uint8_t>& in_key, const std::vector<uint8_t>& in_value) {
- (void)in_slotId;
- (void)in_key;
- (void)in_value;
+
+ if (in_slotId > 15 || in_key.size() > 16 || in_value.size() > 16)
+ return ::ndk::ScopedAStatus::fromStatus(STATUS_FAILED_TRANSACTION);
+
+ slot_array[in_slotId].key = in_key;
+ slot_array[in_slotId].value = in_value;
+
return ::ndk::ScopedAStatus::ok();
}
diff --git a/weaver/aidl/default/service.cpp b/weaver/aidl/default/service.cpp
index 1495bc9..2099ffd 100644
--- a/weaver/aidl/default/service.cpp
+++ b/weaver/aidl/default/service.cpp
@@ -28,7 +28,7 @@
const std::string instance = std::string() + Weaver::descriptor + "/default";
binder_status_t status = AServiceManager_addService(weaver->asBinder().get(), instance.c_str());
- CHECK(status == STATUS_OK);
+ CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return -1; // Should never be reached
diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IHostapdCallback.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IHostapdCallback.aidl
index 36d2104..9dd062a 100644
--- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IHostapdCallback.aidl
+++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IHostapdCallback.aidl
@@ -36,5 +36,5 @@
interface IHostapdCallback {
oneway void onApInstanceInfoChanged(in android.hardware.wifi.hostapd.ApInfo apInfo);
oneway void onConnectedClientsChanged(in android.hardware.wifi.hostapd.ClientInfo clientInfo);
- oneway void onFailure(in String ifaceName);
+ oneway void onFailure(in String ifaceName, in String instanceName);
}
diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IHostapdCallback.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IHostapdCallback.aidl
index 7b04944..456f46a 100644
--- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IHostapdCallback.aidl
+++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IHostapdCallback.aidl
@@ -41,7 +41,10 @@
* Invoked when an asynchronous failure is encountered in one of the access
* points added via |IHostapd.addAccessPoint|.
*
- * @param ifaceName Name of the interface.
+ * @param ifaceName Name of the interface which was added via
+ * |IHostapd.addAccessPoint|.
+ * @param instanceName Name of the AP instance which is associated with
+ * the interface.
*/
- oneway void onFailure(in String ifaceName);
+ oneway void onFailure(in String ifaceName, in String instanceName);
}
diff --git a/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp b/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp
index 41c54b3..dad7085 100644
--- a/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp
+++ b/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp
@@ -232,7 +232,7 @@
const ::aidl::android::hardware::wifi::hostapd::ClientInfo &) override {
return ndk::ScopedAStatus::ok();
}
- ::ndk::ScopedAStatus onFailure(const std::string &) override {
+ ::ndk::ScopedAStatus onFailure(const std::string&, const std::string&) override {
return ndk::ScopedAStatus::ok();
}
};
diff --git a/wifi/netlinkinterceptor/aidl/Android.bp b/wifi/netlinkinterceptor/aidl/Android.bp
new file mode 100644
index 0000000..924edee
--- /dev/null
+++ b/wifi/netlinkinterceptor/aidl/Android.bp
@@ -0,0 +1,36 @@
+//
+// Copyright (C) 2021 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 {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+aidl_interface {
+ name: "android.hardware.net.nlinterceptor",
+ vendor_available: true,
+ srcs: ["android/hardware/net/nlinterceptor/*.aidl"],
+ stability: "vintf",
+ backend: {
+ java: {
+ enabled: false,
+ },
+ },
+}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/wifi/netlinkinterceptor/aidl/aidl_api/NetlinkInterceptor/current/android/hardware/net/nlinterceptor/IInterceptor.aidl
similarity index 76%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
copy to wifi/netlinkinterceptor/aidl/aidl_api/NetlinkInterceptor/current/android/hardware/net/nlinterceptor/IInterceptor.aidl
index 41a1afe..249b343 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/wifi/netlinkinterceptor/aidl/aidl_api/NetlinkInterceptor/current/android/hardware/net/nlinterceptor/IInterceptor.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,10 +31,11 @@
// 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.graphics.composer3;
+package android.hardware.net.nlinterceptor;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+interface IInterceptor {
+ int createSocket(in int nlFamily, in int clientNlPid, in String clientName);
+ void closeSocket(in int nlFamily, in int interceptorNlPid);
+ void subscribeGroup(in int nlFamily, in int interceptorNlPid, in int nlGroup);
+ void unsubscribeGroup(in int nlFamily, in int interceptorNlPid, in int nlGroup);
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/current/android/hardware/net/nlinterceptor/IInterceptor.aidl
similarity index 72%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
copy to wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/current/android/hardware/net/nlinterceptor/IInterceptor.aidl
index 41a1afe..3d0f955 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/current/android/hardware/net/nlinterceptor/IInterceptor.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,10 +31,11 @@
// 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.graphics.composer3;
+package android.hardware.net.nlinterceptor;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+interface IInterceptor {
+ android.hardware.net.nlinterceptor.InterceptedSocket createSocket(in int nlFamily, in int clientNlPid, in String clientName);
+ void closeSocket(in android.hardware.net.nlinterceptor.InterceptedSocket handle);
+ void subscribeGroup(in android.hardware.net.nlinterceptor.InterceptedSocket handle, in int nlGroup);
+ void unsubscribeGroup(in android.hardware.net.nlinterceptor.InterceptedSocket handle, in int nlGroup);
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/current/android/hardware/net/nlinterceptor/InterceptedSocket.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/current/android/hardware/net/nlinterceptor/InterceptedSocket.aidl
index cfafc50..b679be5 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/netlinkinterceptor/aidl/aidl_api/android.hardware.net.nlinterceptor/current/android/hardware/net/nlinterceptor/InterceptedSocket.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,9 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.net.nlinterceptor;
+@VintfStability
+parcelable InterceptedSocket {
+ int nlFamily;
+ int portId;
}
diff --git a/wifi/netlinkinterceptor/aidl/android/hardware/net/nlinterceptor/IInterceptor.aidl b/wifi/netlinkinterceptor/aidl/android/hardware/net/nlinterceptor/IInterceptor.aidl
new file mode 100644
index 0000000..c222a1e
--- /dev/null
+++ b/wifi/netlinkinterceptor/aidl/android/hardware/net/nlinterceptor/IInterceptor.aidl
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2021 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.net.nlinterceptor;
+
+import android.hardware.net.nlinterceptor.InterceptedSocket;
+
+/**
+ * Netlink Interceptor
+ *
+ * This HAL provides a way for Android services to route their Netlink traffic to a location other
+ * than the Kernel. One might want to do this for a variety of reasons:
+ * -> Route Netlink traffic to a different host.
+ * -> Route Netlink traffic to a different VM.
+ * -> Convert Netlink commands into proprietary vendor hardware commands.
+ *
+ * Some important notes regarding Netlink Interceptor.
+ * -> All int values are treated as unsigned.
+ * -> Users of Netlink Interceptor must close their sockets with closeSocket manually.
+ * -> PID != process ID. In this case, it is "port ID", a unique number assigned by the kernel to a
+ * given Netlink socket.
+ * -> Netlink PIDs are only unique per family. This means that for all NETLINK_GENERIC sockets,
+ * there can only be one socket with PID "1234". HOWEVER, there can ALSO be a Netlink socket
+ * using NETLINK_ROUTE which has a PID of "1234". Hence, in order to uniquely identify a Netlink
+ * socket, both the PID and Netlink Family are required.
+ */
+@VintfStability
+interface IInterceptor {
+ /**
+ * Creates a Netlink socket on both the HU and TCU, and a bi-directional gRPC stream to carry
+ * data between them. This must be closed by the caller with closeSocket().
+ *
+ * @param nlFamily - Netlink Family. Support for families other than NETLINK_GENERIC is still
+ * experimental.
+ * @param clientNlPid - Port ID of the caller's Netlink socket.
+ * @param clientName - Human readable name of the caller. Used for debugging.
+ *
+ * @return InterceptedSocket identifying the socket on the HU allocated for the caller.
+ */
+ InterceptedSocket createSocket(in int nlFamily, in int clientNlPid, in String clientName);
+
+ /**
+ * Closes a socket and gRPC stream given the socket's identifier. This must be invoked manually
+ * by the caller of createSocket().
+ *
+ * @param handle - unique identifier for a socket returned by createSocket.
+ */
+ void closeSocket(in InterceptedSocket handle);
+
+ /**
+ * Subscribes a socket on the TCU to a Netlink multicast group.
+ *
+ * @param handle - unique identifier for a socket returned by createSocket.
+ * @param nlGroup - A single Netlink multicast group that the caller wants to subscribe to.
+ */
+ void subscribeGroup(in InterceptedSocket handle, in int nlGroup);
+
+ /**
+ * Unsubscribes a socket on the TCU from a Netlink multicast group.
+ *
+ * @param handle - unique identifier for a socket returned by createSocket.
+ * @param nlGroup - A single Netlink multicast group that the caller wants to unsubscribe from.
+ */
+ void unsubscribeGroup(in InterceptedSocket handle, in int nlGroup);
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/wifi/netlinkinterceptor/aidl/android/hardware/net/nlinterceptor/InterceptedSocket.aidl
similarity index 61%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to wifi/netlinkinterceptor/aidl/android/hardware/net/nlinterceptor/InterceptedSocket.aidl
index 0a93c9e..d74a556 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/wifi/netlinkinterceptor/aidl/android/hardware/net/nlinterceptor/InterceptedSocket.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -14,20 +14,20 @@
* limitations under the License.
*/
-package android.hardware.graphics.composer3;
+package android.hardware.net.nlinterceptor;
/**
- * Special index values (always negative) for command queue commands.
+ * Unique identifier for a Netlink socket.
*/
@VintfStability
-@Backing(type="int")
-enum HandleIndex {
+parcelable InterceptedSocket {
/**
- * No handle
+ * Netlink family of the identified socket
*/
- EMPTY = -1,
+ int nlFamily;
+
/**
- * Use cached handle
+ * Netlink port ID of the identified socket.
*/
- CACHED = -2,
+ int portId;
}
diff --git a/wifi/netlinkinterceptor/aidl/default/Android.bp b/wifi/netlinkinterceptor/aidl/default/Android.bp
new file mode 100644
index 0000000..5227e51
--- /dev/null
+++ b/wifi/netlinkinterceptor/aidl/default/Android.bp
@@ -0,0 +1,48 @@
+//
+// Copyright (C) 2021 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 {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_binary {
+ name: "android.hardware.net.nlinterceptor-service.default",
+ init_rc: ["nlinterceptor-default.rc"],
+ vintf_fragments: ["nlinterceptor-default.xml"],
+ vendor: true,
+ relative_install_path: "hw",
+ defaults: ["nlinterceptor@defaults"],
+ shared_libs: [
+ "android.hardware.net.nlinterceptor-V1-ndk",
+ "libbase",
+ "libbinder_ndk",
+ ],
+ static_libs: [
+ "libnlinterceptor",
+ "libnl++",
+ ],
+ srcs: [
+ "InterceptorRelay.cpp",
+ "NetlinkInterceptor.cpp",
+ "service.cpp",
+ "util.cpp",
+ ],
+}
diff --git a/wifi/netlinkinterceptor/aidl/default/InterceptorRelay.cpp b/wifi/netlinkinterceptor/aidl/default/InterceptorRelay.cpp
new file mode 100644
index 0000000..ded9122
--- /dev/null
+++ b/wifi/netlinkinterceptor/aidl/default/InterceptorRelay.cpp
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "InterceptorRelay.h"
+
+#include <android-base/logging.h>
+#include <libnl++/printer.h>
+#include <poll.h>
+
+#include <chrono>
+
+#include "util.h"
+
+namespace android::nlinterceptor {
+using namespace std::chrono_literals;
+
+static constexpr std::chrono::milliseconds kPollTimeout = 300ms;
+static constexpr bool kSuperVerbose = true;
+
+InterceptorRelay::InterceptorRelay(uint32_t nlFamily, uint32_t clientNlPid,
+ const std::string& clientName)
+ : mClientName(clientName),
+ mNlSocket(std::make_optional<nl::Socket>(nlFamily, 0, 0)),
+ mClientNlPid(clientNlPid) {}
+
+InterceptorRelay::~InterceptorRelay() {
+ mRunning = false;
+ if (mRelayThread.joinable()) mRelayThread.join();
+}
+
+uint32_t InterceptorRelay::getPid() {
+ auto pidMaybe = mNlSocket->getPid();
+ CHECK(pidMaybe.has_value()) << "Failed to get pid of nl::Socket!";
+ return *pidMaybe;
+}
+
+void InterceptorRelay::relayMessages() {
+ pollfd fds[] = {
+ mNlSocket->preparePoll(POLLIN),
+ };
+ while (mRunning) {
+ if (poll(fds, countof(fds), kPollTimeout.count()) < 0) {
+ PLOG(FATAL) << "poll failed";
+ return;
+ }
+ const auto nlsockEvents = fds[0].revents;
+
+ if (isSocketBad(nlsockEvents)) {
+ LOG(ERROR) << "Netlink socket is bad";
+ mRunning = false;
+ return;
+ }
+ if (!isSocketReadable(nlsockEvents)) continue;
+
+ const auto [msgMaybe, sa] = mNlSocket->receiveFrom();
+ if (!msgMaybe.has_value()) {
+ LOG(ERROR) << "Failed to receive Netlink data!";
+ mRunning = false;
+ return;
+ }
+ const auto msg = *msgMaybe;
+ if (!msg.firstOk()) {
+ LOG(ERROR) << "Netlink packet is malformed!";
+ // Test messages might be empty, this isn't fatal.
+ continue;
+ }
+ if constexpr (kSuperVerbose) {
+ LOG(VERBOSE) << "[" << mClientName
+ << "] nlMsg: " << nl::toString(msg, NETLINK_GENERIC);
+ }
+
+ uint32_t destinationPid = 0;
+ if (sa.nl_pid == 0) {
+ destinationPid = mClientNlPid;
+ }
+
+ if (!mNlSocket->send(msg, destinationPid)) {
+ LOG(ERROR) << "Failed to send Netlink message!";
+ mRunning = false;
+ return;
+ }
+ }
+ LOG(VERBOSE) << "[" << mClientName << "] Exiting relay thread!";
+}
+
+bool InterceptorRelay::start() {
+ if (mRunning) {
+ LOG(ERROR)
+ << "Can't relay messages: InterceptorRelay is already running!";
+ return false;
+ }
+ if (mRelayThread.joinable()) {
+ LOG(ERROR) << "relay thread is already running!";
+ return false;
+ }
+ if (!mNlSocket.has_value()) {
+ LOG(ERROR) << "Netlink socket not initialized!";
+ return false;
+ }
+
+ mRunning = true;
+ mRelayThread = std::thread(&InterceptorRelay::relayMessages, this);
+
+ LOG(VERBOSE) << "Relay threads initialized";
+ return true;
+}
+
+bool InterceptorRelay::subscribeGroup(uint32_t nlGroup) {
+ return mNlSocket->addMembership(nlGroup);
+}
+
+bool InterceptorRelay::unsubscribeGroup(uint32_t nlGroup) {
+ return mNlSocket->dropMembership(nlGroup);
+}
+
+} // namespace android::nlinterceptor
diff --git a/wifi/netlinkinterceptor/aidl/default/InterceptorRelay.h b/wifi/netlinkinterceptor/aidl/default/InterceptorRelay.h
new file mode 100644
index 0000000..0178c90
--- /dev/null
+++ b/wifi/netlinkinterceptor/aidl/default/InterceptorRelay.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#pragma once
+
+#include <libnl++/Socket.h>
+
+#include <mutex>
+#include <thread>
+
+namespace android::nlinterceptor {
+
+class InterceptorRelay {
+ public:
+ /**
+ * Wrapper around the netlink socket and thread which relays messages.
+ *
+ * \param nlFamily - netlink family to use for the netlink socket.
+ * \param clientNlPid - pid of the client netlink socket.
+ * \param clientName - name of the client to be used for debugging.
+ */
+ InterceptorRelay(uint32_t nlFamily, uint32_t clientNlPid,
+ const std::string& clientName);
+
+ /**
+ * Stops the relay thread if running and destroys itself.
+ */
+ ~InterceptorRelay();
+
+ /**
+ * Returns the PID of the internal Netlink socket.
+ *
+ * \return value of PID,
+ */
+ uint32_t getPid();
+
+ /**
+ * Spawns relay thread.
+ */
+ bool start();
+
+ /**
+ * Subscribes the internal socket to a single Netlink multicast group.
+ *
+ * \param nlGroup - Netlink group to subscribe to.
+ * \returns - true for success, false for failure.
+ */
+ bool subscribeGroup(uint32_t nlGroup);
+
+ /**
+ * Unsubscribes the internal socket from a single Netlink multicast group.
+ *
+ * \param nlGroup - Netlink group to unsubscribe from.
+ * \returns - true for success, false for failure.
+ */
+ bool unsubscribeGroup(uint32_t nlGroup);
+
+ private:
+ std::string mClientName; ///< Name of client (Wificond, for example).
+ std::optional<nl::Socket> mNlSocket;
+ const uint32_t mClientNlPid = 0; ///< pid of client NL socket.
+
+ /**
+ * If set to true, the relay thread should be running. Setting this to false
+ * stops the relay thread.
+ */
+ std::atomic_bool mRunning = false;
+
+ /**
+ * Reads incoming Netlink messages destined for mNlSocket. If from the
+ * kernel, the message is relayed to the client specified in the
+ * constructor. Otherwise, the message is relayed to the kernel. This will
+ * run as long as mRunning is set to true.
+ */
+ void relayMessages();
+
+ std::thread mRelayThread;
+};
+
+} // namespace android::nlinterceptor
diff --git a/wifi/netlinkinterceptor/aidl/default/NetlinkInterceptor.cpp b/wifi/netlinkinterceptor/aidl/default/NetlinkInterceptor.cpp
new file mode 100644
index 0000000..908ecf2
--- /dev/null
+++ b/wifi/netlinkinterceptor/aidl/default/NetlinkInterceptor.cpp
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "NetlinkInterceptor.h"
+
+#include <android-base/logging.h>
+#include <libnl++/Socket.h>
+
+namespace android::nlinterceptor {
+
+ndk::ScopedAStatus NetlinkInterceptor::createSocket(
+ int32_t nlFamilyAidl, int32_t clientNlPidAidl,
+ const std::string& clientName, AidlInterceptedSocket* interceptedSocket) {
+ auto nlFamily = static_cast<uint32_t>(nlFamilyAidl);
+ auto clientNlPid = static_cast<uint32_t>(clientNlPidAidl);
+ uint32_t interceptorNlPid = 0;
+
+ std::unique_ptr<InterceptorRelay> interceptor =
+ std::make_unique<InterceptorRelay>(nlFamily, clientNlPid, clientName);
+
+ interceptorNlPid = interceptor->getPid();
+
+ if (interceptorNlPid == 0) {
+ LOG(ERROR) << "Failed to create a Netlink socket for " << clientName
+ << ", " << nlFamily << ":" << clientNlPid;
+ return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR));
+ }
+
+ if (mClientMap.find({nlFamily, interceptorNlPid}) != mClientMap.end()) {
+ LOG(ERROR) << "A socket with pid " << interceptorNlPid
+ << " already exists!";
+ return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR));
+ }
+
+ if (!interceptor->start()) {
+ LOG(ERROR) << "Failed to start interceptor thread!";
+ return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR));
+ }
+
+ if (!mClientMap
+ .emplace(InterceptedSocket(nlFamily, interceptorNlPid),
+ std::move(interceptor))
+ .second) {
+ // If this happens, it is very bad.
+ LOG(FATAL) << "Failed to insert interceptor instance with pid "
+ << interceptorNlPid << " into map!";
+ return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR));
+ }
+
+ interceptedSocket->nlFamily = nlFamily;
+ interceptedSocket->portId = interceptorNlPid;
+
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus NetlinkInterceptor::closeSocket(
+ const AidlInterceptedSocket& interceptedSocket) {
+ InterceptedSocket sock(interceptedSocket);
+
+ auto interceptorIt = mClientMap.find(sock);
+ if (interceptorIt == mClientMap.end()) {
+ LOG(ERROR) << "closeSocket Failed! No such socket " << sock;
+ return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR));
+ }
+ mClientMap.erase(interceptorIt);
+
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus NetlinkInterceptor::subscribeGroup(
+ const AidlInterceptedSocket& interceptedSocket, int32_t nlGroupAidl) {
+ InterceptedSocket sock(interceptedSocket);
+ auto nlGroup = static_cast<uint32_t>(nlGroupAidl);
+
+ auto interceptorIt = mClientMap.find(sock);
+ if (interceptorIt == mClientMap.end()) {
+ LOG(ERROR) << "subscribeGroup failed! No such socket " << sock;
+ return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR));
+ }
+
+ auto& interceptor = interceptorIt->second;
+ if (!interceptor->subscribeGroup(nlGroup)) {
+ LOG(ERROR) << "Failed to subscribe " << sock << " to " << nlGroup;
+ return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR));
+ }
+
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus NetlinkInterceptor::unsubscribeGroup(
+ const AidlInterceptedSocket& interceptedSocket, int32_t nlGroupAidl) {
+ InterceptedSocket sock(interceptedSocket);
+ auto nlGroup = static_cast<uint32_t>(nlGroupAidl);
+
+ auto interceptorIt = mClientMap.find(sock);
+ if (interceptorIt == mClientMap.end()) {
+ LOG(ERROR) << "unsubscribeGroup failed! No such socket " << sock;
+ return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR));
+ }
+
+ auto& interceptor = interceptorIt->second;
+ if (!interceptor->unsubscribeGroup(nlGroup)) {
+ LOG(ERROR) << "Failed to unsubscribe " << sock << " from " << nlGroup;
+ return ndk::ScopedAStatus(AStatus_fromStatus(::android::UNKNOWN_ERROR));
+ }
+ return ndk::ScopedAStatus::ok();
+}
+} // namespace android::nlinterceptor
diff --git a/wifi/netlinkinterceptor/aidl/default/NetlinkInterceptor.h b/wifi/netlinkinterceptor/aidl/default/NetlinkInterceptor.h
new file mode 100644
index 0000000..8345654
--- /dev/null
+++ b/wifi/netlinkinterceptor/aidl/default/NetlinkInterceptor.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/net/nlinterceptor/BnInterceptor.h>
+#include <libnlinterceptor/libnlinterceptor.h>
+
+#include <map>
+
+#include "InterceptorRelay.h"
+
+namespace android::nlinterceptor {
+
+class NetlinkInterceptor
+ : public ::aidl::android::hardware::net::nlinterceptor::BnInterceptor {
+ using ClientMap =
+ std::map<::android::nlinterceptor::InterceptedSocket,
+ std::unique_ptr<::android::nlinterceptor::InterceptorRelay>>;
+
+ using AidlInterceptedSocket =
+ ::aidl::android::hardware::net::nlinterceptor::InterceptedSocket;
+
+ public:
+ ndk::ScopedAStatus createSocket(
+ int32_t nlFamily, int32_t clientNlPid, const std::string& clientName,
+ AidlInterceptedSocket* interceptedSocket) override;
+
+ ndk::ScopedAStatus closeSocket(
+ const AidlInterceptedSocket& interceptedSocket) override;
+
+ ndk::ScopedAStatus subscribeGroup(
+ const AidlInterceptedSocket& interceptedSocket,
+ int32_t nlGroup) override;
+
+ ndk::ScopedAStatus unsubscribeGroup(
+ const AidlInterceptedSocket& interceptedSocket,
+ int32_t nlGroup) override;
+
+ private:
+ ClientMap mClientMap;
+};
+
+} // namespace android::nlinterceptor
diff --git a/wifi/netlinkinterceptor/aidl/default/OWNERS b/wifi/netlinkinterceptor/aidl/default/OWNERS
new file mode 100644
index 0000000..b738dac
--- /dev/null
+++ b/wifi/netlinkinterceptor/aidl/default/OWNERS
@@ -0,0 +1,2 @@
+chrisweir@google.com
+twasilczyk@google.com
diff --git a/wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.rc b/wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.rc
new file mode 100644
index 0000000..353cb27
--- /dev/null
+++ b/wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.rc
@@ -0,0 +1,4 @@
+service nlinterceptor /vendor/bin/hw/android.hardware.net.nlinterceptor-service.default
+ class hal
+ user root
+ group system inet
diff --git a/wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.xml b/wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.xml
new file mode 100644
index 0000000..d7d257e
--- /dev/null
+++ b/wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.xml
@@ -0,0 +1,9 @@
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.net.nlinterceptor</name>
+ <interface>
+ <name>IInterceptor</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+</manifest>
diff --git a/wifi/netlinkinterceptor/aidl/default/service.cpp b/wifi/netlinkinterceptor/aidl/default/service.cpp
new file mode 100644
index 0000000..2aec3a5
--- /dev/null
+++ b/wifi/netlinkinterceptor/aidl/default/service.cpp
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+
+#include "NetlinkInterceptor.h"
+
+namespace android::nlinterceptor {
+using namespace std::string_literals;
+
+static void service() {
+ base::SetDefaultTag("nlinterceptor");
+ base::SetMinimumLogSeverity(base::VERBOSE);
+ LOG(DEBUG) << "Netlink Interceptor service starting...";
+
+ // TODO(202549296): Sometimes this causes an Address Sanitizer error.
+ auto interceptor = ndk::SharedRefBase::make<NetlinkInterceptor>();
+ const auto instance = NetlinkInterceptor::descriptor + "/default"s;
+ const auto status = AServiceManager_addService(
+ interceptor->asBinder().get(), instance.c_str());
+ CHECK(status == STATUS_OK);
+
+ ABinderProcess_joinThreadPool();
+ LOG(FATAL) << "Netlink Interceptor has stopped";
+}
+
+} // namespace android::nlinterceptor
+
+int main() {
+ ::android::nlinterceptor::service();
+ return 0;
+}
diff --git a/wifi/netlinkinterceptor/aidl/default/util.cpp b/wifi/netlinkinterceptor/aidl/default/util.cpp
new file mode 100644
index 0000000..c734747
--- /dev/null
+++ b/wifi/netlinkinterceptor/aidl/default/util.cpp
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "util.h"
+
+#include <poll.h>
+
+namespace android::nlinterceptor {
+
+bool isSocketReadable(const short revents) { return 0 != (revents & POLLIN); }
+
+bool isSocketBad(const short revents) {
+ return 0 != (revents & (POLLERR | POLLHUP | POLLNVAL));
+}
+
+} // namespace android::nlinterceptor
diff --git a/wifi/netlinkinterceptor/aidl/default/util.h b/wifi/netlinkinterceptor/aidl/default/util.h
new file mode 100644
index 0000000..9b8ec63
--- /dev/null
+++ b/wifi/netlinkinterceptor/aidl/default/util.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#pragma once
+
+#include <android-base/macros.h>
+
+#include <functional>
+
+namespace android::nlinterceptor {
+
+/**
+ * Handy-dandy helper to get the size of a statically initialized array.
+ *
+ * \param N the array to get the size of.
+ * \return the size of the array.
+ */
+template <typename T, size_t N>
+size_t countof(T (&)[N]) {
+ return N;
+}
+
+/**
+ * Helper to check if socket is readable (POLLIN is set).
+ *
+ * \param revents pollfd.revents value to check.
+ * \return true if socket is ready to read.
+ */
+bool isSocketReadable(short revents);
+
+/**
+ * Helper to check if socket is bad (POLLERR, POLLHUP or POLLNVAL is set).
+ *
+ * \param revents pollfd.revents value to check.
+ * \return true if socket is bad.
+ */
+bool isSocketBad(short revents);
+
+} // namespace android::nlinterceptor
diff --git a/wifi/netlinkinterceptor/libnlinterceptor/Android.bp b/wifi/netlinkinterceptor/libnlinterceptor/Android.bp
new file mode 100644
index 0000000..00cae32
--- /dev/null
+++ b/wifi/netlinkinterceptor/libnlinterceptor/Android.bp
@@ -0,0 +1,65 @@
+//
+// Copyright (C) 2021 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 {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_defaults {
+ name: "nlinterceptor@defaults",
+ cpp_std: "experimental",
+ cflags: [
+ "-Wall",
+ "-Wextra",
+ "-Wsuggest-override",
+ "-Werror",
+ ],
+ shared_libs: [
+ "libbase",
+ "libutils",
+ ],
+ sanitize: {
+ address: true,
+ undefined: true,
+ all_undefined: true,
+ fuzzer: true,
+ cfi: true,
+ integer_overflow: true,
+ scs: true,
+ },
+ strip: {
+ keep_symbols_and_debug_frame: true,
+ },
+}
+
+cc_library_static {
+ name: "libnlinterceptor",
+ defaults: ["nlinterceptor@defaults"],
+ vendor_available: true,
+ shared_libs: [
+ "android.hardware.net.nlinterceptor-V1-ndk",
+ "libbinder_ndk",
+ ],
+ srcs: [
+ "libnlinterceptor.cpp",
+ ],
+ export_include_dirs: ["include"],
+}
diff --git a/wifi/netlinkinterceptor/libnlinterceptor/include/libnlinterceptor/libnlinterceptor.h b/wifi/netlinkinterceptor/libnlinterceptor/include/libnlinterceptor/libnlinterceptor.h
new file mode 100644
index 0000000..ac8653e
--- /dev/null
+++ b/wifi/netlinkinterceptor/libnlinterceptor/include/libnlinterceptor/libnlinterceptor.h
@@ -0,0 +1,131 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#pragma once
+
+#ifdef __cplusplus
+
+#include <aidl/android/hardware/net/nlinterceptor/InterceptedSocket.h>
+#include <android-base/unique_fd.h>
+#include <linux/netlink.h>
+
+#include <optional>
+#include <string>
+
+namespace android::nlinterceptor {
+
+/**
+ * Wrapper structure to uniquely identifies a socket that Netlink Interceptor
+ * has allocated for us.
+ */
+struct InterceptedSocket {
+ uint32_t nlFamily;
+ uint32_t portId;
+
+ InterceptedSocket(
+ ::aidl::android::hardware::net::nlinterceptor::InterceptedSocket sock);
+ InterceptedSocket(uint32_t nlFamily, uint32_t portId);
+
+ bool operator<(const InterceptedSocket& other) const;
+ operator sockaddr_nl() const;
+ operator ::aidl::android::hardware::net::nlinterceptor::InterceptedSocket()
+ const;
+};
+
+/**
+ * Output stream operator for InterceptedSocket
+ */
+std::ostream& operator<<(std::ostream& os, const InterceptedSocket& sock);
+
+/**
+ * Checks if an instance Netlink Interceptor exists.
+ *
+ * \return true if supported, false if not.
+ */
+bool isEnabled();
+
+/**
+ * Asks Netlink Interceptor to allocate a socket to which we can send Netlink
+ * traffic.
+ *
+ * \param clientSocket - File descriptor for the client's Netlink socket.
+ * \param clientName - Human readable name of the client application.
+ * \return Identifier for the socket created by Netlink Interceptor, nullopt on
+ * error.
+ */
+std::optional<InterceptedSocket> createSocket(base::borrowed_fd clientSocket,
+ const std::string& clientName);
+
+/**
+ * Asks Netlink Interceptor to close a socket that it created for us previously,
+ * if it exists.
+ *
+ * \param sock - Identifier for the socket created by Netlink Interceptor.
+ */
+void closeSocket(const InterceptedSocket& sock);
+
+/**
+ * Asks Netlink Interceptor to subscribe a socket that it created for us
+ * previously to a specified multicast group.
+ *
+ * \param sock - Identifier for the socket created by Netlink Interceptor.
+ * \param group - A single Netlink multicast group for which we would like to
+ * receive events.
+ * \return true for success, false if something went wrong.
+ */
+bool subscribe(const InterceptedSocket& sock, uint32_t group);
+
+/**
+ * Asks Netlink Interceptor to unsubscribe a socket that it created for us
+ * previously from a specified multicast group.
+ *
+ * \param sock - Identifier for the socket created by Netlink Interceptor.
+ * \param group - A single Netlink multicast group for which we no longer wish
+ * to receive events.
+ * \return true for success, false if something went wrong.
+ */
+bool unsubscribe(const InterceptedSocket& sock, uint32_t group);
+} // namespace android::nlinterceptor
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// C wrappers for libnlinterceptor
+struct android_nlinterceptor_InterceptedSocket {
+ uint32_t nlFamily;
+ uint32_t portId;
+};
+
+bool android_nlinterceptor_isEnabled();
+
+bool android_nlinterceptor_createSocket(
+ int clientSocketFd, const char* clientName,
+ struct android_nlinterceptor_InterceptedSocket* interceptedSocket);
+
+void android_nlinterceptor_closeSocket(
+ const struct android_nlinterceptor_InterceptedSocket* sock);
+
+bool android_nlinterceptor_subscribe(
+ const struct android_nlinterceptor_InterceptedSocket* sock, uint32_t group);
+
+bool android_nlinterceptor_unsubscribe(
+ const struct android_nlinterceptor_InterceptedSocket* sock, uint32_t group);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/wifi/netlinkinterceptor/libnlinterceptor/libnlinterceptor.cpp b/wifi/netlinkinterceptor/libnlinterceptor/libnlinterceptor.cpp
new file mode 100644
index 0000000..575f900
--- /dev/null
+++ b/wifi/netlinkinterceptor/libnlinterceptor/libnlinterceptor.cpp
@@ -0,0 +1,174 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/android/hardware/net/nlinterceptor/IInterceptor.h>
+#include <android-base/logging.h>
+#include <android-base/macros.h>
+#include <android/binder_manager.h>
+#include <libnlinterceptor/libnlinterceptor.h>
+#include <linux/netlink.h>
+
+#include <mutex>
+
+namespace android::nlinterceptor {
+using namespace std::string_literals;
+using namespace ::aidl::android::hardware::net::nlinterceptor;
+using base::borrowed_fd;
+using AidlInterceptedSocket =
+ ::aidl::android::hardware::net::nlinterceptor::InterceptedSocket;
+
+static const auto kServiceName = IInterceptor::descriptor + "/default"s;
+
+InterceptedSocket::InterceptedSocket(
+ ::aidl::android::hardware::net::nlinterceptor::InterceptedSocket sock)
+ : nlFamily(sock.nlFamily), portId(sock.portId) {}
+
+InterceptedSocket::InterceptedSocket(uint32_t nlFamily, uint32_t portId)
+ : nlFamily(nlFamily), portId(portId) {}
+
+std::ostream& operator<<(std::ostream& os, const InterceptedSocket& sock) {
+ return os << "family: " << sock.nlFamily << ", portId: " << sock.portId;
+}
+
+bool InterceptedSocket::operator<(const InterceptedSocket& other) const {
+ if (nlFamily != other.nlFamily) {
+ return nlFamily < other.nlFamily;
+ }
+ return portId < other.portId;
+}
+
+InterceptedSocket::operator sockaddr_nl() const {
+ return {
+ .nl_family = AF_NETLINK,
+ .nl_pad = 0,
+ .nl_pid = portId,
+ .nl_groups = 0,
+ };
+}
+
+InterceptedSocket::operator AidlInterceptedSocket() const {
+ return {
+ .nlFamily = static_cast<int32_t>(nlFamily),
+ .portId = static_cast<int32_t>(portId),
+ };
+}
+
+bool isEnabled() {
+ static std::mutex supportedMutex;
+ static std::optional<bool> interceptorSupported;
+ // Avoid querying service manager when we can cache the result.
+ if (interceptorSupported.has_value()) return *interceptorSupported;
+ std::lock_guard lock(supportedMutex);
+ if (interceptorSupported.has_value()) return *interceptorSupported;
+
+ if (!AServiceManager_isDeclared(kServiceName.c_str())) {
+ interceptorSupported = false;
+ return false;
+ }
+ interceptorSupported = true;
+ return true;
+}
+
+static IInterceptor& getInstance() {
+ static std::mutex instanceMutex;
+ static std::shared_ptr<IInterceptor> interceptorInstance;
+ CHECK(isEnabled()) << "Can't getInstance! Interceptor not supported!";
+ // Don't overwrite the pointer once we've acquired it.
+ if (interceptorInstance != nullptr) return *interceptorInstance;
+ std::lock_guard lock(instanceMutex);
+ if (interceptorInstance != nullptr) return *interceptorInstance;
+ interceptorInstance = IInterceptor::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(kServiceName.c_str())));
+ CHECK(interceptorInstance != nullptr)
+ << "Failed to get Netlink Interceptor service!";
+ return *interceptorInstance;
+}
+
+std::optional<InterceptedSocket> createSocket(borrowed_fd clientSocket,
+ const std::string& clientName) {
+ sockaddr_nl nladdr = {};
+ socklen_t nlsize = sizeof(nladdr);
+ if (getsockname(clientSocket.get(), reinterpret_cast<sockaddr*>(&nladdr),
+ &nlsize) < 0) {
+ PLOG(ERROR) << "Failed to get pid of fd passed by " << clientName;
+ return std::nullopt;
+ }
+
+ ::aidl::android::hardware::net::nlinterceptor::InterceptedSocket
+ interceptedSocket;
+ auto aidlStatus = getInstance().createSocket(
+ nladdr.nl_family, nladdr.nl_pid, clientName, &interceptedSocket);
+ if (!aidlStatus.isOk()) {
+ return std::nullopt;
+ }
+
+ return InterceptedSocket{nladdr.nl_family,
+ uint32_t(interceptedSocket.portId)};
+}
+
+void closeSocket(const InterceptedSocket& sock) {
+ auto aidlStatus = getInstance().closeSocket(sock);
+ if (!aidlStatus.isOk()) {
+ LOG(ERROR) << "Failed to close socket with pid = " << sock.portId;
+ }
+}
+
+bool subscribe(const InterceptedSocket& sock, uint32_t group) {
+ auto aidlStatus = getInstance().subscribeGroup(sock, group);
+ return aidlStatus.isOk();
+}
+
+bool unsubscribe(const InterceptedSocket& sock, uint32_t group) {
+ auto aidlStatus = getInstance().unsubscribeGroup(sock, group);
+ return aidlStatus.isOk();
+}
+
+extern "C" bool android_nlinterceptor_isEnabled() { return isEnabled(); }
+
+extern "C" bool android_nlinterceptor_createSocket(
+ int clientSocketFd, const char* clientName,
+ android_nlinterceptor_InterceptedSocket* interceptedSocket) {
+ if (!clientName || clientSocketFd <= 0) return false;
+ const auto maybeSocket =
+ createSocket(borrowed_fd(clientSocketFd), clientName);
+ if (!maybeSocket) return false;
+ *interceptedSocket = {.nlFamily = maybeSocket->nlFamily,
+ .portId = maybeSocket->portId};
+ return true;
+}
+
+extern "C" void android_nlinterceptor_closeSocket(
+ const android_nlinterceptor_InterceptedSocket* sock) {
+ if (!sock) {
+ LOG(ERROR) << "Can't close socket identified by a null pointer!";
+ return;
+ }
+ closeSocket({sock->nlFamily, sock->portId});
+}
+
+extern "C" bool android_nlinterceptor_subscribe(
+ const android_nlinterceptor_InterceptedSocket* sock, uint32_t group) {
+ if (!sock) return false;
+ return subscribe({sock->nlFamily, sock->portId}, group);
+}
+
+extern "C" bool android_nlinterceptor_unsubscribe(
+ const android_nlinterceptor_InterceptedSocket* sock, uint32_t group) {
+ if (!sock) return false;
+ return unsubscribe({sock->nlFamily, sock->portId}, group);
+}
+
+} // namespace android::nlinterceptor
diff --git a/wifi/netlinkinterceptor/vts/OWNERS b/wifi/netlinkinterceptor/vts/OWNERS
new file mode 100644
index 0000000..b738dac
--- /dev/null
+++ b/wifi/netlinkinterceptor/vts/OWNERS
@@ -0,0 +1,2 @@
+chrisweir@google.com
+twasilczyk@google.com
diff --git a/wifi/netlinkinterceptor/vts/functional/Android.bp b/wifi/netlinkinterceptor/vts/functional/Android.bp
new file mode 100644
index 0000000..33284e8
--- /dev/null
+++ b/wifi/netlinkinterceptor/vts/functional/Android.bp
@@ -0,0 +1,51 @@
+//
+// Copyright (C) 2021 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 {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_test {
+ name: "VtsHalNetlinkInterceptorV1_0Test",
+ defaults: [
+ "VtsHalTargetTestDefaults",
+ "use_libaidlvintf_gtest_helper_static",
+ ],
+ cpp_std: "experimental",
+ srcs: [
+ "interceptor_aidl_test.cpp",
+ ],
+ shared_libs: [
+ "android.hardware.net.nlinterceptor-V1-ndk",
+ "libbase",
+ "libbinder_ndk",
+ ],
+ static_libs: [
+ "libgmock",
+ "android.hardware.automotive.can@libnetdevice",
+ "libnl++",
+ ],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
+ disable_framework: true,
+}
diff --git a/wifi/netlinkinterceptor/vts/functional/interceptor_aidl_test.cpp b/wifi/netlinkinterceptor/vts/functional/interceptor_aidl_test.cpp
new file mode 100644
index 0000000..b26d8ec
--- /dev/null
+++ b/wifi/netlinkinterceptor/vts/functional/interceptor_aidl_test.cpp
@@ -0,0 +1,195 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/net/nlinterceptor/IInterceptor.h>
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <gtest/gtest.h>
+#include <libnetdevice/libnetdevice.h>
+#include <libnl++/MessageFactory.h>
+#include <libnl++/Socket.h>
+#include <libnl++/printer.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+
+#include <chrono>
+#include <thread>
+
+using aidl::android::hardware::net::nlinterceptor::IInterceptor;
+using AidlInterceptedSocket =
+ ::aidl::android::hardware::net::nlinterceptor::InterceptedSocket;
+using namespace std::chrono_literals;
+using namespace std::string_literals;
+
+class InterceptorAidlTest : public ::testing::TestWithParam<std::string> {
+ public:
+ virtual void SetUp() override {
+ android::base::SetDefaultTag("InterceptorAidlTest");
+ android::base::SetMinimumLogSeverity(android::base::VERBOSE);
+ const auto instance = IInterceptor::descriptor + "/default"s;
+ mNlInterceptorService = IInterceptor::fromBinder(
+ ndk::SpAIBinder(AServiceManager_getService(instance.c_str())));
+
+ ASSERT_NE(mNlInterceptorService, nullptr);
+ mSocket = std::make_unique<android::nl::Socket>(NETLINK_ROUTE);
+ ASSERT_TRUE(mSocket->getPid().has_value());
+
+ // If the test broke last run, clean up our mess, don't worry about "no
+ // such device".
+ if (android::netdevice::del(mTestIfaceName)) {
+ LOG(WARNING) << "Test interface wasn't cleaned up on previous run!";
+ }
+ }
+
+ void multicastReceiver();
+
+ std::shared_ptr<IInterceptor> mNlInterceptorService;
+ std::unique_ptr<android::nl::Socket> mSocket;
+ bool mRunning;
+ bool mGotMulticast;
+ const std::string mTestIfaceName = "interceptorvts0";
+};
+
+TEST_P(InterceptorAidlTest, createSocketTest) {
+ // Ask IInterceptor for a socket.
+ AidlInterceptedSocket interceptedSocket;
+ auto aidlStatus = mNlInterceptorService->createSocket(
+ NETLINK_ROUTE, *(mSocket->getPid()), "createSocketTest",
+ &interceptedSocket);
+ ASSERT_TRUE(aidlStatus.isOk());
+ ASSERT_NE(interceptedSocket.portId, 0);
+ uint32_t interceptorPid = interceptedSocket.portId;
+
+ // Ask the kernel to tell us what interfaces are available.
+ android::nl::MessageFactory<rtgenmsg> req(RTM_GETLINK,
+ NLM_F_REQUEST | NLM_F_DUMP);
+ req->rtgen_family = AF_PACKET;
+ sockaddr_nl sa = {.nl_family = AF_NETLINK,
+ .nl_pad = 0,
+ .nl_pid = interceptorPid,
+ .nl_groups = 0};
+ EXPECT_TRUE(mSocket->send(req, sa));
+
+ // We'll likely get back several messages, as indicated by the MULTI flag.
+ unsigned received = 0;
+ for (const auto msg : *mSocket) {
+ ASSERT_NE(msg->nlmsg_type, NLMSG_ERROR);
+ ++received;
+ break;
+ if (msg->nlmsg_type == NLMSG_DONE) {
+ // TODO(202548749): NLMSG_DONE on NETLINK_ROUTE doesn't work?
+ break;
+ }
+ }
+ ASSERT_GE(received, 1);
+
+ // Close the socket and make sure it's stopped working.
+ aidlStatus = mNlInterceptorService->closeSocket(interceptedSocket);
+ EXPECT_TRUE(aidlStatus.isOk());
+ EXPECT_FALSE(mSocket->send(req, sa));
+}
+
+static bool isSocketReadable(const short revents) {
+ return 0 != (revents & POLLIN);
+}
+
+static bool isSocketBad(const short revents) {
+ return 0 != (revents & (POLLERR | POLLHUP | POLLNVAL));
+}
+
+void InterceptorAidlTest::multicastReceiver() {
+ pollfd fds[] = {
+ mSocket->preparePoll(POLLIN),
+ };
+ while (mRunning) {
+ if (poll(fds, 1, 300) < 0) {
+ PLOG(FATAL) << "poll failed";
+ return;
+ }
+ const auto nlsockEvents = fds[0].revents;
+ ASSERT_FALSE(isSocketBad(nlsockEvents));
+ if (!isSocketReadable(nlsockEvents)) continue;
+
+ const auto [msgMaybe, sa] = mSocket->receiveFrom();
+ ASSERT_TRUE(msgMaybe.has_value());
+ auto msg = *msgMaybe;
+
+ // Multicast messages have 0 for their pid and sequence number.
+ if (msg->nlmsg_pid == 0 && msg->nlmsg_seq == 0) {
+ mGotMulticast = true;
+ }
+ }
+}
+
+TEST_P(InterceptorAidlTest, subscribeGroupTest) {
+ // Ask IInterceptor for a socket.
+ AidlInterceptedSocket interceptedSocket;
+ auto aidlStatus = mNlInterceptorService->createSocket(
+ NETLINK_ROUTE, *(mSocket->getPid()), "subscribeGroupTest",
+ &interceptedSocket);
+ ASSERT_TRUE(aidlStatus.isOk());
+ ASSERT_TRUE(interceptedSocket.portId != 0);
+
+ // Listen for interface up/down events.
+ aidlStatus =
+ mNlInterceptorService->subscribeGroup(interceptedSocket, RTNLGRP_LINK);
+ ASSERT_TRUE(aidlStatus.isOk());
+
+ // Start a thread to receive a multicast
+ mRunning = true;
+ mGotMulticast = false;
+ std::thread successfulReceiver(&InterceptorAidlTest::multicastReceiver,
+ this);
+
+ // TODO(201695162): use futures with wait_for instead of a sleep_for().
+ std::this_thread::sleep_for(50ms);
+ // create a network interface and bring it up to trigger a multicast event.
+ ASSERT_TRUE(android::netdevice::add(mTestIfaceName, /*type=*/"dummy"));
+ ASSERT_TRUE(android::netdevice::up(mTestIfaceName));
+ std::this_thread::sleep_for(50ms);
+ EXPECT_TRUE(mGotMulticast);
+ mRunning = false;
+ successfulReceiver.join();
+
+ // Stop listening to interface up/down events.
+ aidlStatus = mNlInterceptorService->unsubscribeGroup(interceptedSocket,
+ RTNLGRP_LINK);
+ ASSERT_TRUE(aidlStatus.isOk());
+
+ // This time, we should hear nothing.
+ mGotMulticast = false;
+ mRunning = true;
+ std::thread unsuccessfulReceiver(&InterceptorAidlTest::multicastReceiver,
+ this);
+ std::this_thread::sleep_for(50ms);
+ ASSERT_TRUE(android::netdevice::down(mTestIfaceName));
+ ASSERT_TRUE(android::netdevice::del(mTestIfaceName));
+ std::this_thread::sleep_for(50ms);
+ EXPECT_FALSE(mGotMulticast);
+ mRunning = false;
+ unsuccessfulReceiver.join();
+
+ aidlStatus = mNlInterceptorService->closeSocket(interceptedSocket);
+ EXPECT_TRUE(aidlStatus.isOk());
+}
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(InterceptorAidlTest);
+INSTANTIATE_TEST_SUITE_P(PerInstance, InterceptorAidlTest,
+ testing::ValuesIn(android::getAidlHalInstanceNames(
+ IInterceptor::descriptor)),
+ android::PrintInstanceNameToString);
diff --git a/wifi/supplicant/1.3/vts/OWNERS b/wifi/supplicant/OWNERS
similarity index 64%
rename from wifi/supplicant/1.3/vts/OWNERS
rename to wifi/supplicant/OWNERS
index 287152d..7febd60 100644
--- a/wifi/supplicant/1.3/vts/OWNERS
+++ b/wifi/supplicant/OWNERS
@@ -1,3 +1,5 @@
# Bug component: 33618
arabawy@google.com
etancohen@google.com
+gbiren@google.com
+lzye@google.com
diff --git a/wifi/supplicant/aidl/Android.bp b/wifi/supplicant/aidl/Android.bp
new file mode 100644
index 0000000..c97a6f9
--- /dev/null
+++ b/wifi/supplicant/aidl/Android.bp
@@ -0,0 +1,37 @@
+// Copyright (C) 2021 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.
+
+aidl_interface {
+ name: "android.hardware.wifi.supplicant",
+ vendor_available: true,
+ srcs: [
+ "android/hardware/wifi/supplicant/*.aidl",
+ ],
+ stability: "vintf",
+ backend: {
+ java: {
+ sdk_version: "module_current",
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.wifi",
+ ],
+ min_sdk_version: "30",
+ },
+ ndk: {
+ vndk: {
+ enabled: true,
+ },
+ },
+ },
+}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AnqpData.aidl
similarity index 81%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AnqpData.aidl
index 41a1afe..d8e49d7 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AnqpData.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,10 +31,14 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+parcelable AnqpData {
+ byte[] venueName;
+ byte[] roamingConsortium;
+ byte[] ipAddrTypeAvailability;
+ byte[] naiRealm;
+ byte[] anqp3gppCellularNetwork;
+ byte[] domainName;
+ byte[] venueUrl;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AnqpInfoId.aidl
similarity index 82%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AnqpInfoId.aidl
index cfafc50..cc32360 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AnqpInfoId.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,13 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum AnqpInfoId {
+ VENUE_NAME = 258,
+ ROAMING_CONSORTIUM = 261,
+ IP_ADDR_TYPE_AVAILABILITY = 262,
+ NAI_REALM = 263,
+ ANQP_3GPP_CELLULAR_NETWORK = 264,
+ DOMAIN_NAME = 268,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AssociationRejectionData.aidl
similarity index 72%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AssociationRejectionData.aidl
index cfafc50..f6830dc 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AssociationRejectionData.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,15 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable AssociationRejectionData {
+ byte[] ssid;
+ byte[] bssid;
+ android.hardware.wifi.supplicant.StaIfaceStatusCode statusCode;
+ boolean timedOut;
+ boolean isMboAssocDisallowedReasonCodePresent;
+ android.hardware.wifi.supplicant.MboAssocDisallowedReasonCode mboAssocDisallowedReason;
+ boolean isOceRssiBasedAssocRejectAttrPresent;
+ android.hardware.wifi.supplicant.OceRssiBasedAssocRejectAttr oceRssiBasedAssocRejectData;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuthAlgMask.aidl
similarity index 87%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuthAlgMask.aidl
index cfafc50..9cd178d 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuthAlgMask.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,11 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum AuthAlgMask {
+ OPEN = 1,
+ SHARED = 2,
+ LEAP = 4,
+ SAE = 16,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssTmData.aidl
similarity index 76%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssTmData.aidl
index 41a1afe..34d894d 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssTmData.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,10 +31,12 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+parcelable BssTmData {
+ android.hardware.wifi.supplicant.BssTmStatusCode status;
+ android.hardware.wifi.supplicant.BssTmDataFlagsMask flags;
+ int assocRetryDelayMs;
+ android.hardware.wifi.supplicant.MboTransitionReasonCode mboTransitionReason;
+ android.hardware.wifi.supplicant.MboCellularDataConnectionPrefValue mboCellPreference;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl
similarity index 75%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl
index cfafc50..f215f05 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,15 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum BssTmDataFlagsMask {
+ WNM_MODE_PREFERRED_CANDIDATE_LIST_INCLUDED = 1,
+ WNM_MODE_ABRIDGED = 2,
+ WNM_MODE_DISASSOCIATION_IMMINENT = 4,
+ WNM_MODE_BSS_TERMINATION_INCLUDED = 8,
+ WNM_MODE_ESS_DISASSOCIATION_IMMINENT = 16,
+ MBO_TRANSITION_REASON_CODE_INCLUDED = 32,
+ MBO_ASSOC_RETRY_DELAY_INCLUDED = 64,
+ MBO_CELLULAR_DATA_CONNECTION_PREFERENCE_INCLUDED = 128,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssTmStatusCode.aidl
similarity index 75%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssTmStatusCode.aidl
index cfafc50..c95825f 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssTmStatusCode.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,16 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.wifi.supplicant;
+@Backing(type="byte") @VintfStability
+enum BssTmStatusCode {
+ ACCEPT = 0,
+ REJECT_UNSPECIFIED = 1,
+ REJECT_INSUFFICIENT_BEACON = 2,
+ REJECT_INSUFFICIENT_CAPABITY = 3,
+ REJECT_BSS_TERMINATION_UNDESIRED = 4,
+ REJECT_BSS_TERMINATION_DELAY_REQUEST = 5,
+ REJECT_STA_CANDIDATE_LIST_PROVIDED = 6,
+ REJECT_NO_SUITABLE_CANDIDATES = 7,
+ REJECT_LEAVING_ESS = 8,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssidChangeReason.aidl
similarity index 84%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssidChangeReason.aidl
index cfafc50..1d24579 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssidChangeReason.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,10 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.wifi.supplicant;
+@Backing(type="byte") @VintfStability
+enum BssidChangeReason {
+ ASSOC_START = 0,
+ ASSOC_COMPLETE = 1,
+ DISASSOC = 2,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BtCoexistenceMode.aidl
similarity index 85%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BtCoexistenceMode.aidl
index cfafc50..bdc1b4a 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BtCoexistenceMode.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,10 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.wifi.supplicant;
+@Backing(type="byte") @VintfStability
+enum BtCoexistenceMode {
+ ENABLED = 0,
+ DISABLED = 1,
+ SENSE = 2,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl
similarity index 79%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl
index 41a1afe..433b3d80 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,10 +31,12 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+parcelable ConnectionCapabilities {
+ android.hardware.wifi.supplicant.WifiTechnology technology;
+ int channelBandwidth;
+ int maxNumberTxSpatialStreams;
+ int maxNumberRxSpatialStreams;
+ android.hardware.wifi.supplicant.LegacyMode legacyMode;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DebugLevel.aidl
similarity index 85%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DebugLevel.aidl
index cfafc50..fbfb5b3 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DebugLevel.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,13 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum DebugLevel {
+ EXCESSIVE = 0,
+ MSGDUMP = 1,
+ DEBUG = 2,
+ INFO = 3,
+ WARNING = 4,
+ ERROR = 5,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppAkm.aidl
similarity index 87%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppAkm.aidl
index cfafc50..df2aef8 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppAkm.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,11 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum DppAkm {
+ PSK = 0,
+ PSK_SAE = 1,
+ SAE = 2,
+ DPP = 3,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppCurve.aidl
similarity index 84%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppCurve.aidl
index cfafc50..e69da44 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppCurve.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,13 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum DppCurve {
+ PRIME256V1 = 0,
+ SECP384R1 = 1,
+ SECP521R1 = 2,
+ BRAINPOOLP256R1 = 3,
+ BRAINPOOLP384R1 = 4,
+ BRAINPOOLP512R1 = 5,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppEventType.aidl
similarity index 87%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppEventType.aidl
index cfafc50..9e394fc 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppEventType.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,9 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum DppEventType {
+ CONFIGURATION_SENT = 0,
+ CONFIGURATION_APPLIED = 1,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppFailureCode.aidl
similarity index 78%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppFailureCode.aidl
index cfafc50..7e7c806 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppFailureCode.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,19 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum DppFailureCode {
+ INVALID_URI = 0,
+ AUTHENTICATION = 1,
+ NOT_COMPATIBLE = 2,
+ CONFIGURATION = 3,
+ BUSY = 4,
+ TIMEOUT = 5,
+ FAILURE = 6,
+ NOT_SUPPORTED = 7,
+ CONFIGURATION_REJECTED = 8,
+ CANNOT_FIND_NETWORK = 9,
+ ENROLLEE_AUTHENTICATION = 10,
+ URI_GENERATION = 11,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppNetRole.aidl
similarity index 88%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppNetRole.aidl
index cfafc50..c6d3522 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppNetRole.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,9 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum DppNetRole {
+ STA = 0,
+ AP = 1,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppProgressCode.aidl
similarity index 83%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppProgressCode.aidl
index cfafc50..f0618a5 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppProgressCode.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,11 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum DppProgressCode {
+ AUTHENTICATION_SUCCESS = 0,
+ RESPONSE_PENDING = 1,
+ CONFIGURATION_SENT_WAITING_RESPONSE = 2,
+ CONFIGURATION_ACCEPTED = 3,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppResponderBootstrapInfo.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppResponderBootstrapInfo.aidl
index 73385d4..8b6492b 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppResponderBootstrapInfo.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,9 +31,10 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable LayerGenericMetadataKey {
- String name;
- boolean mandatory;
+parcelable DppResponderBootstrapInfo {
+ int bootstrapId;
+ int listenChannel;
+ String uri;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/EapErrorCode.aidl
similarity index 81%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/EapErrorCode.aidl
index cfafc50..2cf81d9 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/EapErrorCode.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,12 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum EapErrorCode {
+ SIM_GENERAL_FAILURE_AFTER_AUTH = 0,
+ SIM_TEMPORARILY_DENIED = 1026,
+ SIM_NOT_SUBSCRIBED = 1031,
+ SIM_GENERAL_FAILURE_BEFORE_AUTH = 16384,
+ SIM_VENDOR_SPECIFIC_EXPIRED_CERT = 16385,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/EapMethod.aidl
similarity index 84%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/EapMethod.aidl
index cfafc50..4ab23af 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/EapMethod.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,15 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum EapMethod {
+ PEAP = 0,
+ TLS = 1,
+ TTLS = 2,
+ PWD = 3,
+ SIM = 4,
+ AKA = 5,
+ AKA_PRIME = 6,
+ WFA_UNAUTH_TLS = 7,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/EapPhase2Method.aidl
similarity index 84%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/EapPhase2Method.aidl
index cfafc50..4bd93a0 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/EapPhase2Method.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,15 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum EapPhase2Method {
+ NONE = 0,
+ PAP = 1,
+ MSPAP = 2,
+ MSPAPV2 = 3,
+ GTC = 4,
+ SIM = 5,
+ AKA = 6,
+ AKA_PRIME = 7,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ExtRadioWorkDefaults.aidl
similarity index 88%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ExtRadioWorkDefaults.aidl
index cfafc50..cbf1a3e 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ExtRadioWorkDefaults.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,8 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum ExtRadioWorkDefaults {
+ TIMEOUT_IN_SECS = 10,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/FreqRange.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/FreqRange.aidl
index cfafc50..0971d51 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/FreqRange.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,9 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable FreqRange {
+ int min;
+ int max;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupCipherMask.aidl
similarity index 83%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupCipherMask.aidl
index cfafc50..f2da925 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupCipherMask.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,15 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum GroupCipherMask {
+ WEP40 = 2,
+ WEP104 = 4,
+ TKIP = 8,
+ CCMP = 16,
+ GTK_NOT_USED = 16384,
+ GCMP_256 = 256,
+ SMS4 = 128,
+ GCMP_128 = 64,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl
index cfafc50..c24d6cc 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,10 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum GroupMgmtCipherMask {
+ BIP_GMAC_128 = 2048,
+ BIP_GMAC_256 = 4096,
+ BIP_CMAC_256 = 8192,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GsmRand.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GsmRand.aidl
index cfafc50..599a683 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GsmRand.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,8 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable GsmRand {
+ byte[] data;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/Hs20AnqpData.aidl
similarity index 84%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/Hs20AnqpData.aidl
index 41a1afe..43b182a 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/Hs20AnqpData.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,10 +31,11 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+parcelable Hs20AnqpData {
+ byte[] operatorFriendlyName;
+ byte[] wanMetrics;
+ byte[] connectionCapability;
+ byte[] osuProvidersList;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/Hs20AnqpSubtypes.aidl
similarity index 84%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/Hs20AnqpSubtypes.aidl
index cfafc50..270d43b 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/Hs20AnqpSubtypes.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,11 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum Hs20AnqpSubtypes {
+ OPERATOR_FRIENDLY_NAME = 3,
+ WAN_METRICS = 4,
+ CONNECTION_CAPABILITY = 5,
+ OSU_PROVIDERS_LIST = 8,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicant.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicant.aidl
new file mode 100644
index 0000000..b4371fd
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicant.aidl
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+@VintfStability
+interface ISupplicant {
+ android.hardware.wifi.supplicant.ISupplicantP2pIface addP2pInterface(in String ifName);
+ android.hardware.wifi.supplicant.ISupplicantStaIface addStaInterface(in String ifName);
+ android.hardware.wifi.supplicant.DebugLevel getDebugLevel();
+ android.hardware.wifi.supplicant.ISupplicantP2pIface getP2pInterface(in String ifName);
+ android.hardware.wifi.supplicant.ISupplicantStaIface getStaInterface(in String ifName);
+ boolean isDebugShowKeysEnabled();
+ boolean isDebugShowTimestampEnabled();
+ android.hardware.wifi.supplicant.IfaceInfo[] listInterfaces();
+ void registerCallback(in android.hardware.wifi.supplicant.ISupplicantCallback callback);
+ void removeInterface(in android.hardware.wifi.supplicant.IfaceInfo ifaceInfo);
+ void setConcurrencyPriority(in android.hardware.wifi.supplicant.IfaceType type);
+ void setDebugParams(in android.hardware.wifi.supplicant.DebugLevel level, in boolean showTimestamp, in boolean showKeys);
+ oneway void terminate();
+ const int EXT_RADIO_WORK_TIMEOUT_IN_SECS = 10;
+}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantCallback.aidl
similarity index 82%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantCallback.aidl
index 41a1afe..72ab3b9 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantCallback.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,10 +31,10 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+interface ISupplicantCallback {
+ oneway void onInterfaceCreated(in String ifaceName);
+ oneway void onInterfaceRemoved(in String ifaceName);
+ oneway void onTerminating();
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
new file mode 100644
index 0000000..ca7be73
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+@VintfStability
+interface ISupplicantP2pIface {
+ void addBonjourService(in byte[] query, in byte[] response);
+ void addGroup(in boolean persistent, in int persistentNetworkId);
+ void addGroupWithConfig(in byte[] ssid, in String pskPassphrase, in boolean persistent, in int freq, in byte[] peerAddress, in boolean joinExistingGroup);
+ android.hardware.wifi.supplicant.ISupplicantP2pNetwork addNetwork();
+ void addUpnpService(in int version, in String serviceName);
+ void cancelConnect();
+ void cancelServiceDiscovery(in long identifier);
+ void cancelWps(in String groupIfName);
+ void configureExtListen(in int periodInMillis, in int intervalInMillis);
+ String connect(in byte[] peerAddress, in android.hardware.wifi.supplicant.WpsProvisionMethod provisionMethod, in String preSelectedPin, in boolean joinExistingGroup, in boolean persistent, in int goIntent);
+ byte[] createNfcHandoverRequestMessage();
+ byte[] createNfcHandoverSelectMessage();
+ void enableWfd(in boolean enable);
+ void find(in int timeoutInSec);
+ void flush();
+ void flushServices();
+ byte[] getDeviceAddress();
+ boolean getEdmg();
+ android.hardware.wifi.supplicant.P2pGroupCapabilityMask getGroupCapability(in byte[] peerAddress);
+ String getName();
+ android.hardware.wifi.supplicant.ISupplicantP2pNetwork getNetwork(in int id);
+ byte[] getSsid(in byte[] peerAddress);
+ android.hardware.wifi.supplicant.IfaceType getType();
+ void invite(in String groupIfName, in byte[] goDeviceAddress, in byte[] peerAddress);
+ int[] listNetworks();
+ void provisionDiscovery(in byte[] peerAddress, in android.hardware.wifi.supplicant.WpsProvisionMethod provisionMethod);
+ void registerCallback(in android.hardware.wifi.supplicant.ISupplicantP2pIfaceCallback callback);
+ void reinvoke(in int persistentNetworkId, in byte[] peerAddress);
+ void reject(in byte[] peerAddress);
+ void removeBonjourService(in byte[] query);
+ void removeGroup(in String groupIfName);
+ void removeNetwork(in int id);
+ void removeUpnpService(in int version, in String serviceName);
+ void reportNfcHandoverInitiation(in byte[] select);
+ void reportNfcHandoverResponse(in byte[] request);
+ long requestServiceDiscovery(in byte[] peerAddress, in byte[] query);
+ void saveConfig();
+ void setDisallowedFrequencies(in android.hardware.wifi.supplicant.FreqRange[] ranges);
+ void setEdmg(in boolean enable);
+ void setGroupIdle(in String groupIfName, in int timeoutInSec);
+ void setListenChannel(in int channel, in int operatingClass);
+ void setMacRandomization(in boolean enable);
+ void setMiracastMode(in android.hardware.wifi.supplicant.MiracastMode mode);
+ void setPowerSave(in String groupIfName, in boolean enable);
+ void setSsidPostfix(in byte[] postfix);
+ void setWfdDeviceInfo(in byte[] info);
+ void setWfdR2DeviceInfo(in byte[] info);
+ void setWpsConfigMethods(in android.hardware.wifi.supplicant.WpsConfigMethods configMethods);
+ void setWpsDeviceName(in String name);
+ void setWpsDeviceType(in byte[] type);
+ void setWpsManufacturer(in String manufacturer);
+ void setWpsModelName(in String modelName);
+ void setWpsModelNumber(in String modelNumber);
+ void setWpsSerialNumber(in String serialNumber);
+ void startWpsPbc(in String groupIfName, in byte[] bssid);
+ String startWpsPinDisplay(in String groupIfName, in byte[] bssid);
+ void startWpsPinKeypad(in String groupIfName, in String pin);
+ void stopFind();
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
new file mode 100644
index 0000000..ed435e2
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+@VintfStability
+interface ISupplicantP2pIfaceCallback {
+ oneway void onDeviceFound(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in byte deviceCapabilities, in android.hardware.wifi.supplicant.P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo);
+ oneway void onDeviceLost(in byte[] p2pDeviceAddress);
+ oneway void onFindStopped();
+ oneway void onGoNegotiationCompleted(in android.hardware.wifi.supplicant.P2pStatusCode status);
+ oneway void onGoNegotiationRequest(in byte[] srcAddress, in android.hardware.wifi.supplicant.WpsDevPasswordId passwordId);
+ oneway void onGroupFormationFailure(in String failureReason);
+ oneway void onGroupFormationSuccess();
+ oneway void onGroupRemoved(in String groupIfname, in boolean isGroupOwner);
+ oneway void onGroupStarted(in String groupIfname, in boolean isGroupOwner, in byte[] ssid, in int frequency, in byte[] psk, in String passphrase, in byte[] goDeviceAddress, in boolean isPersistent);
+ oneway void onInvitationReceived(in byte[] srcAddress, in byte[] goDeviceAddress, in byte[] bssid, in int persistentNetworkId, in int operatingFrequency);
+ oneway void onInvitationResult(in byte[] bssid, in android.hardware.wifi.supplicant.P2pStatusCode status);
+ oneway void onProvisionDiscoveryCompleted(in byte[] p2pDeviceAddress, in boolean isRequest, in android.hardware.wifi.supplicant.P2pProvDiscStatusCode status, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in String generatedPin);
+ oneway void onR2DeviceFound(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in byte deviceCapabilities, in android.hardware.wifi.supplicant.P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo);
+ oneway void onServiceDiscoveryResponse(in byte[] srcAddress, in char updateIndicator, in byte[] tlvs);
+ oneway void onStaAuthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress);
+ oneway void onStaDeauthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress);
+}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pNetwork.aidl
similarity index 74%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pNetwork.aidl
index 41a1afe..ef72724 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pNetwork.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,10 +31,17 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+interface ISupplicantP2pNetwork {
+ byte[] getBssid();
+ android.hardware.wifi.supplicant.MacAddress[] getClientList();
+ int getId();
+ String getInterfaceName();
+ byte[] getSsid();
+ android.hardware.wifi.supplicant.IfaceType getType();
+ boolean isCurrent();
+ boolean isGroupOwner();
+ boolean isPersistent();
+ void setClientList(in android.hardware.wifi.supplicant.MacAddress[] clients);
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
new file mode 100644
index 0000000..ca40379
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+@VintfStability
+interface ISupplicantStaIface {
+ int addDppPeerUri(in String uri);
+ int addExtRadioWork(in String name, in int freqInMhz, in int timeoutInSec);
+ android.hardware.wifi.supplicant.ISupplicantStaNetwork addNetwork();
+ void addRxFilter(in android.hardware.wifi.supplicant.RxFilterType type);
+ void cancelWps();
+ void disconnect();
+ void enableAutoReconnect(in boolean enable);
+ void filsHlpAddRequest(in byte[] dst_mac, in byte[] pkt);
+ void filsHlpFlushRequest();
+ android.hardware.wifi.supplicant.DppResponderBootstrapInfo generateDppBootstrapInfoForResponder(in byte[] macAddress, in String deviceInfo, in android.hardware.wifi.supplicant.DppCurve curve);
+ android.hardware.wifi.supplicant.ConnectionCapabilities getConnectionCapabilities();
+ android.hardware.wifi.supplicant.KeyMgmtMask getKeyMgmtCapabilities();
+ byte[] getMacAddress();
+ String getName();
+ android.hardware.wifi.supplicant.ISupplicantStaNetwork getNetwork(in int id);
+ android.hardware.wifi.supplicant.IfaceType getType();
+ android.hardware.wifi.supplicant.WpaDriverCapabilitiesMask getWpaDriverCapabilities();
+ void initiateAnqpQuery(in byte[] macAddress, in android.hardware.wifi.supplicant.AnqpInfoId[] infoElements, in android.hardware.wifi.supplicant.Hs20AnqpSubtypes[] subTypes);
+ void initiateHs20IconQuery(in byte[] macAddress, in String fileName);
+ void initiateTdlsDiscover(in byte[] macAddress);
+ void initiateTdlsSetup(in byte[] macAddress);
+ void initiateTdlsTeardown(in byte[] macAddress);
+ void initiateVenueUrlAnqpQuery(in byte[] macAddress);
+ int[] listNetworks();
+ void reassociate();
+ void reconnect();
+ void registerCallback(in android.hardware.wifi.supplicant.ISupplicantStaIfaceCallback callback);
+ void removeDppUri(in int id);
+ void removeExtRadioWork(in int id);
+ void removeNetwork(in int id);
+ void removeRxFilter(in android.hardware.wifi.supplicant.RxFilterType type);
+ void setBtCoexistenceMode(in android.hardware.wifi.supplicant.BtCoexistenceMode mode);
+ void setBtCoexistenceScanModeEnabled(in boolean enable);
+ void setCountryCode(in byte[] code);
+ void setExternalSim(in boolean useExternalSim);
+ void setMboCellularDataStatus(in boolean available);
+ void setPowerSave(in boolean enable);
+ void setSuspendModeEnabled(in boolean enable);
+ void setWpsConfigMethods(in android.hardware.wifi.supplicant.WpsConfigMethods configMethods);
+ void setWpsDeviceName(in String name);
+ void setWpsDeviceType(in byte[] type);
+ void setWpsManufacturer(in String manufacturer);
+ void setWpsModelName(in String modelName);
+ void setWpsModelNumber(in String modelNumber);
+ void setWpsSerialNumber(in String serialNumber);
+ void startDppConfiguratorInitiator(in int peerBootstrapId, in int ownBootstrapId, in String ssid, in String password, in String psk, in android.hardware.wifi.supplicant.DppNetRole netRole, in android.hardware.wifi.supplicant.DppAkm securityAkm);
+ void startDppEnrolleeInitiator(in int peerBootstrapId, in int ownBootstrapId);
+ void startDppEnrolleeResponder(in int listenChannel);
+ void startRxFilter();
+ void startWpsPbc(in byte[] bssid);
+ String startWpsPinDisplay(in byte[] bssid);
+ void startWpsPinKeypad(in String pin);
+ void startWpsRegistrar(in byte[] bssid, in String pin);
+ void stopDppInitiator();
+ void stopDppResponder(in int ownBootstrapId);
+ void stopRxFilter();
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
new file mode 100644
index 0000000..37b34cf
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+@VintfStability
+interface ISupplicantStaIfaceCallback {
+ oneway void onAnqpQueryDone(in byte[] bssid, in android.hardware.wifi.supplicant.AnqpData data, in android.hardware.wifi.supplicant.Hs20AnqpData hs20Data);
+ oneway void onAssociationRejected(in android.hardware.wifi.supplicant.AssociationRejectionData assocRejectData);
+ oneway void onAuthenticationTimeout(in byte[] bssid);
+ oneway void onBssTmHandlingDone(in android.hardware.wifi.supplicant.BssTmData tmData);
+ oneway void onBssidChanged(in android.hardware.wifi.supplicant.BssidChangeReason reason, in byte[] bssid);
+ oneway void onDisconnected(in byte[] bssid, in boolean locallyGenerated, in android.hardware.wifi.supplicant.StaIfaceReasonCode reasonCode);
+ oneway void onDppFailure(in android.hardware.wifi.supplicant.DppFailureCode code, in String ssid, in String channelList, in char[] bandList);
+ oneway void onDppProgress(in android.hardware.wifi.supplicant.DppProgressCode code);
+ oneway void onDppSuccess(in android.hardware.wifi.supplicant.DppEventType event);
+ oneway void onDppSuccessConfigReceived(in byte[] ssid, in String password, in byte[] psk, in android.hardware.wifi.supplicant.DppAkm securityAkm);
+ oneway void onDppSuccessConfigSent();
+ oneway void onEapFailure(in int errorCode);
+ oneway void onExtRadioWorkStart(in int id);
+ oneway void onExtRadioWorkTimeout(in int id);
+ oneway void onHs20DeauthImminentNotice(in byte[] bssid, in int reasonCode, in int reAuthDelayInSec, in String url);
+ oneway void onHs20IconQueryDone(in byte[] bssid, in String fileName, in byte[] data);
+ oneway void onHs20SubscriptionRemediation(in byte[] bssid, in android.hardware.wifi.supplicant.OsuMethod osuMethod, in String url);
+ oneway void onHs20TermsAndConditionsAcceptanceRequestedNotification(in byte[] bssid, in String url);
+ oneway void onNetworkAdded(in int id);
+ oneway void onNetworkNotFound(in byte[] ssid);
+ oneway void onNetworkRemoved(in int id);
+ oneway void onPmkCacheAdded(in long expirationTimeInSec, in byte[] serializedEntry);
+ oneway void onStateChanged(in android.hardware.wifi.supplicant.StaIfaceCallbackState newState, in byte[] bssid, in int id, in byte[] ssid, in boolean filsHlpSent);
+ oneway void onWpsEventFail(in byte[] bssid, in android.hardware.wifi.supplicant.WpsConfigError configError, in android.hardware.wifi.supplicant.WpsErrorIndication errorInd);
+ oneway void onWpsEventPbcOverlap();
+ oneway void onWpsEventSuccess();
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl
new file mode 100644
index 0000000..18baea6
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+@VintfStability
+interface ISupplicantStaNetwork {
+ void disable();
+ void enable(in boolean noConnect);
+ void enableSaePkOnlyMode(in boolean enable);
+ void enableSuiteBEapOpenSslCiphers();
+ void enableTlsSuiteBEapPhase1Param(in boolean enable);
+ android.hardware.wifi.supplicant.AuthAlgMask getAuthAlg();
+ byte[] getBssid();
+ String getEapAltSubjectMatch();
+ byte[] getEapAnonymousIdentity();
+ String getEapCACert();
+ String getEapCAPath();
+ String getEapClientCert();
+ String getEapDomainSuffixMatch();
+ boolean getEapEngine();
+ String getEapEngineId();
+ byte[] getEapIdentity();
+ android.hardware.wifi.supplicant.EapMethod getEapMethod();
+ byte[] getEapPassword();
+ android.hardware.wifi.supplicant.EapPhase2Method getEapPhase2Method();
+ String getEapPrivateKeyId();
+ String getEapSubjectMatch();
+ boolean getEdmg();
+ android.hardware.wifi.supplicant.GroupCipherMask getGroupCipher();
+ android.hardware.wifi.supplicant.GroupMgmtCipherMask getGroupMgmtCipher();
+ int getId();
+ String getIdStr();
+ String getInterfaceName();
+ android.hardware.wifi.supplicant.KeyMgmtMask getKeyMgmt();
+ android.hardware.wifi.supplicant.OcspType getOcsp();
+ android.hardware.wifi.supplicant.PairwiseCipherMask getPairwiseCipher();
+ android.hardware.wifi.supplicant.ProtoMask getProto();
+ byte[] getPsk();
+ String getPskPassphrase();
+ boolean getRequirePmf();
+ String getSaePassword();
+ String getSaePasswordId();
+ boolean getScanSsid();
+ byte[] getSsid();
+ android.hardware.wifi.supplicant.IfaceType getType();
+ String getWapiCertSuite();
+ byte[] getWepKey(in int keyIdx);
+ int getWepTxKeyIdx();
+ byte[] getWpsNfcConfigurationToken();
+ void registerCallback(in android.hardware.wifi.supplicant.ISupplicantStaNetworkCallback callback);
+ void select();
+ void sendNetworkEapIdentityResponse(in byte[] identity, in byte[] encryptedIdentity);
+ void sendNetworkEapSimGsmAuthFailure();
+ void sendNetworkEapSimGsmAuthResponse(in android.hardware.wifi.supplicant.NetworkResponseEapSimGsmAuthParams[] params);
+ void sendNetworkEapSimUmtsAuthFailure();
+ void sendNetworkEapSimUmtsAuthResponse(in android.hardware.wifi.supplicant.NetworkResponseEapSimUmtsAuthParams params);
+ void sendNetworkEapSimUmtsAutsResponse(in byte[] auts);
+ void setAuthAlg(in android.hardware.wifi.supplicant.AuthAlgMask authAlgMask);
+ void setBssid(in byte[] bssid);
+ void setEapAltSubjectMatch(in String match);
+ void setEapAnonymousIdentity(in byte[] identity);
+ void setEapCACert(in String path);
+ void setEapCAPath(in String path);
+ void setEapClientCert(in String path);
+ void setEapDomainSuffixMatch(in String match);
+ void setEapEncryptedImsiIdentity(in byte[] identity);
+ void setEapEngine(in boolean enable);
+ void setEapEngineID(in String id);
+ void setEapErp(in boolean enable);
+ void setEapIdentity(in byte[] identity);
+ void setEapMethod(in android.hardware.wifi.supplicant.EapMethod method);
+ void setEapPassword(in byte[] password);
+ void setEapPhase2Method(in android.hardware.wifi.supplicant.EapPhase2Method method);
+ void setEapPrivateKeyId(in String id);
+ void setEapSubjectMatch(in String match);
+ void setEdmg(in boolean enable);
+ void setGroupCipher(in android.hardware.wifi.supplicant.GroupCipherMask groupCipherMask);
+ void setGroupMgmtCipher(in android.hardware.wifi.supplicant.GroupMgmtCipherMask groupMgmtCipherMask);
+ void setIdStr(in String idStr);
+ void setKeyMgmt(in android.hardware.wifi.supplicant.KeyMgmtMask keyMgmtMask);
+ void setOcsp(in android.hardware.wifi.supplicant.OcspType ocspType);
+ void setPairwiseCipher(in android.hardware.wifi.supplicant.PairwiseCipherMask pairwiseCipherMask);
+ void setPmkCache(in byte[] serializedEntry);
+ void setProactiveKeyCaching(in boolean enable);
+ void setProto(in android.hardware.wifi.supplicant.ProtoMask protoMask);
+ void setPsk(in byte[] psk);
+ void setPskPassphrase(in String psk);
+ void setRequirePmf(in boolean enable);
+ void setSaeH2eMode(in android.hardware.wifi.supplicant.SaeH2eMode mode);
+ void setSaePassword(in String saePassword);
+ void setSaePasswordId(in String saePasswordId);
+ void setScanSsid(in boolean enable);
+ void setSsid(in byte[] ssid);
+ void setUpdateIdentifier(in int id);
+ void setWapiCertSuite(in String suite);
+ void setWepKey(in int keyIdx, in byte[] wepKey);
+ void setWepTxKeyIdx(in int keyIdx);
+ const int SSID_MAX_LEN_IN_BYTES = 32;
+ const int PSK_PASSPHRASE_MIN_LEN_IN_BYTES = 8;
+ const int PSK_PASSPHRASE_MAX_LEN_IN_BYTES = 63;
+ const int WEP_KEYS_MAX_NUM = 4;
+ const int WEP40_KEY_LEN_IN_BYTES = 5;
+ const int WEP104_KEY_LEN_IN_BYTES = 13;
+}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl
similarity index 72%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl
index 41a1afe..4f7584d 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ExecuteCommandsStatus.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,10 +31,11 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable ExecuteCommandsStatus {
- boolean queueChanged;
- int length;
- android.hardware.common.NativeHandle[] handles;
+interface ISupplicantStaNetworkCallback {
+ oneway void onNetworkEapIdentityRequest();
+ oneway void onNetworkEapSimGsmAuthRequest(in android.hardware.wifi.supplicant.NetworkRequestEapSimGsmAuthParams params);
+ oneway void onNetworkEapSimUmtsAuthRequest(in android.hardware.wifi.supplicant.NetworkRequestEapSimUmtsAuthParams params);
+ oneway void onTransitionDisable(in android.hardware.wifi.supplicant.TransitionDisableIndication ind);
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IfaceInfo.aidl
similarity index 87%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IfaceInfo.aidl
index 73385d4..6706c8c 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IfaceInfo.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,9 +31,9 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable LayerGenericMetadataKey {
+parcelable IfaceInfo {
+ android.hardware.wifi.supplicant.IfaceType type;
String name;
- boolean mandatory;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IfaceType.aidl
similarity index 88%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IfaceType.aidl
index cfafc50..557dbd7 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IfaceType.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,9 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum IfaceType {
+ STA = 0,
+ P2P = 1,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/KeyMgmtMask.aidl
similarity index 76%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/KeyMgmtMask.aidl
index cfafc50..7228480 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/KeyMgmtMask.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,24 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum KeyMgmtMask {
+ WPA_EAP = 1,
+ WPA_PSK = 2,
+ NONE = 4,
+ IEEE8021X = 8,
+ FT_EAP = 32,
+ FT_PSK = 64,
+ OSEN = 32768,
+ WPA_EAP_SHA256 = 128,
+ WPA_PSK_SHA256 = 256,
+ SAE = 1024,
+ SUITE_B_192 = 131072,
+ OWE = 4194304,
+ DPP = 8388608,
+ WAPI_PSK = 4096,
+ WAPI_CERT = 8192,
+ FILS_SHA256 = 262144,
+ FILS_SHA384 = 524288,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/LegacyMode.aidl
similarity index 87%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/LegacyMode.aidl
index cfafc50..6896d75 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/LegacyMode.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,11 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum LegacyMode {
+ UNKNOWN = 0,
+ A_MODE = 1,
+ B_MODE = 2,
+ G_MODE = 3,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MacAddress.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MacAddress.aidl
index cfafc50..d17930a 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MacAddress.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,8 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable MacAddress {
+ byte[] data;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MboAssocDisallowedReasonCode.aidl
similarity index 80%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MboAssocDisallowedReasonCode.aidl
index cfafc50..661165d 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MboAssocDisallowedReasonCode.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,13 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.wifi.supplicant;
+@Backing(type="byte") @VintfStability
+enum MboAssocDisallowedReasonCode {
+ RESERVED = 0,
+ UNSPECIFIED = 1,
+ MAX_NUM_STA_ASSOCIATED = 2,
+ AIR_INTERFACE_OVERLOADED = 3,
+ AUTH_SERVER_OVERLOADED = 4,
+ INSUFFICIENT_RSSI = 5,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MboCellularDataConnectionPrefValue.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MboCellularDataConnectionPrefValue.aidl
index cfafc50..c4024d0 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MboCellularDataConnectionPrefValue.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,10 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum MboCellularDataConnectionPrefValue {
+ EXCLUDED = 0,
+ NOT_PREFERRED = 1,
+ PREFERRED = 255,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MboTransitionReasonCode.aidl
similarity index 76%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MboTransitionReasonCode.aidl
index cfafc50..caed095 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MboTransitionReasonCode.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,17 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.wifi.supplicant;
+@Backing(type="byte") @VintfStability
+enum MboTransitionReasonCode {
+ UNSPECIFIED = 0,
+ EXCESSIVE_FRAME_LOSS = 1,
+ EXCESSIVE_TRAFFIC_DELAY = 2,
+ INSUFFICIENT_BANDWIDTH = 3,
+ LOAD_BALANCING = 4,
+ LOW_RSSI = 5,
+ RX_EXCESSIVE_RETRIES = 6,
+ HIGH_INTERFERENCE = 7,
+ GRAY_ZONE = 8,
+ TRANSITION_TO_PREMIUM_AP = 9,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MiracastMode.aidl
similarity index 85%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MiracastMode.aidl
index cfafc50..6bc9e4d 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MiracastMode.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,10 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.wifi.supplicant;
+@Backing(type="byte") @VintfStability
+enum MiracastMode {
+ DISABLED = 0,
+ SOURCE = 1,
+ SINK = 2,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/NetworkRequestEapSimGsmAuthParams.aidl
similarity index 85%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/NetworkRequestEapSimGsmAuthParams.aidl
index 73385d4..1f03bb8 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/NetworkRequestEapSimGsmAuthParams.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,9 +31,8 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable LayerGenericMetadataKey {
- String name;
- boolean mandatory;
+parcelable NetworkRequestEapSimGsmAuthParams {
+ android.hardware.wifi.supplicant.GsmRand[] rands;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/NetworkRequestEapSimUmtsAuthParams.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/NetworkRequestEapSimUmtsAuthParams.aidl
index 73385d4..956a799 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/NetworkRequestEapSimUmtsAuthParams.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,9 +31,9 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable LayerGenericMetadataKey {
- String name;
- boolean mandatory;
+parcelable NetworkRequestEapSimUmtsAuthParams {
+ byte[] rand;
+ byte[] autn;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/NetworkResponseEapSimGsmAuthParams.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/NetworkResponseEapSimGsmAuthParams.aidl
index cfafc50..29415b7 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/NetworkResponseEapSimGsmAuthParams.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,9 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable NetworkResponseEapSimGsmAuthParams {
+ byte[] kc;
+ byte[] sres;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/NetworkResponseEapSimUmtsAuthParams.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/NetworkResponseEapSimUmtsAuthParams.aidl
index 73385d4..4e58dd8 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/NetworkResponseEapSimUmtsAuthParams.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,9 +31,10 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable LayerGenericMetadataKey {
- String name;
- boolean mandatory;
+parcelable NetworkResponseEapSimUmtsAuthParams {
+ byte[] res;
+ byte[] ik;
+ byte[] ck;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/OceRssiBasedAssocRejectAttr.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/OceRssiBasedAssocRejectAttr.aidl
index cfafc50..95a95bc 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/OceRssiBasedAssocRejectAttr.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,9 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable OceRssiBasedAssocRejectAttr {
+ int deltaRssi;
+ int retryDelayS;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/OcspType.aidl
similarity index 85%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/OcspType.aidl
index cfafc50..89de811 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/OcspType.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,11 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum OcspType {
+ NONE = 0,
+ REQUEST_CERT_STATUS = 1,
+ REQUIRE_CERT_STATUS = 2,
+ REQUIRE_ALL_CERTS_STATUS = 3,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/OsuMethod.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/OsuMethod.aidl
index cfafc50..1b99e2f 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/OsuMethod.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,9 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.wifi.supplicant;
+@Backing(type="byte") @VintfStability
+enum OsuMethod {
+ OMA_DM = 0,
+ SOAP_XML_SPP = 1,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl
similarity index 82%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl
index cfafc50..ffee12c 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,14 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum P2pGroupCapabilityMask {
+ GROUP_OWNER = 1,
+ PERSISTENT_GROUP = 2,
+ GROUP_LIMIT = 4,
+ INTRA_BSS_DIST = 8,
+ CROSS_CONN = 16,
+ PERSISTENT_RECONN = 32,
+ GROUP_FORMATION = 64,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvDiscStatusCode.aidl
similarity index 83%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvDiscStatusCode.aidl
index cfafc50..c8e53b9 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvDiscStatusCode.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,12 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.wifi.supplicant;
+@Backing(type="byte") @VintfStability
+enum P2pProvDiscStatusCode {
+ SUCCESS = 0,
+ TIMEOUT = 1,
+ REJECTED = 2,
+ TIMEOUT_JOIN = 3,
+ INFO_UNAVAILABLE = 4,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pStatusCode.aidl
similarity index 74%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pStatusCode.aidl
index cfafc50..c7ad383 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pStatusCode.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,20 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum P2pStatusCode {
+ SUCCESS = 0,
+ FAIL_INFO_CURRENTLY_UNAVAILABLE = 1,
+ FAIL_INCOMPATIBLE_PARAMS = 2,
+ FAIL_LIMIT_REACHED = 3,
+ FAIL_INVALID_PARAMS = 4,
+ FAIL_UNABLE_TO_ACCOMMODATE = 5,
+ FAIL_PREV_PROTOCOL_ERROR = 6,
+ FAIL_NO_COMMON_CHANNELS = 7,
+ FAIL_UNKNOWN_GROUP = 8,
+ FAIL_BOTH_GO_INTENT_15 = 9,
+ FAIL_INCOMPATIBLE_PROV_METHOD = 10,
+ FAIL_REJECTED_BY_USER = 11,
+ SUCCESS_DEFERRED = 12,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BlendMode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl
similarity index 86%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BlendMode.aidl
rename to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl
index a522d53..d9b00e1 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/BlendMode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,11 +31,13 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum BlendMode {
- INVALID = 0,
+enum PairwiseCipherMask {
NONE = 1,
- PREMULTIPLIED = 2,
- COVERAGE = 3,
+ TKIP = 8,
+ CCMP = 16,
+ GCMP_128 = 64,
+ SMS4 = 128,
+ GCMP_256 = 256,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtoMask.aidl
similarity index 87%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtoMask.aidl
index cfafc50..de92428 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtoMask.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,11 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum ProtoMask {
+ WPA = 1,
+ RSN = 2,
+ WAPI = 4,
+ OSEN = 8,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/RxFilterType.aidl
similarity index 85%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/RxFilterType.aidl
index cfafc50..63f5bf2 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/RxFilterType.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,9 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.wifi.supplicant;
+@Backing(type="byte") @VintfStability
+enum RxFilterType {
+ V4_MULTICAST = 0,
+ V6_MULTICAST = 1,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SaeH2eMode.aidl
similarity index 85%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SaeH2eMode.aidl
index cfafc50..978c337 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SaeH2eMode.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,10 @@
// 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.graphics.composer3;
-@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+package android.hardware.wifi.supplicant;
+@Backing(type="byte") @VintfStability
+enum SaeH2eMode {
+ DISABLED = 0,
+ H2E_OPTIONAL = 1,
+ H2E_MANDATORY = 2,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/StaIfaceCallbackState.aidl
similarity index 80%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/StaIfaceCallbackState.aidl
index cfafc50..d78cfa2 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/StaIfaceCallbackState.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,17 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum StaIfaceCallbackState {
+ DISCONNECTED = 0,
+ IFACE_DISABLED = 1,
+ INACTIVE = 2,
+ SCANNING = 3,
+ AUTHENTICATING = 4,
+ ASSOCIATING = 5,
+ ASSOCIATED = 6,
+ FOURWAY_HANDSHAKE = 7,
+ GROUP_HANDSHAKE = 8,
+ COMPLETED = 9,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/StaIfaceReasonCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/StaIfaceReasonCode.aidl
new file mode 100644
index 0000000..f26e7c5
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/StaIfaceReasonCode.aidl
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+@Backing(type="int") @VintfStability
+enum StaIfaceReasonCode {
+ UNSPECIFIED = 1,
+ PREV_AUTH_NOT_VALID = 2,
+ DEAUTH_LEAVING = 3,
+ DISASSOC_DUE_TO_INACTIVITY = 4,
+ DISASSOC_AP_BUSY = 5,
+ CLASS2_FRAME_FROM_NONAUTH_STA = 6,
+ CLASS3_FRAME_FROM_NONASSOC_STA = 7,
+ DISASSOC_STA_HAS_LEFT = 8,
+ STA_REQ_ASSOC_WITHOUT_AUTH = 9,
+ PWR_CAPABILITY_NOT_VALID = 10,
+ SUPPORTED_CHANNEL_NOT_VALID = 11,
+ BSS_TRANSITION_DISASSOC = 12,
+ INVALID_IE = 13,
+ MICHAEL_MIC_FAILURE = 14,
+ FOURWAY_HANDSHAKE_TIMEOUT = 15,
+ GROUP_KEY_UPDATE_TIMEOUT = 16,
+ IE_IN_4WAY_DIFFERS = 17,
+ GROUP_CIPHER_NOT_VALID = 18,
+ PAIRWISE_CIPHER_NOT_VALID = 19,
+ AKMP_NOT_VALID = 20,
+ UNSUPPORTED_RSN_IE_VERSION = 21,
+ INVALID_RSN_IE_CAPAB = 22,
+ IEEE_802_1X_AUTH_FAILED = 23,
+ CIPHER_SUITE_REJECTED = 24,
+ TDLS_TEARDOWN_UNREACHABLE = 25,
+ TDLS_TEARDOWN_UNSPECIFIED = 26,
+ SSP_REQUESTED_DISASSOC = 27,
+ NO_SSP_ROAMING_AGREEMENT = 28,
+ BAD_CIPHER_OR_AKM = 29,
+ NOT_AUTHORIZED_THIS_LOCATION = 30,
+ SERVICE_CHANGE_PRECLUDES_TS = 31,
+ UNSPECIFIED_QOS_REASON = 32,
+ NOT_ENOUGH_BANDWIDTH = 33,
+ DISASSOC_LOW_ACK = 34,
+ EXCEEDED_TXOP = 35,
+ STA_LEAVING = 36,
+ END_TS_BA_DLS = 37,
+ UNKNOWN_TS_BA = 38,
+ TIMEOUT = 39,
+ PEERKEY_MISMATCH = 45,
+ AUTHORIZED_ACCESS_LIMIT_REACHED = 46,
+ EXTERNAL_SERVICE_REQUIREMENTS = 47,
+ INVALID_FT_ACTION_FRAME_COUNT = 48,
+ INVALID_PMKID = 49,
+ INVALID_MDE = 50,
+ INVALID_FTE = 51,
+ MESH_PEERING_CANCELLED = 52,
+ MESH_MAX_PEERS = 53,
+ MESH_CONFIG_POLICY_VIOLATION = 54,
+ MESH_CLOSE_RCVD = 55,
+ MESH_MAX_RETRIES = 56,
+ MESH_CONFIRM_TIMEOUT = 57,
+ MESH_INVALID_GTK = 58,
+ MESH_INCONSISTENT_PARAMS = 59,
+ MESH_INVALID_SECURITY_CAP = 60,
+ MESH_PATH_ERROR_NO_PROXY_INFO = 61,
+ MESH_PATH_ERROR_NO_FORWARDING_INFO = 62,
+ MESH_PATH_ERROR_DEST_UNREACHABLE = 63,
+ MAC_ADDRESS_ALREADY_EXISTS_IN_MBSS = 64,
+ MESH_CHANNEL_SWITCH_REGULATORY_REQ = 65,
+ MESH_CHANNEL_SWITCH_UNSPECIFIED = 66,
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/StaIfaceStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/StaIfaceStatusCode.aidl
new file mode 100644
index 0000000..13529a5
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/StaIfaceStatusCode.aidl
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+@Backing(type="int") @VintfStability
+enum StaIfaceStatusCode {
+ SUCCESS = 0,
+ UNSPECIFIED_FAILURE = 1,
+ TDLS_WAKEUP_ALTERNATE = 2,
+ TDLS_WAKEUP_REJECT = 3,
+ SECURITY_DISABLED = 5,
+ UNACCEPTABLE_LIFETIME = 6,
+ NOT_IN_SAME_BSS = 7,
+ CAPS_UNSUPPORTED = 10,
+ REASSOC_NO_ASSOC = 11,
+ ASSOC_DENIED_UNSPEC = 12,
+ NOT_SUPPORTED_AUTH_ALG = 13,
+ UNKNOWN_AUTH_TRANSACTION = 14,
+ CHALLENGE_FAIL = 15,
+ AUTH_TIMEOUT = 16,
+ AP_UNABLE_TO_HANDLE_NEW_STA = 17,
+ ASSOC_DENIED_RATES = 18,
+ ASSOC_DENIED_NOSHORT = 19,
+ SPEC_MGMT_REQUIRED = 22,
+ PWR_CAPABILITY_NOT_VALID = 23,
+ SUPPORTED_CHANNEL_NOT_VALID = 24,
+ ASSOC_DENIED_NO_SHORT_SLOT_TIME = 25,
+ ASSOC_DENIED_NO_HT = 27,
+ R0KH_UNREACHABLE = 28,
+ ASSOC_DENIED_NO_PCO = 29,
+ ASSOC_REJECTED_TEMPORARILY = 30,
+ ROBUST_MGMT_FRAME_POLICY_VIOLATION = 31,
+ UNSPECIFIED_QOS_FAILURE = 32,
+ DENIED_INSUFFICIENT_BANDWIDTH = 33,
+ DENIED_POOR_CHANNEL_CONDITIONS = 34,
+ DENIED_QOS_NOT_SUPPORTED = 35,
+ REQUEST_DECLINED = 37,
+ INVALID_PARAMETERS = 38,
+ REJECTED_WITH_SUGGESTED_CHANGES = 39,
+ INVALID_IE = 40,
+ GROUP_CIPHER_NOT_VALID = 41,
+ PAIRWISE_CIPHER_NOT_VALID = 42,
+ AKMP_NOT_VALID = 43,
+ UNSUPPORTED_RSN_IE_VERSION = 44,
+ INVALID_RSN_IE_CAPAB = 45,
+ CIPHER_REJECTED_PER_POLICY = 46,
+ TS_NOT_CREATED = 47,
+ DIRECT_LINK_NOT_ALLOWED = 48,
+ DEST_STA_NOT_PRESENT = 49,
+ DEST_STA_NOT_QOS_STA = 50,
+ ASSOC_DENIED_LISTEN_INT_TOO_LARGE = 51,
+ INVALID_FT_ACTION_FRAME_COUNT = 52,
+ INVALID_PMKID = 53,
+ INVALID_MDIE = 54,
+ INVALID_FTIE = 55,
+ REQUESTED_TCLAS_NOT_SUPPORTED = 56,
+ INSUFFICIENT_TCLAS_PROCESSING_RESOURCES = 57,
+ TRY_ANOTHER_BSS = 58,
+ GAS_ADV_PROTO_NOT_SUPPORTED = 59,
+ NO_OUTSTANDING_GAS_REQ = 60,
+ GAS_RESP_NOT_RECEIVED = 61,
+ STA_TIMED_OUT_WAITING_FOR_GAS_RESP = 62,
+ GAS_RESP_LARGER_THAN_LIMIT = 63,
+ REQ_REFUSED_HOME = 64,
+ ADV_SRV_UNREACHABLE = 65,
+ REQ_REFUSED_SSPN = 67,
+ REQ_REFUSED_UNAUTH_ACCESS = 68,
+ INVALID_RSNIE = 72,
+ U_APSD_COEX_NOT_SUPPORTED = 73,
+ U_APSD_COEX_MODE_NOT_SUPPORTED = 74,
+ BAD_INTERVAL_WITH_U_APSD_COEX = 75,
+ ANTI_CLOGGING_TOKEN_REQ = 76,
+ FINITE_CYCLIC_GROUP_NOT_SUPPORTED = 77,
+ CANNOT_FIND_ALT_TBTT = 78,
+ TRANSMISSION_FAILURE = 79,
+ REQ_TCLAS_NOT_SUPPORTED = 80,
+ TCLAS_RESOURCES_EXCHAUSTED = 81,
+ REJECTED_WITH_SUGGESTED_BSS_TRANSITION = 82,
+ REJECT_WITH_SCHEDULE = 83,
+ REJECT_NO_WAKEUP_SPECIFIED = 84,
+ SUCCESS_POWER_SAVE_MODE = 85,
+ PENDING_ADMITTING_FST_SESSION = 86,
+ PERFORMING_FST_NOW = 87,
+ PENDING_GAP_IN_BA_WINDOW = 88,
+ REJECT_U_PID_SETTING = 89,
+ REFUSED_EXTERNAL_REASON = 92,
+ REFUSED_AP_OUT_OF_MEMORY = 93,
+ REJECTED_EMERGENCY_SERVICE_NOT_SUPPORTED = 94,
+ QUERY_RESP_OUTSTANDING = 95,
+ REJECT_DSE_BAND = 96,
+ TCLAS_PROCESSING_TERMINATED = 97,
+ TS_SCHEDULE_CONFLICT = 98,
+ DENIED_WITH_SUGGESTED_BAND_AND_CHANNEL = 99,
+ MCCAOP_RESERVATION_CONFLICT = 100,
+ MAF_LIMIT_EXCEEDED = 101,
+ MCCA_TRACK_LIMIT_EXCEEDED = 102,
+ DENIED_DUE_TO_SPECTRUM_MANAGEMENT = 103,
+ ASSOC_DENIED_NO_VHT = 104,
+ ENABLEMENT_DENIED = 105,
+ RESTRICTION_FROM_AUTHORIZED_GDB = 106,
+ AUTHORIZATION_DEENABLED = 107,
+ FILS_AUTHENTICATION_FAILURE = 112,
+ UNKNOWN_AUTHENTICATION_SERVER = 113,
+}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
similarity index 76%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
index cfafc50..32d71a3 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,18 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum SupplicantStatusCode {
+ SUCCESS = 0,
+ FAILURE_UNKNOWN = 1,
+ FAILURE_ARGS_INVALID = 2,
+ FAILURE_IFACE_INVALID = 3,
+ FAILURE_IFACE_UNKNOWN = 4,
+ FAILURE_IFACE_EXISTS = 5,
+ FAILURE_IFACE_DISABLED = 6,
+ FAILURE_IFACE_NOT_DISCONNECTED = 7,
+ FAILURE_NETWORK_INVALID = 8,
+ FAILURE_NETWORK_UNKNOWN = 9,
+ FAILURE_UNSUPPORTED = 10,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl
similarity index 84%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl
index cfafc50..7c63217 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,11 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum TransitionDisableIndication {
+ USE_WPA3_PERSONAL = 1,
+ USE_SAE_PK = 2,
+ USE_WPA3_ENTERPRISE = 4,
+ USE_ENHANCED_OPEN = 8,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WifiTechnology.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WifiTechnology.aidl
index cfafc50..ad36e68 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WifiTechnology.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,12 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum WifiTechnology {
+ UNKNOWN = 0,
+ LEGACY = 1,
+ HT = 2,
+ VHT = 3,
+ HE = 4,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl
index cfafc50..43772af 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,11 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum WpaDriverCapabilitiesMask {
+ MBO = 1,
+ OCE = 2,
+ SAE_PK = 4,
+ WFD_R2 = 8,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsConfigError.aidl
similarity index 68%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsConfigError.aidl
index cfafc50..c48b282 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsConfigError.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,28 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum WpsConfigError {
+ NO_ERROR = 0,
+ OOB_IFACE_READ_ERROR = 1,
+ DECRYPTION_CRC_FAILURE = 2,
+ CHAN_24_NOT_SUPPORTED = 3,
+ CHAN_50_NOT_SUPPORTED = 4,
+ SIGNAL_TOO_WEAK = 5,
+ NETWORK_AUTH_FAILURE = 6,
+ NETWORK_ASSOC_FAILURE = 7,
+ NO_DHCP_RESPONSE = 8,
+ FAILED_DHCP_CONFIG = 9,
+ IP_ADDR_CONFLICT = 10,
+ NO_CONN_TO_REGISTRAR = 11,
+ MULTIPLE_PBC_DETECTED = 12,
+ ROGUE_SUSPECTED = 13,
+ DEVICE_BUSY = 14,
+ SETUP_LOCKED = 15,
+ MSG_TIMEOUT = 16,
+ REG_SESS_TIMEOUT = 17,
+ DEV_PASSWORD_AUTH_FAILURE = 18,
+ CHAN_60G_NOT_SUPPORTED = 19,
+ PUBLIC_KEY_HASH_MISMATCH = 20,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsConfigMethods.aidl
similarity index 78%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsConfigMethods.aidl
index cfafc50..c98c479 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsConfigMethods.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,21 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum WpsConfigMethods {
+ USBA = 1,
+ ETHERNET = 2,
+ LABEL = 4,
+ DISPLAY = 8,
+ EXT_NFC_TOKEN = 16,
+ INT_NFC_TOKEN = 32,
+ NFC_INTERFACE = 64,
+ PUSHBUTTON = 128,
+ KEYPAD = 256,
+ VIRT_PUSHBUTTON = 640,
+ PHY_PUSHBUTTON = 1152,
+ P2PS = 4096,
+ VIRT_DISPLAY = 8200,
+ PHY_DISPLAY = 16392,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl
similarity index 81%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl
index cfafc50..975f1ab 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,15 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum WpsDevPasswordId {
+ DEFAULT = 0,
+ USER_SPECIFIED = 1,
+ MACHINE_SPECIFIED = 2,
+ REKEY = 3,
+ PUSHBUTTON = 4,
+ REGISTRAR_SPECIFIED = 5,
+ NFC_CONNECTION_HANDOVER = 7,
+ P2PS_DEFAULT = 8,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsErrorIndication.aidl
similarity index 84%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsErrorIndication.aidl
index cfafc50..50e69ff 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsErrorIndication.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,11 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum WpsErrorIndication {
+ NO_ERROR = 0,
+ SECURITY_TKIP_ONLY_PROHIBITED = 1,
+ SECURITY_WEP_PROHIBITED = 2,
+ AUTH_FAILURE = 3,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl
similarity index 87%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl
index cfafc50..f6dba23 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerRequest.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -31,8 +31,10 @@
// 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.graphics.composer3;
+package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
-enum LayerRequest {
- CLEAR_CLIENT_TARGET = 1,
+enum WpsProvisionMethod {
+ PBC = 0,
+ DISPLAY = 1,
+ KEYPAD = 2,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AnqpData.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AnqpData.aidl
new file mode 100644
index 0000000..5bc1015
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AnqpData.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * ANQP data for IEEE Std 802.11-2016.
+ * The format of the data within these elements follows the IEEE
+ * Std 802.11-2016 standard, section 9.4.5.
+ */
+@VintfStability
+parcelable AnqpData {
+ byte[] venueName;
+ byte[] roamingConsortium;
+ byte[] ipAddrTypeAvailability;
+ byte[] naiRealm;
+ byte[] anqp3gppCellularNetwork;
+ byte[] domainName;
+ byte[] venueUrl;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AnqpInfoId.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AnqpInfoId.aidl
new file mode 100644
index 0000000..7b2eb23
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AnqpInfoId.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Access Network Query Protocol info ID elements
+ * for IEEE Std 802.11u-2011.
+ */
+@VintfStability
+@Backing(type="int")
+enum AnqpInfoId {
+ VENUE_NAME = 258,
+ ROAMING_CONSORTIUM = 261,
+ IP_ADDR_TYPE_AVAILABILITY = 262,
+ NAI_REALM = 263,
+ ANQP_3GPP_CELLULAR_NETWORK = 264,
+ DOMAIN_NAME = 268,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AssociationRejectionData.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AssociationRejectionData.aidl
new file mode 100644
index 0000000..5673021
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AssociationRejectionData.aidl
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.MboAssocDisallowedReasonCode;
+import android.hardware.wifi.supplicant.OceRssiBasedAssocRejectAttr;
+import android.hardware.wifi.supplicant.StaIfaceStatusCode;
+
+/**
+ * Association Rejection related information.
+ */
+@VintfStability
+parcelable AssociationRejectionData {
+ /**
+ * SSID of the AP that rejected the association.
+ */
+ byte[] ssid;
+ /**
+ * BSSID of the AP that rejected the association.
+ */
+ byte[/* 6 */] bssid;
+ /*
+ * 802.11 code to indicate the reject reason.
+ * Refer to section 8.4.1.9 of IEEE 802.11 spec.
+ */
+ StaIfaceStatusCode statusCode;
+ /*
+ * Flag to indicate that failure is due to timeout rather than
+ * explicit rejection response from the AP.
+ */
+ boolean timedOut;
+ /**
+ * Flag to indicate that MboAssocDisallowedReasonCode is present
+ * in the (Re-)Association response frame.
+ */
+ boolean isMboAssocDisallowedReasonCodePresent;
+ /**
+ * mboAssocDisallowedReason is extracted from MBO association disallowed attribute
+ * in (Re-)Association response frame to indicate that the AP is not accepting new
+ * associations.
+ * Refer MBO spec v1.2 section 4.2.4 Table 13 for the details of reason code.
+ * The value is undefined if isMboAssocDisallowedReasonCodePresent is false.
+ */
+ MboAssocDisallowedReasonCode mboAssocDisallowedReason;
+ /**
+ * Flag to indicate that OceRssiBasedAssocRejectAttr is present
+ * in the (Re-)Association response frame.
+ */
+ boolean isOceRssiBasedAssocRejectAttrPresent;
+ /*
+ * OCE RSSI-based (Re-)Association rejection attribute.
+ * The contents are undefined if isOceRssiBasedAssocRejectAttrPresent is false.
+ */
+ OceRssiBasedAssocRejectAttr oceRssiBasedAssocRejectData;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AuthAlgMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AuthAlgMask.aidl
new file mode 100644
index 0000000..e8101ea
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/AuthAlgMask.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Possible mask of values for AuthAlg param.
+ * See /external/wpa_supplicant_8/src/common/defs.h for
+ * all possible values (starting at WPA_AUTH_ALG_OPEN).
+ */
+@VintfStability
+@Backing(type="int")
+enum AuthAlgMask {
+ OPEN = 1 << 0,
+ SHARED = 1 << 1,
+ LEAP = 1 << 2,
+ SAE = 1 << 4,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/BssTmData.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/BssTmData.aidl
new file mode 100644
index 0000000..233e54a
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/BssTmData.aidl
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.BssTmDataFlagsMask;
+import android.hardware.wifi.supplicant.BssTmStatusCode;
+import android.hardware.wifi.supplicant.MboCellularDataConnectionPrefValue;
+import android.hardware.wifi.supplicant.MboTransitionReasonCode;
+
+/**
+ * Data retrieved from received BSS transition management request frame.
+ */
+@VintfStability
+parcelable BssTmData {
+ /*
+ * Status code filled in BSS transition management response frame
+ */
+ BssTmStatusCode status;
+ /*
+ * Bitmask of BssTmDataFlagsMask
+ */
+ BssTmDataFlagsMask flags;
+ /*
+ * Duration for which STA shouldn't try to re-associate.
+ */
+ int assocRetryDelayMs;
+ /*
+ * Reason for BSS transition request.
+ */
+ MboTransitionReasonCode mboTransitionReason;
+ /*
+ * Cellular Data Connection preference value.
+ */
+ MboCellularDataConnectionPrefValue mboCellPreference;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl
new file mode 100644
index 0000000..1eb75f4
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Bitmask of various information retrieved from BSS transition management request frame.
+ */
+@VintfStability
+@Backing(type="int")
+enum BssTmDataFlagsMask {
+ /**
+ * Preferred candidate list included.
+ */
+ WNM_MODE_PREFERRED_CANDIDATE_LIST_INCLUDED = 1 << 0,
+ /**
+ * Abridged.
+ */
+ WNM_MODE_ABRIDGED = 1 << 1,
+ /**
+ * Disassociation Imminent.
+ */
+ WNM_MODE_DISASSOCIATION_IMMINENT = 1 << 2,
+ /**
+ * BSS termination included.
+ */
+ WNM_MODE_BSS_TERMINATION_INCLUDED = 1 << 3,
+ /**
+ * ESS Disassociation Imminent.
+ */
+ WNM_MODE_ESS_DISASSOCIATION_IMMINENT = 1 << 4,
+ /**
+ * MBO transition reason code included.
+ */
+ MBO_TRANSITION_REASON_CODE_INCLUDED = 1 << 5,
+ /**
+ * MBO retry delay time included.
+ */
+ MBO_ASSOC_RETRY_DELAY_INCLUDED = 1 << 6,
+ /**
+ * MBO cellular data connection preference value included.
+ */
+ MBO_CELLULAR_DATA_CONNECTION_PREFERENCE_INCLUDED = 1 << 7,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/BssTmStatusCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/BssTmStatusCode.aidl
new file mode 100644
index 0000000..51fbfed
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/BssTmStatusCode.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * IEEE Std 802.11-2016 - Table 9-357.
+ * BTM status code filled in BSS transition management response frame.
+ */
+@VintfStability
+@Backing(type="byte")
+enum BssTmStatusCode {
+ ACCEPT = 0,
+ REJECT_UNSPECIFIED = 1,
+ REJECT_INSUFFICIENT_BEACON = 2,
+ REJECT_INSUFFICIENT_CAPABITY = 3,
+ REJECT_BSS_TERMINATION_UNDESIRED = 4,
+ REJECT_BSS_TERMINATION_DELAY_REQUEST = 5,
+ REJECT_STA_CANDIDATE_LIST_PROVIDED = 6,
+ REJECT_NO_SUITABLE_CANDIDATES = 7,
+ REJECT_LEAVING_ESS = 8,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/BssidChangeReason.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/BssidChangeReason.aidl
new file mode 100644
index 0000000..8532bd7
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/BssidChangeReason.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * BSSID change Reasons.
+ */
+@VintfStability
+@Backing(type="byte")
+enum BssidChangeReason {
+ /**
+ * Started association with new bssid.
+ */
+ ASSOC_START = 0,
+ /**
+ * Completed association with new bssid.
+ */
+ ASSOC_COMPLETE = 1,
+ /**
+ * Dis-association with current bssid.
+ */
+ DISASSOC = 2,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/BtCoexistenceMode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/BtCoexistenceMode.aidl
new file mode 100644
index 0000000..4972744
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/BtCoexistenceMode.aidl
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Enum describing the modes of BT coexistence supported
+ * via driver commands.
+ */
+@VintfStability
+@Backing(type="byte")
+enum BtCoexistenceMode {
+ ENABLED = 0,
+ DISABLED = 1,
+ SENSE = 2,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl
new file mode 100644
index 0000000..1718413
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.LegacyMode;
+import android.hardware.wifi.supplicant.WifiTechnology;
+
+/**
+ * Connection Capabilities supported by current network and device
+ */
+@VintfStability
+parcelable ConnectionCapabilities {
+ /**
+ * Wifi Technology
+ */
+ WifiTechnology technology;
+ /**
+ * channel bandwidth
+ */
+ int channelBandwidth;
+ /**
+ * max number of Tx spatial streams
+ */
+ int maxNumberTxSpatialStreams;
+ /**
+ * max number of Rx spatial streams
+ */
+ int maxNumberRxSpatialStreams;
+ /**
+ * detailed network mode for legacy network
+ */
+ LegacyMode legacyMode;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DebugLevel.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DebugLevel.aidl
new file mode 100644
index 0000000..7caa406
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DebugLevel.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Debug levels for the supplicant.
+ * Only log messages with a level greater than the set level
+ * (via |setDebugParams|) will be logged.
+ */
+@VintfStability
+@Backing(type="int")
+enum DebugLevel {
+ EXCESSIVE = 0,
+ MSGDUMP = 1,
+ DEBUG = 2,
+ INFO = 3,
+ WARNING = 4,
+ ERROR = 5,
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppAkm.aidl
similarity index 61%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppAkm.aidl
index 0a93c9e..63fff54 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppAkm.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -14,20 +14,16 @@
* limitations under the License.
*/
-package android.hardware.graphics.composer3;
+package android.hardware.wifi.supplicant;
/**
- * Special index values (always negative) for command queue commands.
+ * DppAkm: The various AKMs that can be provisioned using DPP.
*/
@VintfStability
@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+enum DppAkm {
+ PSK,
+ PSK_SAE,
+ SAE,
+ DPP,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppCurve.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppCurve.aidl
new file mode 100644
index 0000000..ea57505
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppCurve.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * DppCurve: Elliptic curve cryptography type used to generate DPP
+ * public/private key pair.
+ */
+@VintfStability
+@Backing(type="int")
+enum DppCurve {
+ PRIME256V1,
+ SECP384R1,
+ SECP521R1,
+ BRAINPOOLP256R1,
+ BRAINPOOLP384R1,
+ BRAINPOOLP512R1,
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppEventType.aidl
similarity index 61%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppEventType.aidl
index 0a93c9e..4b9b38b 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppEventType.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -14,20 +14,14 @@
* limitations under the License.
*/
-package android.hardware.graphics.composer3;
+package android.hardware.wifi.supplicant;
/**
- * Special index values (always negative) for command queue commands.
+ * DppEventType: Major events for DPP (Easy Connect) Configurator
*/
@VintfStability
@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+enum DppEventType {
+ CONFIGURATION_SENT,
+ CONFIGURATION_APPLIED,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppFailureCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppFailureCode.aidl
new file mode 100644
index 0000000..5c0c6e8
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppFailureCode.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * DppFailureCode: Error codes for DPP (Easy Connect)
+ */
+@VintfStability
+@Backing(type="int")
+enum DppFailureCode {
+ INVALID_URI,
+ AUTHENTICATION,
+ NOT_COMPATIBLE,
+ CONFIGURATION,
+ BUSY,
+ TIMEOUT,
+ FAILURE,
+ NOT_SUPPORTED,
+ CONFIGURATION_REJECTED,
+ CANNOT_FIND_NETWORK,
+ ENROLLEE_AUTHENTICATION,
+ /**
+ * Failure to generate a DPP URI.
+ */
+ URI_GENERATION,
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppNetRole.aidl
similarity index 61%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppNetRole.aidl
index 0a93c9e..d92cfa3 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppNetRole.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -14,20 +14,14 @@
* limitations under the License.
*/
-package android.hardware.graphics.composer3;
+package android.hardware.wifi.supplicant;
/**
- * Special index values (always negative) for command queue commands.
+ * DppNetRole: The network role that the configurator offers the enrollee.
*/
@VintfStability
@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+enum DppNetRole {
+ STA,
+ AP,
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppProgressCode.aidl
similarity index 61%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppProgressCode.aidl
index 0a93c9e..f8b35c0 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppProgressCode.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -14,20 +14,16 @@
* limitations under the License.
*/
-package android.hardware.graphics.composer3;
+package android.hardware.wifi.supplicant;
/**
- * Special index values (always negative) for command queue commands.
+ * DppProgressCode: Progress codes for DPP (Easy Connect)
*/
@VintfStability
@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+enum DppProgressCode {
+ AUTHENTICATION_SUCCESS,
+ RESPONSE_PENDING,
+ CONFIGURATION_SENT_WAITING_RESPONSE,
+ CONFIGURATION_ACCEPTED,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppResponderBootstrapInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppResponderBootstrapInfo.aidl
new file mode 100644
index 0000000..4f4778d
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/DppResponderBootstrapInfo.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * DPP bootstrap info generated for responder mode operation
+ */
+@VintfStability
+parcelable DppResponderBootstrapInfo {
+ /**
+ * Generated bootstrap identifier
+ */
+ int bootstrapId;
+ /**
+ * The Wi-Fi channel that the DPP responder is listening on.
+ */
+ int listenChannel;
+ /**
+ * Bootstrapping URI per DPP specification, "section 5.2 Bootstrapping
+ * information", may contain listen channel, MAC address, public key, or other information.
+ */
+ String uri;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/EapErrorCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/EapErrorCode.aidl
new file mode 100644
index 0000000..49f9e34
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/EapErrorCode.aidl
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/*
+ * EapErrorCode: Error code for EAP or EAP Method as per RFC-4186
+ */
+@VintfStability
+@Backing(type="int")
+enum EapErrorCode {
+ SIM_GENERAL_FAILURE_AFTER_AUTH = 0,
+ SIM_TEMPORARILY_DENIED = 1026,
+ SIM_NOT_SUBSCRIBED = 1031,
+ SIM_GENERAL_FAILURE_BEFORE_AUTH = 16384,
+ SIM_VENDOR_SPECIFIC_EXPIRED_CERT = 16385,
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/EapMethod.aidl
similarity index 61%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/EapMethod.aidl
index 0a93c9e..351fb6c 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/EapMethod.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -14,20 +14,20 @@
* limitations under the License.
*/
-package android.hardware.graphics.composer3;
+package android.hardware.wifi.supplicant;
/**
- * Special index values (always negative) for command queue commands.
+ * Possble values for EapMethod param.
*/
@VintfStability
@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+enum EapMethod {
+ PEAP = 0,
+ TLS = 1,
+ TTLS = 2,
+ PWD = 3,
+ SIM = 4,
+ AKA = 5,
+ AKA_PRIME = 6,
+ WFA_UNAUTH_TLS = 7,
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/EapPhase2Method.aidl
similarity index 61%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/EapPhase2Method.aidl
index 0a93c9e..a7eeca8 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/EapPhase2Method.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -14,20 +14,20 @@
* limitations under the License.
*/
-package android.hardware.graphics.composer3;
+package android.hardware.wifi.supplicant;
/**
- * Special index values (always negative) for command queue commands.
+ * Possble values for Phase2Method param.
*/
@VintfStability
@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+enum EapPhase2Method {
+ NONE = 0,
+ PAP = 1,
+ MSPAP = 2,
+ MSPAPV2 = 3,
+ GTC = 4,
+ SIM = 5,
+ AKA = 6,
+ AKA_PRIME = 7,
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ExtRadioWorkDefaults.aidl
similarity index 60%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/ExtRadioWorkDefaults.aidl
index 0a93c9e..7325ba2 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ExtRadioWorkDefaults.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -14,20 +14,10 @@
* limitations under the License.
*/
-package android.hardware.graphics.composer3;
+package android.hardware.wifi.supplicant;
-/**
- * Special index values (always negative) for command queue commands.
- */
@VintfStability
@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+enum ExtRadioWorkDefaults {
+ TIMEOUT_IN_SECS = 10,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/FreqRange.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/FreqRange.aidl
new file mode 100644
index 0000000..a88c011
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/FreqRange.aidl
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Use to specify a range of frequencies.
+ * For example: 2412-2432,2462,5000-6000, etc.
+ */
+@VintfStability
+parcelable FreqRange {
+ int min;
+ int max;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/GroupCipherMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/GroupCipherMask.aidl
new file mode 100644
index 0000000..d5b26ad
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/GroupCipherMask.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Possible mask of values for GroupCipher param.
+ * See /external/wpa_supplicant_8/src/common/defs.h for
+ * all possible values (starting at WPA_CIPHER_WEP40).
+ */
+@VintfStability
+@Backing(type="int")
+enum GroupCipherMask {
+ WEP40 = 1 << 1,
+ WEP104 = 1 << 2,
+ TKIP = 1 << 3,
+ CCMP = 1 << 4,
+ GTK_NOT_USED = 1 << 14,
+ /**
+ * GCMP-256 Group Cipher
+ */
+ GCMP_256 = 1 << 8,
+ /**
+ * SMS4 Group Cipher
+ */
+ SMS4 = 1 << 7,
+ /**
+ * GCMP-128 Group Cipher
+ */
+ GCMP_128 = 1 << 6,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl
new file mode 100644
index 0000000..07544f0
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Possble mask of values for GroupMgmtCipher param.
+ * See /external/wpa_supplicant_8/src/common/defs.h for
+ * all possible values (starting at WPA_CIPHER_BIP_GMAC_128).
+ */
+@VintfStability
+@Backing(type="int")
+enum GroupMgmtCipherMask {
+ /**
+ * BIP_GMAC-128 Group Management Cipher
+ */
+ BIP_GMAC_128 = 1 << 11,
+ /**
+ * BIP_GMAC-256 Group Management Cipher
+ */
+ BIP_GMAC_256 = 1 << 12,
+ /**
+ * BIP_CMAC-256 Group Management Cipher
+ */
+ BIP_CMAC_256 = 1 << 13,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/GsmRand.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/GsmRand.aidl
new file mode 100644
index 0000000..4e31323
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/GsmRand.aidl
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Byte array with expected length 16. Used by NetworkRequestEapSimGsmAuthParams
+ * to pass an array of byte arrays, as 2D arrays are not supported in AIDL.
+ *
+ * TODO (b/210705533): Replace this type with a 2D byte array.
+ */
+@VintfStability
+parcelable GsmRand {
+ byte[/* 16 */] data;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/Hs20AnqpData.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/Hs20AnqpData.aidl
new file mode 100644
index 0000000..bdb9ec6
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/Hs20AnqpData.aidl
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * ANQP data for Hotspot 2.0.
+ * The format of the data within these elements follows the Hotspot 2.0
+ * standard.
+ */
+@VintfStability
+parcelable Hs20AnqpData {
+ byte[] operatorFriendlyName;
+ byte[] wanMetrics;
+ byte[] connectionCapability;
+ byte[] osuProvidersList;
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/Hs20AnqpSubtypes.aidl
similarity index 60%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/Hs20AnqpSubtypes.aidl
index 0a93c9e..e08411d 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/Hs20AnqpSubtypes.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -14,20 +14,17 @@
* limitations under the License.
*/
-package android.hardware.graphics.composer3;
+package android.hardware.wifi.supplicant;
/**
- * Special index values (always negative) for command queue commands.
+ * Access Network Query Protocol subtype elements
+ * for Hotspot 2.0.
*/
@VintfStability
@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+enum Hs20AnqpSubtypes {
+ OPERATOR_FRIENDLY_NAME = 3,
+ WAN_METRICS = 4,
+ CONNECTION_CAPABILITY = 5,
+ OSU_PROVIDERS_LIST = 8,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicant.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicant.aidl
new file mode 100644
index 0000000..2ac1db7
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicant.aidl
@@ -0,0 +1,161 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.DebugLevel;
+import android.hardware.wifi.supplicant.ISupplicantCallback;
+import android.hardware.wifi.supplicant.ISupplicantP2pIface;
+import android.hardware.wifi.supplicant.ISupplicantStaIface;
+import android.hardware.wifi.supplicant.IfaceInfo;
+import android.hardware.wifi.supplicant.IfaceType;
+
+/**
+ * Interface exposed by the supplicant AIDL service registered
+ * with the service manager. This is the root level object for
+ * any of the supplicant interactions.
+ */
+@VintfStability
+interface ISupplicant {
+ /**
+ * Default timeout (in seconds) for external radio work.
+ */
+ const int EXT_RADIO_WORK_TIMEOUT_IN_SECS = 10;
+
+ /**
+ * Registers a wireless interface in supplicant.
+ *
+ * @param ifName Name of the interface (e.g wlan0).
+ * @return AIDL interface object representing the interface if
+ * successful, null otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_EXISTS|
+ */
+ ISupplicantP2pIface addP2pInterface(in String ifName);
+ ISupplicantStaIface addStaInterface(in String ifName);
+
+ /**
+ * Get the debug level set.
+ *
+ * @return one of |DebugLevel| values.
+ */
+ DebugLevel getDebugLevel();
+
+ /**
+ * Gets an AIDL interface object for the interface corresponding
+ * to an iface name which the supplicant already controls.
+ *
+ * @param ifName Name of the interface retrieved
+ * using |listInterfaces|.
+ * @return AIDL interface object representing the interface if
+ * successful, null otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_UNKNOWN|
+ */
+ ISupplicantP2pIface getP2pInterface(in String ifName);
+ ISupplicantStaIface getStaInterface(in String ifName);
+
+ /**
+ * Get whether the keys are shown in the debug logs or not.
+ *
+ * @return true if set, false otherwise.
+ */
+ boolean isDebugShowKeysEnabled();
+
+ /**
+ * Get whether the timestamps are shown in the debug logs or not.
+ *
+ * @return true if set, false otherwise.
+ */
+ boolean isDebugShowTimestampEnabled();
+
+ /**
+ * Retrieve a list of all interfaces controlled by the supplicant.
+ *
+ * The corresponding |ISupplicantIface| object for any interface can be
+ * retrieved using the proper |getInterface| method.
+ *
+ * @return List of all interfaces controlled by the supplicant.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ IfaceInfo[] listInterfaces();
+
+ /**
+ * Register for callbacks from the supplicant service.
+ *
+ * These callbacks are invoked for global events that are not specific
+ * to any interface or network. Registration of multiple callback
+ * objects is supported. These objects must be deleted when the corresponding
+ * client process is dead.
+ *
+ * @param callback An instance of the |ISupplicantCallback| AIDL interface
+ * object.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void registerCallback(in ISupplicantCallback callback);
+
+ /**
+ * Deregisters a wireless interface from supplicant.
+ *
+ * @param ifaceInfo Combination of the interface type and name (e.g wlan0).
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_UNKNOWN|
+ */
+ void removeInterface(in IfaceInfo ifaceInfo);
+
+ /**
+ * Set concurrency priority.
+ *
+ * When both P2P and STA mode ifaces are active, this must be used
+ * to prioritize either STA or P2P connection to resolve conflicts
+ * arising during single channel concurrency.
+ *
+ * @param type The type of iface to prioritize.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setConcurrencyPriority(in IfaceType type);
+
+ /**
+ * Set debug parameters for the supplicant.
+ *
+ * @param level Debug logging level for the supplicant.
+ * (one of |DebugLevel| values).
+ * @param timestamp Determines whether to show timestamps in logs or
+ * not.
+ * @param showKeys Determines whether to show keys in debug logs or
+ * not.
+ * CAUTION: Do not set this param in production code!
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setDebugParams(in DebugLevel level, in boolean showTimestamp, in boolean showKeys);
+
+ /**
+ * Terminate the service.
+ * This must de-register the service and clear all state. If this HAL
+ * supports the lazy HAL protocol, then this may trigger daemon to exit and
+ * wait to be restarted.
+ */
+ oneway void terminate();
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantCallback.aidl
new file mode 100644
index 0000000..6f15900
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantCallback.aidl
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Callback Interface exposed by the supplicant service (ISupplicant).
+ *
+ * Clients need to host an instance of this AIDL interface object and
+ * pass a reference of the object to the supplicant via the
+ * |ISupplicant.registerCallback| method.
+ */
+@VintfStability
+interface ISupplicantCallback {
+ /**
+ * Used to indicate that a new interface has been created.
+ *
+ * @param ifaceName Name of the network interface, e.g., wlan0
+ */
+ oneway void onInterfaceCreated(in String ifaceName);
+
+ /**
+ * Used to indicate that an interface has been removed.
+ *
+ * @param ifaceName Name of the network interface, e.g., wlan0
+ */
+ oneway void onInterfaceRemoved(in String ifaceName);
+
+ /**
+ * Used to indicate that the supplicant daemon is terminating.
+ */
+ oneway void onTerminating();
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
new file mode 100644
index 0000000..64839e7
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
@@ -0,0 +1,770 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.FreqRange;
+import android.hardware.wifi.supplicant.ISupplicantP2pIfaceCallback;
+import android.hardware.wifi.supplicant.ISupplicantP2pNetwork;
+import android.hardware.wifi.supplicant.IfaceType;
+import android.hardware.wifi.supplicant.MiracastMode;
+import android.hardware.wifi.supplicant.P2pGroupCapabilityMask;
+import android.hardware.wifi.supplicant.WpsConfigMethods;
+import android.hardware.wifi.supplicant.WpsProvisionMethod;
+
+/**
+ * Interface exposed by the supplicant for each P2P mode network
+ * interface (e.g p2p0) it controls.
+ */
+@VintfStability
+interface ISupplicantP2pIface {
+ /**
+ * This command can be used to add a bonjour service.
+ *
+ * @param query Hex dump of the query data.
+ * @param return Hex dump of the response data.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void addBonjourService(in byte[] query, in byte[] response);
+
+ /**
+ * Set up a P2P group owner manually (i.e., without group owner
+ * negotiation with a specific peer). This is also known as autonomous
+ * group owner. Optional |persistentNetworkId| may be used to specify
+ * restart of a persistent group.
+ *
+ * @param persistent Used to request a persistent group to be formed.
+ * @param persistentNetworkId Used to specify the restart of a persistent
+ * group. Set to UINT32_MAX for a non-persistent group.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void addGroup(in boolean persistent, in int persistentNetworkId);
+
+ /**
+ * Set up a P2P group owner or join a group as a group client
+ * with the specified configuration.
+ *
+ * If joinExistingGroup is false, this device sets up a P2P group owner manually (i.e.,
+ * without group owner negotiation with a specific peer) with the specified SSID,
+ * passphrase, persistent mode, and frequency/band.
+ *
+ * If joinExistingGroup is true, this device acts as a group client and joins the group
+ * whose network name and group owner's MAC address matches the specified SSID
+ * and peer address without WPS process. If peerAddress is 00:00:00:00:00:00, the first found
+ * group whose network name matches the specified SSID is joined.
+ *
+ * @param ssid The SSID of this group.
+ * @param pskPassphrase The passphrase of this group.
+ * @param persistent Used to request a persistent group to be formed,
+ * only applied for the group owner.
+ * @param freq The required frequency or band for this group.
+ * only applied for the group owner.
+ * The following values are supported:
+ * 0: automatic channel selection,
+ * 2: for 2.4GHz channels
+ * 5: for 5GHz channels
+ * specific frequency, i.e., 2412, 5500, etc.
+ * If an invalid band or unsupported frequency are specified, it fails.
+ * @param peerAddress the group owner's MAC address, only applied for the group client.
+ * If the MAC is "00:00:00:00:00:00", the device must try to find a peer
+ * whose network name matches the specified SSID.
+ * @param joinExistingGroup if true, join a group as a group client; otherwise,
+ * create a group as a group owner.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void addGroupWithConfig(in byte[] ssid, in String pskPassphrase, in boolean persistent,
+ in int freq, in byte[] peerAddress, in boolean joinExistingGroup);
+
+ /**
+ * Add a new network to the interface.
+ *
+ * @return AIDL interface object representing the new network if
+ * successful, null otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ ISupplicantP2pNetwork addNetwork();
+
+ /**
+ * This command can be used to add a UPNP service.
+ *
+ * @param version Version to be used.
+ * @package serviceName Service name to be used.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void addUpnpService(in int version, in String serviceName);
+
+ /**
+ * Cancel an ongoing P2P group formation and joining-a-group related
+ * operation. This operation unauthorizes the specific peer device (if any
+ * had been authorized to start group formation), stops P2P find (if in
+ * progress), stops pending operations for join-a-group, and removes the
+ * P2P group interface (if one was used) that is in the WPS provisioning
+ * step. If the WPS provisioning step has been completed, the group is not
+ * terminated.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NOT_STARTED|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void cancelConnect();
+
+ /**
+ * Cancel a previous service discovery request.
+ *
+ * @param identifier Identifier for the request to cancel.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NOT_STARTED|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void cancelServiceDiscovery(in long identifier);
+
+ /**
+ * Cancel any ongoing WPS operations.
+ *
+ * @param groupIfName Group interface name to use.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void cancelWps(in String groupIfName);
+
+ /**
+ * Configure Extended Listen Timing.
+ *
+ * If enabled, listen state must be entered every |intervalInMillis| for at
+ * least |periodInMillis|. Both values have acceptable range of 1-65535
+ * (with interval obviously having to be larger than or equal to duration).
+ * If the P2P module is not idle at the time the Extended Listen Timing
+ * timeout occurs, the Listen State operation must be skipped.
+ *
+ * @param periodInMillis Period in milliseconds.
+ * @param intervalInMillis Interval in milliseconds.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void configureExtListen(in int periodInMillis, in int intervalInMillis);
+
+ /**
+ * Start P2P group formation with a discovered P2P peer. This includes
+ * optional group owner negotiation, group interface setup, provisioning,
+ * and establishing data connection.
+ *
+ * @param peerAddress MAC address of the device to connect to.
+ * @param provisionMethod Provisioning method to use.
+ * @param preSelectedPin Pin to be used, if |provisionMethod| uses one of the
+ * preselected |PIN*| methods.
+ * @param joinExistingGroup Indicates that this is a command to join an
+ * existing group as a client. It skips the group owner negotiation
+ * part. This must send a Provision Discovery Request message to the
+ * target group owner before associating for WPS provisioning.
+ * @param persistent Used to request a persistent group to be formed.
+ * @param goIntent Used to override the default Intent for this group owner
+ * negotiation (Values from 1-15). Refer to section 4.1.6 in
+ * Wi-Fi Peer-to-Peer (P2P) Technical Specification Version 1.7.
+ * @return Pin generated, if |provisionMethod| uses one of the
+ * generated |PIN*| methods.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ String connect(in byte[] peerAddress, in WpsProvisionMethod provisionMethod,
+ in String preSelectedPin, in boolean joinExistingGroup, in boolean persistent,
+ in int goIntent);
+
+ /**
+ * Creates a NFC handover request message.
+ *
+ * @return Bytes representing the handover request as specified in
+ * section 3.1.1 of NFC Connection Handover 1.2 Technical
+ * Specification.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ byte[] createNfcHandoverRequestMessage();
+
+ /**
+ * Creates a NFC handover select message.
+ *
+ * @return Bytes representing the handover select as specified in
+ * section 3.1.2 of NFC Connection Handover 1.2 Technical
+ * Specification.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ byte[] createNfcHandoverSelectMessage();
+
+ /**
+ * Enable/Disable Wifi Display.
+ *
+ * @param enable true to enable, false to disable.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void enableWfd(in boolean enable);
+
+ /**
+ * Initiate a P2P service discovery with an optional timeout.
+ *
+ * @param timeoutInSec Max time to be spent is performing discovery.
+ * Set to 0 to indefinely continue discovery until an explicit
+ * |stopFind| is sent.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
+ */
+ void find(in int timeoutInSec);
+
+ /**
+ * Flush P2P peer table and state.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void flush();
+
+ /**
+ * This command can be used to flush all services from the
+ * device.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void flushServices();
+
+ /**
+ * Gets the MAC address of the device.
+ *
+ * @return MAC address of the device.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ byte[] getDeviceAddress();
+
+ /**
+ * Get whether EDMG(802.11ay) is enabled for this network.
+ *
+ * @return true if set, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ boolean getEdmg();
+
+ /**
+ * Gets the capability of the group which the device is a
+ * member of.
+ *
+ * @param peerAddress MAC address of the peer.
+ * @return Combination of |P2pGroupCapabilityMask| values.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ P2pGroupCapabilityMask getGroupCapability(in byte[] peerAddress);
+
+ /**
+ * Retrieves the name of the network interface.
+ *
+ * @return Name of the network interface, e.g., wlan0
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ String getName();
+
+ /**
+ * Gets an AIDL interface object for the network corresponding to the
+ * network id.
+ *
+ * Use |ISupplicantP2pNetwork.getId()| on the corresponding network AIDL
+ * interface object to retrieve the ID.
+ *
+ * @param id Network ID allocated to the corresponding network.
+ * @return AIDL interface object representing the new network if
+ * successful, null otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_UNKNOWN|
+ */
+ ISupplicantP2pNetwork getNetwork(in int id);
+
+ /**
+ * Gets the operational SSID of the device.
+ *
+ * @param peerAddress MAC address of the peer.
+ * @return SSID of the device
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ byte[] getSsid(in byte[] peerAddress);
+
+ /**
+ * Retrieves the type of the network interface.
+ *
+ * @return Type of the network interface, e.g., STA.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ IfaceType getType();
+
+ /**
+ * Invite a device to a persistent group.
+ * If the peer device is the group owner of the persistent group, the peer
+ * parameter is not needed. Otherwise it is used to specify which
+ * device to invite. |goDeviceAddress| parameter may be used to override
+ * the group owner device address for Invitation Request should it not be
+ * known for some reason (this should not be needed in most cases).
+ *
+ * @param groupIfName Group interface name to use.
+ * @param goDeviceAddress MAC address of the group owner device.
+ * @param peerAddress MAC address of the device to invite.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void invite(in String groupIfName, in byte[] goDeviceAddress, in byte[] peerAddress);
+
+ /**
+ * Retrieve a list of all the network Id's controlled by the supplicant.
+ *
+ * The corresponding |ISupplicantP2pNetwork| object for any network can be
+ * retrieved using the |getNetwork| method.
+ *
+ * @return List of all network Id's controlled by the supplicant.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ int[] listNetworks();
+
+ /**
+ * Send P2P provision discovery request to the specified peer. The
+ * parameters for this command are the P2P device address of the peer and the
+ * desired configuration method.
+ *
+ * @param peerAddress MAC address of the device to send discovery.
+ * @method provisionMethod Provisioning method to use.
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void provisionDiscovery(in byte[] peerAddress, in WpsProvisionMethod provisionMethod);
+
+ /**
+ * Register for callbacks from this interface.
+ *
+ * These callbacks are invoked for events that are specific to this interface.
+ * Registration of multiple callback objects is supported. These objects must
+ * be automatically deleted when the corresponding client process is dead or
+ * if this interface is removed.
+ *
+ * @param callback An instance of the |ISupplicantP2pIfaceCallback| AIDL
+ * interface object.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void registerCallback(in ISupplicantP2pIfaceCallback callback);
+
+ /**
+ * Reinvoke a device from a persistent group.
+ *
+ * @param persistentNetworkId Used to specify the persistent group.
+ * @param peerAddress MAC address of the device to reinvoke.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void reinvoke(in int persistentNetworkId, in byte[] peerAddress);
+
+ /**
+ * Reject connection attempt from a peer (specified with a device
+ * address). This is a mechanism to reject a pending group owner negotiation
+ * with a peer and request to automatically block any further connection or
+ * discovery of the peer.
+ *
+ * @param peerAddress MAC address of the device to reject.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
+ */
+ void reject(in byte[] peerAddress);
+
+ /**
+ * This command can be used to remove a bonjour service.
+ *
+ * @param query Hex dump of the query data.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NOT_STARTED|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void removeBonjourService(in byte[] query);
+
+ /**
+ * Terminate a P2P group. If a new virtual network interface was used for
+ * the group, it must also be removed. The network interface name of the
+ * group interface is used as a parameter for this command.
+ *
+ * @param groupIfName Group interface name to use.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void removeGroup(in String groupIfName);
+
+ /**
+ * Remove a network from the interface.
+ *
+ * Use |ISupplicantP2pNetwork.getId()| on the corresponding network AIDL
+ * interface object to retrieve the ID.
+ *
+ * @param id Network ID allocated to the corresponding network.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_UNKNOWN|
+ */
+ void removeNetwork(in int id);
+
+ /**
+ * This command can be used to remove a UPNP service.
+ *
+ * @param version Version to be used.
+ * @package serviceName Service name to be used.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NOT_STARTED|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void removeUpnpService(in int version, in String serviceName);
+
+ /**
+ * Report the initiation of the NFC handover select.
+ *
+ * @param select Bytes representing the handover select as specified in
+ * section 3.1.2 of NFC Connection Handover 1.2 Technical
+ * Specification.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void reportNfcHandoverInitiation(in byte[] select);
+
+ /**
+ * Report the response of the NFC handover request.
+ *
+ * @param request Bytes representing the handover request as specified in
+ * section 3.1.1 of NFC Connection Handover 1.2 Technical
+ * Specification.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void reportNfcHandoverResponse(in byte[] request);
+
+ /**
+ * Schedule a P2P service discovery request. The parameters for this command
+ * are the device address of the peer device (or 00:00:00:00:00:00 for
+ * wildcard query that is sent to every discovered P2P peer that supports
+ * service discovery) and P2P Service Query TLV(s) as hexdump.
+ *
+ * @param peerAddress MAC address of the device to discover.
+ * @param query Hex dump of the query data.
+ * @return Identifier for the request. Can be used to cancel the
+ * request.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ long requestServiceDiscovery(in byte[] peerAddress, in byte[] query);
+
+ /**
+ * Persist the current configuration to disk.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void saveConfig();
+
+ /**
+ * Set P2P disallowed frequency ranges.
+ *
+ * Specify ranges of frequencies that are disallowed for any P2P operations.
+ *
+ * @param ranges List of ranges which needs to be disallowed.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void setDisallowedFrequencies(in FreqRange[] ranges);
+
+ /**
+ * Set whether to enable EDMG(802.11ay). Only allowed if hw mode is |HOSTAPD_MODE_IEEE80211AD|
+ *
+ * @param enable true to set, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEdmg(in boolean enable);
+
+ /**
+ * Set the Maximum idle time in seconds for P2P groups.
+ * This value controls how long a P2P group is maintained after there
+ * is no other members in the group. As a group owner, this means no
+ * associated stations in the group. As a P2P client, this means no
+ * group owner seen in scan results.
+ *
+ * @param groupIfName Group interface name to use.
+ * @param timeoutInSec Timeout value in seconds.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void setGroupIdle(in String groupIfName, in int timeoutInSec);
+
+ /**
+ * Set P2P Listen channel.
+ *
+ * When specifying a social channel on the 2.4 GHz band (1/6/11) there is no
+ * need to specify the operating class since it defaults to 81. When
+ * specifying a social channel on the 60 GHz band (2), specify the 60 GHz
+ * operating class (180).
+ *
+ * @param channel Wifi channel. eg, 1, 6, 11.
+ * @param operatingClass Operating Class indicates the channel set of the AP
+ * indicated by this BSSID
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void setListenChannel(in int channel, in int operatingClass);
+
+ /**
+ * Set MAC randomization enabled/disabled.
+ *
+ * @param enable true to enable, false to disable.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void setMacRandomization(in boolean enable);
+
+ /**
+ * Send driver command to set Miracast mode.
+ *
+ * @param mode Mode of Miracast.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void setMiracastMode(in MiracastMode mode);
+
+ /**
+ * Turn on/off power save mode for the interface.
+ *
+ * @param groupIfName Group interface name to use.
+ * @param enable Indicate if power save is to be turned on/off.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
+ */
+ void setPowerSave(in String groupIfName, in boolean enable);
+
+ /**
+ * Set the postfix to be used for P2P SSID's.
+ *
+ * @param postfix String to be appended to SSID.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void setSsidPostfix(in byte[] postfix);
+
+ /**
+ * Set Wifi Display device info.
+ *
+ * @param info WFD device info as described in section 5.1.2 of WFD technical
+ * specification v1.0.0.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void setWfdDeviceInfo(in byte[] info);
+
+ /**
+ * Set Wifi Display R2 device info.
+ *
+ * @param info WFD R2 device info as described in section 5.1.12 of WFD technical
+ * specification v2.1.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void setWfdR2DeviceInfo(in byte[] info);
+
+ /**
+ * Set the list of supported config methods for WPS operations.
+ *
+ * @param configMethods Mask of WPS configuration methods supported by the
+ * device.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setWpsConfigMethods(in WpsConfigMethods configMethods);
+
+ /**
+ * Set the device name for WPS operations.
+ * User-friendly description of device (up to |WPS_DEVICE_NAME_MAX_LEN|
+ * octets encoded in UTF-8).
+ *
+ * @param name Name to be set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setWpsDeviceName(in String name);
+
+ /**
+ * Set the device type for WPS operations.
+ *
+ * @param type Type of device. Refer to section B.1 of Wifi P2P
+ * Technical specification v1.2.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setWpsDeviceType(in byte[] type);
+
+ /**
+ * Set the manufacturer for WPS operations.
+ * The manufacturer of the device (up to |WPS_MANUFACTURER_MAX_LEN| ASCII
+ * characters).
+ *
+ * @param manufacturer Manufacture to be set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setWpsManufacturer(in String manufacturer);
+
+ /**
+ * Set the model name for WPS operations.
+ * Model of the device (up to |WPS_MODEL_NAME_MAX_LEN| ASCII characters).
+ *
+ * @param modelName Model name to be set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setWpsModelName(in String modelName);
+
+ /**
+ * Set the model number for WPS operations.
+ * Additional device description (up to |WPS_MODEL_NUMBER_MAX_LEN| ASCII
+ * characters).
+ *
+ * @param modelNumber Model number to be set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setWpsModelNumber(in String modelNumber);
+
+ /**
+ * Set the serial number for WPS operations.
+ * Serial number of the device (up to |WPS_SERIAL_NUMBER_MAX_LEN| characters)
+ *
+ * @param serialNumber Serial number to be set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setWpsSerialNumber(in String serialNumber);
+
+ /**
+ * Initiate WPS Push Button setup.
+ * The PBC operation requires that a button is also pressed at the
+ * AP/Registrar at about the same time (2 minute window).
+ *
+ * @param groupIfName Group interface name to use.
+ * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void startWpsPbc(in String groupIfName, in byte[] bssid);
+
+ /**
+ * Initiate WPS Pin Display setup.
+ *
+ * @param groupIfName Group interface name to use.
+ * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
+ * @return 8 digit pin generated.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ String startWpsPinDisplay(in String groupIfName, in byte[] bssid);
+
+ /**
+ * Initiate WPS Pin Keypad setup.
+ *
+ * @param groupIfName Group interface name to use.
+ * @param pin 8 digit pin to be used.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void startWpsPinKeypad(in String groupIfName, in String pin);
+
+ /**
+ * Stop an ongoing P2P service discovery.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
+ */
+ void stopFind();
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
new file mode 100644
index 0000000..f0cabd6
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
@@ -0,0 +1,208 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.P2pGroupCapabilityMask;
+import android.hardware.wifi.supplicant.P2pProvDiscStatusCode;
+import android.hardware.wifi.supplicant.P2pStatusCode;
+import android.hardware.wifi.supplicant.WpsConfigMethods;
+import android.hardware.wifi.supplicant.WpsDevPasswordId;
+
+/**
+ * Callback Interface exposed by the supplicant service
+ * for each P2P mode interface (ISupplicantP2pIface).
+ *
+ * Clients need to host an instance of this AIDL interface object and
+ * pass a reference of the object to the supplicant via the
+ * corresponding |ISupplicantP2pIface.registerCallback| method.
+ */
+@VintfStability
+interface ISupplicantP2pIfaceCallback {
+ /**
+ * Used to indicate that a P2P device has been found.
+ *
+ * @param srcAddress MAC address of the device found. This must either
+ * be the P2P device address or the P2P interface address.
+ * @param p2pDeviceAddress P2P device address.
+ * @param primaryDeviceType Type of device. Refer to section B.1 of Wifi P2P
+ * Technical specification v1.2.
+ * @param deviceName Name of the device.
+ * @param configMethods Mask of WPS configuration methods supported by the
+ * device.
+ * @param deviceCapabilities Refer to section 4.1.4 of Wifi P2P Technical
+ * specification v1.2.
+ * @param groupCapabilites Refer to section 4.1.4 of Wifi P2P Technical
+ * specification v1.2.
+ * @param wfdDeviceInfo WFD device info as described in section 5.1.2 of WFD
+ * technical specification v1.0.0.
+ */
+ oneway void onDeviceFound(in byte[] srcAddress, in byte[] p2pDeviceAddress,
+ in byte[] primaryDeviceType, in String deviceName, in WpsConfigMethods configMethods,
+ in byte deviceCapabilities, in P2pGroupCapabilityMask groupCapabilities,
+ in byte[] wfdDeviceInfo);
+
+ /**
+ * Used to indicate that a P2P device has been lost.
+ *
+ * @param p2pDeviceAddress P2P device address.
+ */
+ oneway void onDeviceLost(in byte[] p2pDeviceAddress);
+
+ /**
+ * Used to indicate the termination of P2P find operation.
+ */
+ oneway void onFindStopped();
+
+ /**
+ * Used to indicate the completion of a P2P Group Owner negotiation request.
+ *
+ * @param status Status of the GO negotiation.
+ */
+ oneway void onGoNegotiationCompleted(in P2pStatusCode status);
+
+ /**
+ * Used to indicate the reception of a P2P Group Owner negotiation request.
+ *
+ * @param srcAddress MAC address of the device that initiated the GO
+ * negotiation request.
+ * @param passwordId Type of password.
+ */
+ oneway void onGoNegotiationRequest(in byte[] srcAddress, in WpsDevPasswordId passwordId);
+
+ /**
+ * Used to indicate a failure to form a P2P group.
+ *
+ * @param failureReason Failure reason string for debug purposes.
+ */
+ oneway void onGroupFormationFailure(in String failureReason);
+
+ /**
+ * Used to indicate a successful formation of a P2P group.
+ */
+ oneway void onGroupFormationSuccess();
+
+ /**
+ * Used to indicate the removal of a P2P group.
+ *
+ * @param groupIfName Interface name of the group. (For ex: p2p-p2p0-1)
+ * @param isGroupOwner Whether this device is owner of the group.
+ */
+ oneway void onGroupRemoved(in String groupIfname, in boolean isGroupOwner);
+
+ /**
+ * Used to indicate the start of a P2P group.
+ *
+ * @param groupIfName Interface name of the group. (For ex: p2p-p2p0-1)
+ * @param isGroupOwner Whether this device is owner of the group.
+ * @param ssid SSID of the group.
+ * @param frequency Frequency on which this group is created.
+ * @param psk PSK used to secure the group.
+ * @param passphrase PSK passphrase used to secure the group.
+ * @param goDeviceAddress MAC Address of the owner of this group.
+ * @param isPersistent Whether this group is persisted or not.
+ */
+ oneway void onGroupStarted(in String groupIfname, in boolean isGroupOwner, in byte[] ssid,
+ in int frequency, in byte[] psk, in String passphrase, in byte[] goDeviceAddress,
+ in boolean isPersistent);
+
+ /**
+ * Used to indicate the reception of a P2P invitation.
+ *
+ * @param srcAddress MAC address of the device that sent the invitation.
+ * @param goDeviceAddress MAC Address of the owner of this group.
+ * @param bssid Bssid of the group.
+ * @param persistentNetworkId Persistent network Id of the group.
+ * @param operatingFrequency Frequency on which the invitation was received.
+ */
+ oneway void onInvitationReceived(in byte[] srcAddress, in byte[] goDeviceAddress,
+ in byte[] bssid, in int persistentNetworkId, in int operatingFrequency);
+
+ /**
+ * Used to indicate the result of the P2P invitation request.
+ *
+ * @param bssid Bssid of the group.
+ * @param status Status of the invitation.
+ */
+ oneway void onInvitationResult(in byte[] bssid, in P2pStatusCode status);
+
+ /**
+ * Used to indicate the completion of a P2P provision discovery request.
+ *
+ * @param p2pDeviceAddress P2P device address.
+ * @param isRequest Whether we received or sent the provision discovery.
+ * @param status Status of the provision discovery.
+ * @param configMethods Mask of WPS configuration methods supported.
+ * @param generatedPin 8 digit pin generated.
+ */
+ oneway void onProvisionDiscoveryCompleted(in byte[] p2pDeviceAddress, in boolean isRequest,
+ in P2pProvDiscStatusCode status, in WpsConfigMethods configMethods,
+ in String generatedPin);
+
+ /**
+ * Used to indicate that a P2P Wi-Fi Display R2 device has been found. Refer to
+ * Wi-Fi Display Technical Specification Version 2.0.
+ *
+ * @param srcAddress MAC address of the device found. This must either
+ * be the P2P device address for a peer which is not in a group,
+ * or the P2P interface address for a peer which is a Group Owner.
+ * @param p2pDeviceAddress P2P device address.
+ * @param primaryDeviceType Type of device. Refer to section B.1 of Wifi P2P
+ * Technical specification v1.2.
+ * @param deviceName Name of the device.
+ * @param configMethods Mask of WPS configuration methods supported by the
+ * device.
+ * @param deviceCapabilities Refer to section 4.1.4 of Wifi P2P Technical
+ * specification v1.2.
+ * @param groupCapabilites Refer to section 4.1.4 of Wifi P2P Technical
+ * specification v1.2.
+ * @param wfdDeviceInfo WFD device info as described in section 5.1.2 of WFD
+ * technical specification v1.0.0.
+ * @param wfdR2DeviceInfo WFD R2 device info as described in section 5.1.12 of WFD
+ * technical specification v2.1.
+ */
+ oneway void onR2DeviceFound(in byte[] srcAddress, in byte[] p2pDeviceAddress,
+ in byte[] primaryDeviceType, in String deviceName, in WpsConfigMethods configMethods,
+ in byte deviceCapabilities, in P2pGroupCapabilityMask groupCapabilities,
+ in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo);
+
+ /**
+ * Used to indicate the reception of a P2P service discovery response.
+ *
+ * @param srcAddress MAC address of the device that sent the service discovery.
+ * @param updateIndicator Service update indicator. Refer to section 3.1.3 of
+ * Wifi P2P Technical specification v1.2.
+ * @parm tlvs Refer to section 3.1.3.1 of Wifi P2P Technical specification v1.2.
+ */
+ oneway void onServiceDiscoveryResponse(
+ in byte[] srcAddress, in char updateIndicator, in byte[] tlvs);
+
+ /**
+ * Used to indicate when a STA device is connected to this device.
+ *
+ * @param srcAddress MAC address of the device that was authorized.
+ * @param p2pDeviceAddress P2P device address.
+ */
+ oneway void onStaAuthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress);
+
+ /**
+ * Used to indicate when a STA device is disconnected from this device.
+ *
+ * @param srcAddress MAC address of the device that was deauthorized.
+ * @param p2pDeviceAddress P2P device address.
+ */
+ oneway void onStaDeauthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress);
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pNetwork.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pNetwork.aidl
new file mode 100644
index 0000000..f037252
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pNetwork.aidl
@@ -0,0 +1,131 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.IfaceType;
+import android.hardware.wifi.supplicant.MacAddress;
+
+/**
+ * Interface exposed by the supplicant for each P2P mode network
+ * configuration it controls.
+ */
+@VintfStability
+interface ISupplicantP2pNetwork {
+ /**
+ * Get the BSSID set for this network.
+ *
+ * @return bssid Value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ byte[] getBssid();
+
+ /**
+ * Get the list of P2P Clients in a persistent group (GO).
+ * This is a list of P2P Clients (P2P Device Address) that have joined
+ * the persistent group. This is maintained on the GO for persistent
+ * group entries (disabled == 2).
+ *
+ * @return MAC addresses of the clients.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantP2ptusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ MacAddress[] getClientList();
+
+ /**
+ * Retrieves the ID allocated to this network by the supplicant.
+ *
+ * This is not the |SSID| of the network, but an internal identifier for
+ * this network used by the supplicant.
+ *
+ * @return Network ID.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ int getId();
+
+ /**
+ * Retrieves the name of the interface this network belongs to.
+ *
+ * @return Name of the network interface, e.g., wlan0
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ String getInterfaceName();
+
+ /**
+ * Getters for the various network params.
+ *
+ *
+ * Get SSID for this network.
+ *
+ * @return ssid value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ byte[] getSsid();
+
+ /**
+ * Retrieves the type of the interface this network belongs to.
+ *
+ * @return Type of the network interface, e.g., STA.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ IfaceType getType();
+
+ /**
+ * Check if the network is currently active one.
+ *
+ * @return true if current, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ boolean isCurrent();
+
+ /**
+ * Check if the device is the group owner of the network.
+ *
+ * @return true if group owner, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ boolean isGroupOwner();
+
+ /**
+ * Check if the network is marked persistent.
+ *
+ * @return true if persistent, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ boolean isPersistent();
+
+ /**
+ * Set the list of P2P Clients in a persistent group (GO).
+ * This is a list of P2P Clients (P2P Device Address) that have joined
+ * the persistent group. This is maintained on the GO for persistent
+ * group entries (disabled == 2).
+ *
+ * @param clients MAC address of the clients.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantP2ptusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setClientList(in MacAddress[] clients);
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
new file mode 100644
index 0000000..b48fa04
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
@@ -0,0 +1,715 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.AnqpInfoId;
+import android.hardware.wifi.supplicant.BtCoexistenceMode;
+import android.hardware.wifi.supplicant.ConnectionCapabilities;
+import android.hardware.wifi.supplicant.DppAkm;
+import android.hardware.wifi.supplicant.DppCurve;
+import android.hardware.wifi.supplicant.DppNetRole;
+import android.hardware.wifi.supplicant.DppResponderBootstrapInfo;
+import android.hardware.wifi.supplicant.Hs20AnqpSubtypes;
+import android.hardware.wifi.supplicant.ISupplicantStaIfaceCallback;
+import android.hardware.wifi.supplicant.ISupplicantStaNetwork;
+import android.hardware.wifi.supplicant.IfaceType;
+import android.hardware.wifi.supplicant.KeyMgmtMask;
+import android.hardware.wifi.supplicant.RxFilterType;
+import android.hardware.wifi.supplicant.WpaDriverCapabilitiesMask;
+import android.hardware.wifi.supplicant.WpsConfigMethods;
+
+/**
+ * Interface exposed by the supplicant for each station mode network
+ * interface (e.g wlan0) it controls.
+ */
+@VintfStability
+interface ISupplicantStaIface {
+ /**
+ * Add a DPP peer URI. URI is acquired externally, e.g. by scanning a QR code
+ *
+ * @param uri Peer's DPP URI.
+ * @return ID for the URI
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ int addDppPeerUri(in String uri);
+
+ /**
+ * External programs can request supplicant to not start offchannel
+ * operations during other tasks that may need exclusive control of the
+ * radio.
+ *
+ * This method can be used to reserve a slot for radio access. If freq is
+ * specified, other radio work items on the same channel can be completed in
+ * parallel. Otherwise, all other radio work items are blocked during
+ * execution. Timeout must be set to |ExtRadioWorkDefaults.TIMEOUT_IN_SECS|
+ * seconds by default to avoid blocking supplicant operations on the iface
+ * for excessive time. If a longer (or shorter) safety timeout is needed,
+ * that may be specified with the optional timeout parameter. This command
+ * returns an identifier for the radio work item.
+ *
+ * Once the radio work item has been started,
+ * |ISupplicant.onExtRadioWorkStart| callback is indicated that the external
+ * processing can start.
+ *
+ * @param name Name for the radio work being added.
+ * @param freqInMhz Frequency to specify. Set to 0 for all channels.
+ * @param timeoutInSec Timeout to specify. Set to 0 for default timeout.
+ * @return Identifier for this radio work.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ int addExtRadioWork(in String name, in int freqInMhz, in int timeoutInSec);
+
+ /**
+ * Add a new network to the interface.
+ *
+ * @return AIDL interface object representing the new network if
+ * successful, null otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ ISupplicantStaNetwork addNetwork();
+
+ /**
+ * Send driver command to add the specified RX filter.
+ *
+ * @param type Type of filter.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void addRxFilter(in RxFilterType type);
+
+ /**
+ * Cancel any ongoing WPS operations.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void cancelWps();
+
+ /**
+ * Disconnect from the current active network.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
+ */
+ void disconnect();
+
+ /**
+ * Enable/Disable auto reconnect to networks.
+ * Use this to prevent wpa_supplicant from trying to connect to networks
+ * on its own.
+ *
+ * @param enable true to enable, false to disable.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
+ */
+ void enableAutoReconnect(in boolean enable);
+
+ /**
+ * Add fast initial link setup (IEEE 802.11ai FILS) HLP packets.
+ * Use this to add higher layer protocol (HLP) packet in FILS (Re)Association Request frame
+ * (Eg: DHCP discover packet).
+ *
+ * @param dst_mac MAC address of the destination
+ * @param pkt The contents of the HLP packet starting from ethertype
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
+ */
+ void filsHlpAddRequest(in byte[] dst_mac, in byte[] pkt);
+
+ /**
+ * Flush fast initial link setup (IEEE 802.11ai FILS) HLP packets.
+ * Use this to flush all the higher layer protocol (HLP) packets added in
+ * wpa_supplicant to send in FILS (Re)Association Request frame
+ * (Eg: DHCP discover packet).
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
+ */
+ void filsHlpFlushRequest();
+
+ /**
+ * Generates DPP bootstrap information: Bootstrap ID, DPP URI and listen
+ * channel for responder mode.
+ *
+ * @param macAddress MAC address of the interface for the DPP operation.
+ * @param deviceInfo Device specific information.
+ * As per DPP Specification V1.0 section 5.2,
+ * allowed Range of ASCII characters in deviceInfo - %x20-7E
+ * semicolon is not allowed.
+ * @param curve Elliptic curve cryptography type used to generate DPP
+ * public/private key pair.
+ * @return Bootstrap info.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ * |SupplicantStatusCode.FAILURE_UNSUPPORTED|
+ */
+ DppResponderBootstrapInfo generateDppBootstrapInfoForResponder(
+ in byte[] macAddress, in String deviceInfo, in DppCurve curve);
+
+ /**
+ * Get Connection capabilities
+ *
+ * @return Connection capabilities.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ ConnectionCapabilities getConnectionCapabilities();
+
+ /**
+ * Get Key management capabilities of the device
+ *
+ * @return Bitmap of key management mask.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ KeyMgmtMask getKeyMgmtCapabilities();
+
+ /**
+ * Send driver command to get MAC address of the device.
+ *
+ * @return MAC address of the device.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ byte[] getMacAddress();
+
+ /**
+ * Retrieves the name of the network interface.
+ *
+ * @return Name of the network interface, e.g., wlan0
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ String getName();
+
+ /**
+ * Gets an AIDL interface object for the network corresponding to the
+ * network id.
+ *
+ * Use |ISupplicantStaNetwork.getId()| on the corresponding network AIDL
+ * interface object to retrieve the ID.
+ *
+ * @param id Network ID allocated to the corresponding network.
+ * @return AIDL interface object representing the new network if
+ * successful, null otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_UNKNOWN|
+ */
+ ISupplicantStaNetwork getNetwork(in int id);
+
+ /**
+ * Retrieves the type of the network interface.
+ *
+ * @return Type of the network interface, e.g., STA.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ IfaceType getType();
+
+ /**
+ * Get wpa driver capabilities.
+ *
+ * @return Bitmap of wpa driver features.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ WpaDriverCapabilitiesMask getWpaDriverCapabilities();
+
+ /**
+ * Initiate ANQP (for IEEE 802.11u Interworking/Hotspot 2.0) queries with the
+ * specified access point.
+ * The ANQP data fetched must be returned in the
+ * |ISupplicantStaIfaceCallback.onAnqpQueryDone| callback.
+ *
+ * @param macAddress MAC address of the access point.
+ * @param infoElements List of information elements to query for.
+ * @param subtypes List of HS20 subtypes to query for.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void initiateAnqpQuery(
+ in byte[] macAddress, in AnqpInfoId[] infoElements, in Hs20AnqpSubtypes[] subTypes);
+
+ /**
+ * Initiate the Hotspot 2.0 icon query with the specified accesss point.
+ * The icon data fetched must be returned in the
+ * |ISupplicantStaIfaceCallback.onHs20IconQueryDone| callback.
+ *
+ * @param macAddress MAC address of the access point.
+ * @param fileName Name of the file to request from the access point.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void initiateHs20IconQuery(in byte[] macAddress, in String fileName);
+
+ /**
+ * Initiate TDLS discover with the provided peer MAC address.
+ *
+ * @param macAddress MAC address of the peer.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void initiateTdlsDiscover(in byte[] macAddress);
+
+ /**
+ * Initiate TDLS setup with the provided peer MAC address.
+ *
+ * @param macAddress MAC address of the peer.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void initiateTdlsSetup(in byte[] macAddress);
+
+ /**
+ * Initiate TDLS teardown with the provided peer MAC address.
+ *
+ * @param macAddress MAC address of the peer.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void initiateTdlsTeardown(in byte[] macAddress);
+
+ /**
+ * Initiate Venue URL ANQP (for IEEE 802.11u Interworking/Hotspot 2.0) query with the
+ * specified access point. This specific query can be used only post connection, once security
+ * is established and PMF is enabled, to avoid spoofing preassociation ANQP responses.
+ * The ANQP data fetched must be returned in the
+ * |ISupplicantStaIfaceCallback.onAnqpQueryDone| callback.
+ *
+ * @param macAddress MAC address of the access point.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void initiateVenueUrlAnqpQuery(in byte[] macAddress);
+
+ /**
+ * Retrieve a list of all the network Id's controlled by the supplicant.
+ *
+ * The corresponding |ISupplicantStaNetwork| object for any network can be
+ * retrieved using |getNetwork| method.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ * @return List of all network Id's controlled by the supplicant.
+ */
+ int[] listNetworks();
+
+ /**
+ * Reconnect to the currently active network, even if we are already
+ * connected.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
+ */
+ void reassociate();
+
+ /**
+ * Reconnect to the currently active network, if we are currently
+ * disconnected.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|,
+ * |SupplicantStatusCode.FAILURE_IFACE_NOT_DISCONNECTED|
+ */
+ void reconnect();
+
+ /**
+ * Register for callbacks from this interface.
+ *
+ * These callbacks are invoked for events that are specific to this interface.
+ * Registration of multiple callback objects is supported. These objects must
+ * be automatically deleted when the corresponding client process is dead or
+ * if this interface is removed.
+ *
+ * @param callback An instance of the |ISupplicantStaIfaceCallback| AIDL
+ * interface object.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void registerCallback(in ISupplicantStaIfaceCallback callback);
+
+ /**
+ * Remove a DPP peer URI.
+ *
+ * @param id The ID of the URI, as returned by |addDppPeerUri|.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void removeDppUri(in int id);
+
+ /**
+ * Indicates to supplicant that the external radio work has completed.
+ * This allows other radio works to be performed. If this method is not
+ * invoked (e.g., due to the external program terminating), supplicant
+ * must time out the radio work item on the iface and send
+ * |ISupplicantCallback.onExtRadioWorkTimeout| event to indicate
+ * that this has happened.
+ *
+ * This method may also be used to cancel items that have been scheduled
+ * via |addExtRadioWork|, but have not yet been started (notified via
+ * |ISupplicantCallback.onExtRadioWorkStart|).
+ *
+ * @param id Identifier generated for the radio work addition
+ * (using |addExtRadioWork|).
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void removeExtRadioWork(in int id);
+
+ /**
+ * Remove a network from the interface.
+ *
+ * Use |ISupplicantStaNetwork.getId()| on the corresponding network AIDL
+ * interface object to retrieve the ID.
+ *
+ * @param id Network ID allocated to the corresponding network.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_UNKNOWN|
+ */
+ void removeNetwork(in int id);
+
+ /**
+ * Send driver command to remove the specified RX filter.
+ *
+ * @param type Type of filter.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void removeRxFilter(in RxFilterType type);
+
+ /**
+ * Send driver command to set Bluetooth coexistence mode.
+ *
+ * @param mode Mode of Bluetooth coexistence.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void setBtCoexistenceMode(in BtCoexistenceMode mode);
+
+ /**
+ * Send driver command to set Bluetooth coexistence scan mode.
+ * When this mode is on, some of the low-level scan parameters
+ * used by the driver are changed to reduce interference
+ * with A2DP streaming.
+ *
+ * @param enable true to enable, false to disable.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void setBtCoexistenceScanModeEnabled(in boolean enable);
+
+ /**
+ * Send driver command to set country code.
+ *
+ * @param code 2 byte country code (as defined in ISO 3166) to set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void setCountryCode(in byte[] code);
+
+ /**
+ * Use external processing for SIM/USIM operations
+ *
+ * @param useExternalSim true to use external, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void setExternalSim(in boolean useExternalSim);
+
+ /**
+ * Set Wi-Fi Alliance Agile Multiband (MBO) cellular data status.
+ *
+ * @param available true means cellular data available, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setMboCellularDataStatus(in boolean available);
+
+ /**
+ * Turn on/off power save mode for the interface.
+ *
+ * @param enable Indicate if power save is to be turned on/off.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
+ */
+ void setPowerSave(in boolean enable);
+
+ /**
+ * Send driver command to set suspend optimizations for power save.
+ *
+ * @param enable true to enable, false to disable.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void setSuspendModeEnabled(in boolean enable);
+
+ /**
+ * Set the list of supported config methods for WPS operations.
+ *
+ * @param configMethods Mask of WPS configuration methods supported by the
+ * device.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setWpsConfigMethods(in WpsConfigMethods configMethods);
+
+ /**
+ * Set the device name for WPS operations.
+ * User-friendly description of device (up to |WPS_DEVICE_NAME_MAX_LEN|
+ * octets encoded in UTF-8).
+ *
+ * @parm name Name to be set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setWpsDeviceName(in String name);
+
+ /**
+ * Set the device type for WPS operations.
+ *
+ * @parm type Type of device. Refer to section B.1 of Wifi P2P
+ * Technical specification v1.2.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setWpsDeviceType(in byte[] type);
+
+ /**
+ * Set the manufacturer for WPS operations.
+ * The manufacturer of the device (up to |WPS_MANUFACTURER_MAX_LEN| ASCII
+ * characters).
+ *
+ * @parm manufacturer Manufacture to be set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setWpsManufacturer(in String manufacturer);
+
+ /**
+ * Set the model name for WPS operations.
+ * Model of the device (up to |WPS_MODEL_NAME_MAX_LEN| ASCII characters).
+ *
+ * @parm modelName Model name to be set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setWpsModelName(in String modelName);
+
+ /**
+ * Set the model number for WPS operations.
+ * Additional device description (up to |WPS_MODEL_NUMBER_MAX_LEN| ASCII
+ * characters).
+ *
+ * @parm modelNumber Model number to be set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setWpsModelNumber(in String modelNumber);
+
+ /**
+ * Set the serial number for WPS operations.
+ * Serial number of the device (up to |WPS_SERIAL_NUMBER_MAX_LEN| characters)
+ *
+ * @parm serialNumber Serial number to be set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setWpsSerialNumber(in String serialNumber);
+
+ /**
+ * Start DPP in Configurator-Initiator mode.
+ *
+ * @param peerBootstrapId Peer device's URI ID.
+ * @param ownBootstrapId Local device's URI ID (0 for none, optional).
+ * @param ssid Network SSID to send to peer (SAE/PSK mode).
+ * @param password Network password to send to peer (SAE/PSK mode).
+ * @param psk Network PSK to send to peer (PSK mode only). Either password or psk should be set.
+ * @param netRole Role to configure the peer, |DppNetRole.DPP_NET_ROLE_STA| or
+ * |DppNetRole.DPP_NET_ROLE_AP|.
+ * @param securityAkm Security AKM to use (See DppAkm).
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void startDppConfiguratorInitiator(in int peerBootstrapId, in int ownBootstrapId,
+ in String ssid, in String password, in String psk, in DppNetRole netRole,
+ in DppAkm securityAkm);
+
+ /**
+ * Start DPP in Enrollee-Initiator mode.
+ *
+ * @param peerBootstrapId Peer device's URI ID.
+ * @param ownBootstrapId Local device's URI ID (0 for none, optional).
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void startDppEnrolleeInitiator(in int peerBootstrapId, in int ownBootstrapId);
+
+ /**
+ * Start DPP in Enrollee-Responder mode.
+ * Framework must first call |generateDppBootstrapInfoForResponder| to generate
+ * the bootstrapping information: Bootstrap ID, DPP URI and the listen channel.
+ * Then call this API with derived listen channel to start listening for
+ * authentication request from Peer initiator.
+ *
+ * @param listenChannel DPP listen channel.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ * |SupplicantStatusCode.FAILURE_UNSUPPORTED|
+ */
+ void startDppEnrolleeResponder(in int listenChannel);
+
+ /**
+ * Send driver command to start RX filter.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void startRxFilter();
+
+ /**
+ * Initiate WPS Push Button setup.
+ * The PBC operation requires that a button is also pressed at the
+ * AP/Registrar at about the same time (2 minute window).
+ *
+ * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void startWpsPbc(in byte[] bssid);
+
+ /**
+ * Initiate WPS Pin Display setup.
+ *
+ * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ * @return 8 digit pin generated.
+ */
+ String startWpsPinDisplay(in byte[] bssid);
+
+ /**
+ * Initiate WPS Pin Keypad setup.
+ *
+ * @param pin 8 digit pin to be used.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void startWpsPinKeypad(in String pin);
+
+ /**
+ * Initiate WPS setup in registrar role to learn the current AP configuration.
+ *
+ * @param bssid BSSID of the AP.
+ * @param pin Pin of the AP.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void startWpsRegistrar(in byte[] bssid, in String pin);
+
+ /**
+ * Stop DPP Initiator operation.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void stopDppInitiator();
+
+ /**
+ * Stop DPP Responder operation - Remove the bootstrap code and stop listening.
+ *
+ * @param ownBootstrapId Local device's URI ID obtained through
+ * |generateDppBootstrapInfoForResponder| call.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ * |SupplicantStatusCode.FAILURE_UNSUPPORTED|
+ */
+ void stopDppResponder(in int ownBootstrapId);
+
+ /**
+ * Send driver command to stop RX filter.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void stopRxFilter();
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
new file mode 100644
index 0000000..594fef9
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
@@ -0,0 +1,278 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.AnqpData;
+import android.hardware.wifi.supplicant.AssociationRejectionData;
+import android.hardware.wifi.supplicant.BssTmData;
+import android.hardware.wifi.supplicant.BssidChangeReason;
+import android.hardware.wifi.supplicant.DppAkm;
+import android.hardware.wifi.supplicant.DppEventType;
+import android.hardware.wifi.supplicant.DppFailureCode;
+import android.hardware.wifi.supplicant.DppProgressCode;
+import android.hardware.wifi.supplicant.Hs20AnqpData;
+import android.hardware.wifi.supplicant.OsuMethod;
+import android.hardware.wifi.supplicant.StaIfaceCallbackState;
+import android.hardware.wifi.supplicant.StaIfaceReasonCode;
+import android.hardware.wifi.supplicant.WpsConfigError;
+import android.hardware.wifi.supplicant.WpsErrorIndication;
+
+/**
+ * Callback Interface exposed by the supplicant service
+ * for each station mode interface (ISupplicantStaIface).
+ *
+ * Clients need to host an instance of this AIDL interface object and
+ * pass a reference of the object to the supplicant via the
+ * corresponding |ISupplicantStaIface.registerCallback| method.
+ */
+@VintfStability
+interface ISupplicantStaIfaceCallback {
+ /**
+ * Used to indicate the result of ANQP (either for IEEE 802.11u Interworking
+ * or Hotspot 2.0) query.
+ *
+ * @param bssid BSSID of the access point.
+ * @param data ANQP data fetched from the access point.
+ * All the fields in this struct must be empty if the query failed.
+ * @param hs20Data ANQP data fetched from the Hotspot 2.0 access point.
+ * All the fields in this struct must be empty if the query failed.
+ */
+ oneway void onAnqpQueryDone(in byte[] bssid, in AnqpData data, in Hs20AnqpData hs20Data);
+
+ /**
+ * Used to indicate an association rejection received from the AP
+ * to which the connection is being attempted.
+ *
+ * @param assocRejectData Association Rejection related information.
+ */
+ oneway void onAssociationRejected(in AssociationRejectionData assocRejectData);
+
+ /**
+ * Used to indicate the timeout of authentication to an AP.
+ *
+ * @param bssid BSSID of the corresponding AP.
+ */
+ oneway void onAuthenticationTimeout(in byte[] bssid);
+
+ /**
+ * Indicates BTM request frame handling status.
+ *
+ * @param tmData Data retrieved from received BSS transition management
+ * request frame.
+ */
+ oneway void onBssTmHandlingDone(in BssTmData tmData);
+
+ /**
+ * Used to indicate the change of active bssid.
+ * This is useful to figure out when the driver/firmware roams to a bssid
+ * on its own.
+ *
+ * @param reason Reason why the bssid changed.
+ * @param bssid BSSID of the corresponding AP.
+ */
+ oneway void onBssidChanged(in BssidChangeReason reason, in byte[] bssid);
+
+ /**
+ * Used to indicate the disconnection from the currently connected
+ * network on this iface.
+ *
+ * @param bssid BSSID of the AP from which we disconnected.
+ * @param locallyGenerated If the disconnect was triggered by
+ * wpa_supplicant.
+ * @param reasonCode 802.11 code to indicate the disconnect reason
+ * from access point. Refer to section 8.4.1.7 of IEEE802.11 spec.
+ */
+ oneway void onDisconnected(
+ in byte[] bssid, in boolean locallyGenerated, in StaIfaceReasonCode reasonCode);
+
+ /**
+ * Indicates a DPP failure event.
+ *
+ * ssid: A string indicating the SSID for the AP that the Enrollee attempted to connect.
+ * channelList: A string containing a list of operating channels and operating classes
+ * indicating the channels that the Enrollee scanned in attempting to discover the AP.
+ * The list conforms to the following ABNF syntax:
+ * channel-list2 = class-and-channels *(“,” class-and-channels)
+ * class-and-channels = class “/” channel *(“,” channel)
+ * class = 1*3DIGIT
+ * channel = 1*3DIGIT
+ * bandList: A list of band parameters that are supported by the Enrollee expressed as the
+ * Operating Class.
+ */
+ oneway void onDppFailure(
+ in DppFailureCode code, in String ssid, in String channelList, in char[] bandList);
+
+ /**
+ * Indicates a DPP progress event.
+ */
+ oneway void onDppProgress(in DppProgressCode code);
+
+ /**
+ * Indicates a DPP success event.
+ */
+ oneway void onDppSuccess(in DppEventType event);
+
+ /**
+ * Indicates DPP configuration received success event (Enrolee mode).
+ */
+ oneway void onDppSuccessConfigReceived(
+ in byte[] ssid, in String password, in byte[] psk, in DppAkm securityAkm);
+
+ /**
+ * Indicates DPP configuration sent success event (Configurator mode).
+ */
+ oneway void onDppSuccessConfigSent();
+
+ /**
+ * Indicates an EAP authentication failure.
+ * @param errorCode Error code for EAP authentication failure.
+ * Either standard error code (enum EapErrorCode) or
+ * private error code defined by network provider.
+ */
+ oneway void onEapFailure(in int errorCode);
+
+ /**
+ * Used to indicate that the external radio work can start now.
+ *
+ * @param id Identifier generated for the radio work request.
+ */
+ oneway void onExtRadioWorkStart(in int id);
+
+ /**
+ * Used to indicate that the external radio work request has timed out.
+ *
+ * @param id Identifier generated for the radio work request.
+ */
+ oneway void onExtRadioWorkTimeout(in int id);
+
+ /**
+ * Used to indicate a Hotspot 2.0 imminent deauth notice.
+ *
+ * @param bssid BSSID of the access point.
+ * @param reasonCode Code to indicate the deauth reason.
+ * Refer to section 3.2.1.2 of the Hotspot 2.0 spec.
+ * @param reAuthDelayInSec Delay before reauthenticating.
+ * @param url URL of the server.
+ */
+ oneway void onHs20DeauthImminentNotice(
+ in byte[] bssid, in int reasonCode, in int reAuthDelayInSec, in String url);
+
+ /**
+ * Used to indicate the result of Hotspot 2.0 Icon query.
+ *
+ * @param bssid BSSID of the access point.
+ * @param fileName Name of the file that was requested.
+ * @param data Icon data fetched from the access point.
+ * Must be empty if the query failed.
+ */
+ oneway void onHs20IconQueryDone(in byte[] bssid, in String fileName, in byte[] data);
+
+ /**
+ * Used to indicate a Hotspot 2.0 subscription remediation event.
+ *
+ * @param bssid BSSID of the access point.
+ * @param osuMethod OSU method.
+ * @param url URL of the server.
+ */
+ oneway void onHs20SubscriptionRemediation(
+ in byte[] bssid, in OsuMethod osuMethod, in String url);
+
+ /**
+ * Used to indicate a Hotspot 2.0 terms and conditions acceptance is requested from the user
+ * before allowing the device to get internet access.
+ *
+ * @param bssid BSSID of the access point.
+ * @param url URL of the T&C server.
+ */
+ oneway void onHs20TermsAndConditionsAcceptanceRequestedNotification(
+ in byte[] bssid, in String url);
+
+ /**
+ * Used to indicate that a new network has been added.
+ *
+ * @param id Network ID allocated to the corresponding network.
+ */
+ oneway void onNetworkAdded(in int id);
+
+ /**
+ * Used to indicate that the supplicant failed to find a network in scan result
+ * which matches with the network capabilities requested by upper layer
+ * for connection.
+ *
+ * @param ssid network name supplicant tried to connect.
+ */
+ oneway void onNetworkNotFound(in byte[] ssid);
+
+ /**
+ * Used to indicate that a network has been removed.
+ *
+ * @param id Network ID allocated to the corresponding network.
+ */
+ oneway void onNetworkRemoved(in int id);
+
+ /**
+ * Indicates pairwise master key (PMK) cache added event.
+ *
+ * @param expirationTimeInSec expiration time in seconds
+ * @param serializedEntry is serialized PMK cache entry, the content is
+ * opaque for the framework and depends on the native implementation.
+ */
+ oneway void onPmkCacheAdded(in long expirationTimeInSec, in byte[] serializedEntry);
+
+ /**
+ * Used to indicate a state change event on this particular iface. If this
+ * event is triggered by a particular network, the |SupplicantNetworkId|,
+ * |ssid|, |bssid| parameters must indicate the parameters of the network/AP
+ * which caused this state transition.
+ *
+ * @param newState New State of the interface. This must be one of the |State|
+ * values above.
+ * @param bssid BSSID of the corresponding AP which caused this state
+ * change event. This must be zero'ed if this event is not
+ * specific to a particular network.
+ * @param id ID of the corresponding network which caused this
+ * state change event. This must be invalid (UINT32_MAX) if this
+ * event is not specific to a particular network.
+ * @param ssid SSID of the corresponding network which caused this state
+ * change event. This must be empty if this event is not specific
+ * to a particular network.
+ * @param filsHlpSent If FILS HLP IEs were included in this association.
+ */
+ oneway void onStateChanged(in StaIfaceCallbackState newState, in byte[] bssid, in int id,
+ in byte[] ssid, in boolean filsHlpSent);
+
+ /**
+ * Used to indicate the failure of a WPS connection attempt.
+ *
+ * @param bssid BSSID of the AP to which we initiated WPS
+ * connection.
+ * @param configError Configuration error code.
+ * @param errorInd Error indication code.
+ */
+ oneway void onWpsEventFail(
+ in byte[] bssid, in WpsConfigError configError, in WpsErrorIndication errorInd);
+
+ /**
+ * Used to indicate the overlap of a WPS PBC connection attempt.
+ */
+ oneway void onWpsEventPbcOverlap();
+
+ /**
+ * Used to indicate the success of a WPS connection attempt.
+ */
+ oneway void onWpsEventSuccess();
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl
new file mode 100644
index 0000000..603e2ad
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl
@@ -0,0 +1,1095 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.AuthAlgMask;
+import android.hardware.wifi.supplicant.EapMethod;
+import android.hardware.wifi.supplicant.EapPhase2Method;
+import android.hardware.wifi.supplicant.GroupCipherMask;
+import android.hardware.wifi.supplicant.GroupMgmtCipherMask;
+import android.hardware.wifi.supplicant.ISupplicantStaNetworkCallback;
+import android.hardware.wifi.supplicant.IfaceType;
+import android.hardware.wifi.supplicant.KeyMgmtMask;
+import android.hardware.wifi.supplicant.NetworkResponseEapSimGsmAuthParams;
+import android.hardware.wifi.supplicant.NetworkResponseEapSimUmtsAuthParams;
+import android.hardware.wifi.supplicant.OcspType;
+import android.hardware.wifi.supplicant.PairwiseCipherMask;
+import android.hardware.wifi.supplicant.ProtoMask;
+import android.hardware.wifi.supplicant.SaeH2eMode;
+
+/**
+ * Interface exposed by the supplicant for each station mode network
+ * configuration it controls.
+ */
+@VintfStability
+interface ISupplicantStaNetwork {
+ /**
+ * Max length of SSID param.
+ */
+ const int SSID_MAX_LEN_IN_BYTES = 32;
+
+ /**
+ * Min length of PSK passphrase param.
+ */
+ const int PSK_PASSPHRASE_MIN_LEN_IN_BYTES = 8;
+
+ /**
+ * Max length of PSK passphrase param.
+ */
+ const int PSK_PASSPHRASE_MAX_LEN_IN_BYTES = 63;
+
+ /**
+ * Max number of WEP keys param.
+ */
+ const int WEP_KEYS_MAX_NUM = 4;
+
+ /**
+ * Length of each WEP40 keys param.
+ */
+ const int WEP40_KEY_LEN_IN_BYTES = 5;
+
+ /**
+ * Length of each WEP104 keys param.
+ */
+ const int WEP104_KEY_LEN_IN_BYTES = 13;
+
+ /**
+ * Disable the network for connection purposes.
+ *
+ * This must trigger a disconnection from the network, if currently
+ * connected to this one.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void disable();
+
+ /**
+ * Enable the network for connection purposes.
+ *
+ * This must trigger a connection to the network if:
+ * a) |noConnect| is false, and
+ * b) This is the only network configured, and
+ * c) Is visible in the current scan results.
+ *
+ * @param noConnect Only enable the network, don't trigger a connect.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void enable(in boolean noConnect);
+
+ /**
+ * Set whether to enable SAE PK (Public Key) only mode to enable public AP validation.
+ * When enabled, only SAE PK network is allowed; otherwise PK is optional.
+ * If this API is not called before connecting to an SAE
+ * network, SAE PK mode depends on SAE PK config in wpa_supplicant configuration.
+ * If SAE PK config of wpa_supplicant configuration is not set,
+ * the default mode is optional (support for both PK and standard mode).
+ *
+ * @param enable true to set, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNSUPPORTED|
+ */
+ void enableSaePkOnlyMode(in boolean enable);
+
+ /**
+ * Set EAP OpenSSL Suite-B-192 ciphers for WPA3-Enterprise
+ * Supported option:
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void enableSuiteBEapOpenSslCiphers();
+
+ /**
+ * Enable TLS Suite-B in EAP Phase1
+ *
+ * @param enable Set to true to enable TLS Suite-B in EAP phase1
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void enableTlsSuiteBEapPhase1Param(in boolean enable);
+
+ /**
+ * Get the auth alg mask set for the network.
+ *
+ * @return Combination of |AuthAlgMask| values.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ AuthAlgMask getAuthAlg();
+
+ /**
+ * Get the BSSID set for this network.
+ *
+ * @return bssid Value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ byte[] getBssid();
+
+ /**
+ * Get EAP Alt subject match set for this network.
+ *
+ * @return value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ String getEapAltSubjectMatch();
+
+ /**
+ * Get EAP Anonymous Identity set for this network.
+ *
+ * @return identity value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ byte[] getEapAnonymousIdentity();
+
+ /**
+ * Get EAP CA certificate file path set for this network.
+ *
+ * @return value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ String getEapCACert();
+
+ /**
+ * Get EAP CA certificate directory path set for this network.
+ *
+ * @return value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ String getEapCAPath();
+
+ /**
+ * Get EAP Client certificate file path set for this network.
+ *
+ * @return value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ String getEapClientCert();
+
+ /**
+ * Get EAP Domain suffix match set for this network.
+ *
+ * @return value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ String getEapDomainSuffixMatch();
+
+ /**
+ * Get whether EAP Open SSL Engine is enabled for this network.
+ *
+ * @return true if set, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ boolean getEapEngine();
+
+ /**
+ * Get EAP Open SSL Engine ID set for this network.
+ *
+ * @return value set.
+ * throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ String getEapEngineId();
+
+ /**
+ * Get EAP Identity set for this network.
+ *
+ * @return value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ byte[] getEapIdentity();
+
+ /**
+ * Get EAP Method set for this network.
+ *
+ * @return value set.
+ * Must be one of |EapMethod| values.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ EapMethod getEapMethod();
+
+ /**
+ * Get EAP Password set for this network.
+ *
+ * @return value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ byte[] getEapPassword();
+
+ /**
+ * Get EAP Phase2 Method set for this network.
+ *
+ * @return value set.
+ * Must be one of |EapPhase2Method| values.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ EapPhase2Method getEapPhase2Method();
+
+ /**
+ * Get EAP private key Id set for this network.
+ *
+ * @return value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|)
+ */
+ String getEapPrivateKeyId();
+
+ /**
+ * Get EAP subject match set for this network.
+ *
+ * @return value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ String getEapSubjectMatch();
+
+ /**
+ * Get whether enhanced directional multi-gigabit (802.11ay EDMG) is enabled for this network.
+ *
+ * @return true if set, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ boolean getEdmg();
+
+ /**
+ * Get the group cipher mask set for the network.
+ *
+ * @return Combination of |GroupCipherMask| values.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ GroupCipherMask getGroupCipher();
+
+ /**
+ * Get the group management cipher mask set for the network.
+ *
+ * @return Combination of |GroupMgmtCipherMask| values.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ GroupMgmtCipherMask getGroupMgmtCipher();
+
+ /**
+ * Retrieves the ID allocated to this network by the supplicant.
+ *
+ * This is not the |SSID| of the network, but an internal identifier for
+ * this network used by the supplicant.
+ *
+ * @return Network ID.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ int getId();
+
+ /**
+ * Get ID string set for this network.
+ * Network identifier string for external scripts.
+ *
+ * @return ID string set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ String getIdStr();
+
+ /**
+ * Retrieves the name of the interface this network belongs to.
+ *
+ * @return Name of the network interface, e.g., wlan0
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ String getInterfaceName();
+
+ /**
+ * Get the key mgmt mask set for the network.
+ *
+ * @return Combination of |KeyMgmtMask| values.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ KeyMgmtMask getKeyMgmt();
+
+ /**
+ * Get OCSP (Online Certificate Status Protocol) type for this network.
+ *
+ * @return ocsp type.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ OcspType getOcsp();
+
+ /**
+ * Get the pairwise cipher mask set for the network.
+ *
+ * @return Combination of |PairwiseCipherMask| values.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ PairwiseCipherMask getPairwiseCipher();
+
+ /**
+ * Get the proto mask set for the network.
+ *
+ * @return Combination of |ProtoMask| values.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ ProtoMask getProto();
+
+ /**
+ * Get raw psk for WPA_PSK network.
+ *
+ * @return value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ byte[] getPsk();
+
+ /**
+ * Get passphrase for WPA_PSK network.
+ * Must return a failure if network has no passphrase set (use |getPsk| if
+ * network was configured with raw psk instead).
+ *
+ * @return value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ String getPskPassphrase();
+
+ /**
+ * Get whether RequirePmf is enabled for this network.
+ *
+ * @return true if set, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ boolean getRequirePmf();
+
+ /**
+ * Get SAE password for WPA3-Personal
+ *
+ * @return value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ String getSaePassword();
+
+ /**
+ * Get SAE password ID for WPA3-Personal
+ *
+ * @return value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ String getSaePasswordId();
+
+ /**
+ * Get whether Probe Requests are being sent for this network (hidden).
+ *
+ * @return true if set, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ boolean getScanSsid();
+
+ /**
+ *
+ * Getters for the various network params.
+ *
+ */
+
+ /**
+ * Get SSID for this network.
+ *
+ * @return value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ byte[] getSsid();
+
+ /**
+ * Retrieves the type of the interface this network belongs to.
+ *
+ * @return Type of the network interface, e.g., STA.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ IfaceType getType();
+
+ /**
+ * Get WAPI certificate suite name set for this network.
+ *
+ * @return The name of a suite.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ String getWapiCertSuite();
+
+ /**
+ * Get WEP key for WEP network.
+ *
+ * @param keyIdx Index of wep key to be fetched.
+ * Max of |WEP_KEYS_MAX_NUM|.
+ * @return value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ byte[] getWepKey(in int keyIdx);
+
+ /**
+ * Get default Tx key index for WEP network.
+ *
+ * @return value set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ int getWepTxKeyIdx();
+
+ /**
+ * Retrieves a WPS-NFC configuration token for this network.
+ *
+ * @return Bytes representing WPS-NFC configuration token.
+ * This is a dump of all the WPS atrributes of the AP configuration
+ * as specified in the Wi-Fi Protected Setup Specification.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ byte[] getWpsNfcConfigurationToken();
+
+ /**
+ * Register for callbacks from this network.
+ *
+ * These callbacks are invoked for events that are specific to this network.
+ * Registration of multiple callback objects is supported. These objects must
+ * be automatically deleted when the corresponding client process is dead or
+ * if this network is removed.
+ *
+ * @param callback An instance of the |ISupplicantStaNetworkCallback| AIDL
+ * interface object.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void registerCallback(in ISupplicantStaNetworkCallback callback);
+
+ /**
+ * Initiate connection to this network.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void select();
+
+ /**
+ * Used to send a response to the
+ * |ISupplicantNetworkCallback.onNetworkEapIdentityRequest| request.
+ *
+ * @param identity Identity string containing the IMSI.
+ * @param encryptedIdentity Identity string containing the encrypted IMSI.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void sendNetworkEapIdentityResponse(in byte[] identity, in byte[] encryptedIdentity);
+
+ /**
+ * Used to send a response to the
+ * |ISupplicantNetworkCallback.onNetworkEapSimGsmAuthRequest| request.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void sendNetworkEapSimGsmAuthFailure();
+
+ /**
+ * Used to send a response to the
+ * |ISupplicantNetworkCallback.onNetworkEapSimGsmAuthRequest| request.
+ *
+ * @param params Params to be used for EAP GSM authentication.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void sendNetworkEapSimGsmAuthResponse(in NetworkResponseEapSimGsmAuthParams[] params);
+
+ /**
+ * Used to send a response to the
+ * |ISupplicantNetworkCallback.onNetworkEapSimUmtsAuthRequest| request.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void sendNetworkEapSimUmtsAuthFailure();
+
+ /**
+ * Used to send a response to the
+ * |ISupplicantNetworkCallback.onNetworkEapSimUmtsAuthRequest| request.
+ *
+ * @param params Params to be used for EAP UMTS authentication.
+ * @throws ServiceSpecificException with one of the following values:
+
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void sendNetworkEapSimUmtsAuthResponse(in NetworkResponseEapSimUmtsAuthParams params);
+
+ /**
+ * Used to send a response to the
+ * |ISupplicantNetworkCallback.onNetworkEapSimUmtsAuthRequest| request.
+ *
+ * @param auts Params to be used for EAP UMTS authentication.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void sendNetworkEapSimUmtsAutsResponse(in byte[] auts);
+
+ /**
+ * Set auth alg mask for the network.
+ *
+ * @param authAlgMask value to set.
+ * Combination of |ProtoMask| values.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setAuthAlg(in AuthAlgMask authAlgMask);
+
+ /**
+ * Set the network to only connect to an AP with provided BSSID.
+ *
+ * @param bssid value to set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setBssid(in byte[] bssid);
+
+ /**
+ * Set EAP Alt subject match for this network.
+ *
+ * @param match value to set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEapAltSubjectMatch(in String match);
+
+ /**
+ * Set EAP Anonymous Identity for this network.
+ *
+ * @param identity value to set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEapAnonymousIdentity(in byte[] identity);
+
+ /**
+ * Set EAP CA certificate file path for this network.
+ *
+ * @param path value to set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEapCACert(in String path);
+
+ /**
+ * Set EAP CA certificate directory path for this network.
+ *
+ * @param path value to set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEapCAPath(in String path);
+
+ /**
+ * Set EAP Client certificate file path for this network.
+ *
+ * @param path value to set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEapClientCert(in String path);
+
+ /**
+ * Set EAP Domain suffix match for this network.
+ *
+ * @param match value to set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEapDomainSuffixMatch(in String match);
+
+ /**
+ * Set EAP encrypted IMSI Identity for this network.
+ *
+ * @param identity Identity string built from the encrypted IMSI.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEapEncryptedImsiIdentity(in byte[] identity);
+
+ /**
+ * Enable EAP Open SSL Engine for this network.
+ *
+ * @param enable true to set, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEapEngine(in boolean enable);
+
+ /**
+ * Set EAP Open SSL Engine ID for this network.
+ *
+ * @param id value to set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEapEngineID(in String id);
+
+ /**
+ * Enable Extensible Authentication (EAP) - Re-authentication Protocol (ERP) for this network.
+ *
+ * @param enable true to set, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEapErp(in boolean enable);
+
+ /**
+ * Set EAP Identity for this network.
+ *
+ * @param identity value to set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEapIdentity(in byte[] identity);
+
+ /**
+ * Set EAP Method for this network.
+ *
+ * @param method value to be set.
+ * Must be one of |EapMethod| values.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEapMethod(in EapMethod method);
+
+ /**
+ * Set EAP Password for this network.
+ *
+ * @param password value to set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEapPassword(in byte[] password);
+
+ /**
+ * Set EAP Phase2 Method for this network.
+ *
+ * EAP method needs to be set for this to work.
+ *
+ * @param method value to set.
+ * Must be one of |EapPhase2Method| values.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEapPhase2Method(in EapPhase2Method method);
+
+ /**
+ * Set EAP private key Id for this network.
+ * This is used if private key operations for EAP-TLS are performed
+ * using a smartcard.
+ *
+ * @param id value to set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEapPrivateKeyId(in String id);
+
+ /**
+ * Set EAP subject match for this network.
+ *
+ * @param match value to set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEapSubjectMatch(in String match);
+
+ /**
+ * Set whether to enable enhanced directional multi-gigabit (802.11ay EDMG).
+ * Only allowed if hw mode is |HOSTAPD_MODE_IEEE80211AD|
+ *
+ * @param enable true to set, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setEdmg(in boolean enable);
+
+ /**
+ * Set group cipher mask for the network.
+ *
+ * @param groupCipherMask value to set.
+ * Combination of |ProtoMask| values.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setGroupCipher(in GroupCipherMask groupCipherMask);
+
+ /**
+ * Set group management cipher mask for the network.
+ *
+ * @param groupMgmtCipherMask value to set.
+ * Combination of |GroupMgmtCipherMask| values.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setGroupMgmtCipher(in GroupMgmtCipherMask groupMgmtCipherMask);
+
+ /**
+ * Set ID string for this network.
+ * Network identifier string for external scripts.
+ *
+ * @param idStr ID string value to set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setIdStr(in String idStr);
+
+ /**
+ * Set key management mask for the network.
+ *
+ * @param keyMgmtMask value to set.
+ * Combination of |KeyMgmtMask| values.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setKeyMgmt(in KeyMgmtMask keyMgmtMask);
+
+ /**
+ * Set OCSP (Online Certificate Status Protocol) type for this network.
+ *
+ * @param ocspType value to set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setOcsp(in OcspType ocspType);
+
+ /**
+ * Set pairwise cipher mask for the network.
+ *
+ * @param pairwiseCipherMask value to set.
+ * Combination of |ProtoMask| values.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setPairwiseCipher(in PairwiseCipherMask pairwiseCipherMask);
+
+ /**
+ * Add a pairwise master key (PMK) into supplicant PMK cache.
+ *
+ * @param serializedEntry is serialized PMK cache entry, the content is
+ * opaque for the framework and depends on the native implementation.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setPmkCache(in byte[] serializedEntry);
+
+ /**
+ * This field can be used to enable proactive key caching which is also
+ * known as opportunistic PMKSA caching for WPA2. This is disabled (0)
+ * by default unless default value is changed with the global okc=1
+ * parameter.
+ *
+ * Proactive key caching is used to make supplicant assume that the APs
+ * are using the same PMK and generate PMKSA cache entries without
+ * doing RSN pre-authentication. This requires support from the AP side
+ * and is normally used with wireless switches that co-locate the
+ * authenticator.
+ *
+ * @param enable true to set, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setProactiveKeyCaching(in boolean enable);
+
+ /**
+ * Set proto mask for the network.
+ *
+ * @param protoMask value to set.
+ * Combination of |ProtoMask| values.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setProto(in ProtoMask protoMask);
+
+ /**
+ * Set raw psk for WPA_PSK network.
+ *
+ * @param psk value to set as specified in IEEE 802.11i-2004 standard.
+ * This is the calculated using 'wpa_passphrase <ssid> [passphrase]'
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setPsk(in byte[] psk);
+
+ /**
+ * Set passphrase for WPA_PSK network.
+ *
+ * @param psk value to set.
+ * Length of value must be between
+ * |PSK_PASSPHRASE_MIN_LEN_IN_BYTES| and
+ * |PSK_PASSPHRASE_MAX_LEN_IN_BYTES|.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setPskPassphrase(in String psk);
+
+ /**
+ * Set whether RequirePmf is enabled for this network.
+ *
+ * @param enable true to set, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setRequirePmf(in boolean enable);
+
+ /**
+ * Set SAE H2E (Hash-to-Element) mode.
+ *
+ * @param mode SAE H2E supporting mode.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setSaeH2eMode(in SaeH2eMode mode);
+
+ /**
+ * Set SAE password for WPA3-Personal
+ *
+ * @param saePassword string with the above option
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setSaePassword(in String saePassword);
+
+ /**
+ * Set SAE password ID for WPA3-Personal
+ *
+ * @param sae_password_id string with the above option
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setSaePasswordId(in String saePasswordId);
+
+ /**
+ * Set whether to send probe requests for this network (hidden).
+ *
+ * @param enable true to set, false otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setScanSsid(in boolean enable);
+
+ /**
+ *
+ * Setters for the various network params.
+ * These correspond to elements of |wpa_sssid| struct used internally by
+ * the supplicant to represent each network.
+ *
+ */
+
+ /**
+ * Set SSID for this network.
+ *
+ * @param ssid value to set.
+ * Max length of |SSID_MAX_LEN_IN_BYTES|.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setSsid(in byte[] ssid);
+
+ /**
+ * Set PPS MO ID for this network.
+ * (Hotspot 2.0 PerProviderSubscription/UpdateIdentifier)
+ *
+ * @param id ID value to set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setUpdateIdentifier(in int id);
+
+ /**
+ * Set WAPI certificate suite name for this network.
+ *
+ * @param suite value to set.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void setWapiCertSuite(in String suite);
+
+ /**
+ * Set WEP key for WEP network.
+ *
+ * @param keyIdx Index of wep key to set.
+ * Max of |WEP_KEYS_MAX_NUM|.
+ * @param wepKey value to set.
+ * Length of each key must be either
+ * |WEP40_KEY_LEN_IN_BYTES| or
+ * |WEP104_KEY_LEN_IN_BYTES|.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setWepKey(in int keyIdx, in byte[] wepKey);
+
+ /**
+ * Set default Tx key index for WEP network.
+ *
+ * @param keyIdx Value to set.
+ * Max of |WEP_KEYS_MAX_NUM|.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setWepTxKeyIdx(in int keyIdx);
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl
new file mode 100644
index 0000000..c28b494
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.aidl
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.NetworkRequestEapSimGsmAuthParams;
+import android.hardware.wifi.supplicant.NetworkRequestEapSimUmtsAuthParams;
+import android.hardware.wifi.supplicant.TransitionDisableIndication;
+
+/**
+ * Callback Interface exposed by the supplicant service
+ * for each network (ISupplicantStaNetwork).
+ *
+ * Clients need to host an instance of this AIDL interface object and
+ * pass a reference of the object to the supplicant via the
+ * corresponding |ISupplicantStaNetwork.registerCallback| method.
+ */
+@VintfStability
+interface ISupplicantStaNetworkCallback {
+ /**
+ * Used to request EAP Identity for this particular network.
+ *
+ * The response for the request must be sent using the corresponding
+ * |ISupplicantNetwork.sendNetworkEapIdentityResponse| call.
+ */
+ oneway void onNetworkEapIdentityRequest();
+
+ /**
+ * Used to request EAP GSM SIM authentication for this particular network.
+ *
+ * The response for the request must be sent using the corresponding
+ * |ISupplicantNetwork.sendNetworkEapSimGsmAuthResponse| call.
+ *
+ * @param params Params associated with the request.
+ */
+ oneway void onNetworkEapSimGsmAuthRequest(in NetworkRequestEapSimGsmAuthParams params);
+
+ /**
+ * Used to request EAP UMTS SIM authentication for this particular network.
+ *
+ * The response for the request must be sent using the corresponding
+ * |ISupplicantNetwork.sendNetworkEapSimUmtsAuthResponse| call.
+ *
+ * @param params Params associated with the request.
+ */
+ oneway void onNetworkEapSimUmtsAuthRequest(in NetworkRequestEapSimUmtsAuthParams params);
+
+ /**
+ * Used to notify WPA3 transition disable.
+ */
+ oneway void onTransitionDisable(in TransitionDisableIndication ind);
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/IfaceInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/IfaceInfo.aidl
new file mode 100644
index 0000000..7792142
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/IfaceInfo.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.IfaceType;
+
+/**
+ * Structure describing the type and name of an iface
+ * controlled by the supplicant.
+ */
+@VintfStability
+parcelable IfaceInfo {
+ /**
+ * Type of the network interface.
+ */
+ IfaceType type;
+ /**
+ * Name of the network interface, e.g., wlan0
+ */
+ String name;
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/IfaceType.aidl
similarity index 61%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/IfaceType.aidl
index 0a93c9e..e39dcd1 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/IfaceType.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -14,20 +14,14 @@
* limitations under the License.
*/
-package android.hardware.graphics.composer3;
+package android.hardware.wifi.supplicant;
/**
- * Special index values (always negative) for command queue commands.
+ * List of Iface types supported.
*/
@VintfStability
@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+enum IfaceType {
+ STA,
+ P2P,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/KeyMgmtMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/KeyMgmtMask.aidl
new file mode 100644
index 0000000..3225585
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/KeyMgmtMask.aidl
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Possible mask of values for KeyMgmt param.
+ * See /external/wpa_supplicant_8/src/common/defs.h for
+ * all possible values (starting at WPA_KEY_MGMT_IEEE8021X).
+ */
+@VintfStability
+@Backing(type="int")
+enum KeyMgmtMask {
+ WPA_EAP = 1 << 0,
+ WPA_PSK = 1 << 1,
+ NONE = 1 << 2,
+ IEEE8021X = 1 << 3,
+ FT_EAP = 1 << 5,
+ FT_PSK = 1 << 6,
+ OSEN = 1 << 15,
+ /**
+ * WPA using EAP authentication with stronger SHA256-based algorithms
+ */
+ WPA_EAP_SHA256 = 1 << 7,
+ /**
+ * WPA pre-shared key with stronger SHA256-based algorithms
+ */
+ WPA_PSK_SHA256 = 1 << 8,
+ /**
+ * WPA3-Personal SAE Key management
+ */
+ SAE = 1 << 10,
+ /**
+ * WPA3-Enterprise Suite-B Key management
+ */
+ SUITE_B_192 = 1 << 17,
+ /**
+ * Enhacned Open (OWE) Key management
+ */
+ OWE = 1 << 22,
+ /**
+ * Easy Connect (DPP) Key management
+ */
+ DPP = 1 << 23,
+ /*
+ * WAPI Psk
+ */
+ WAPI_PSK = 1 << 12,
+ /**
+ * WAPI Cert
+ */
+ WAPI_CERT = 1 << 13,
+ /**
+ * FILS shared key authentication with sha-256
+ */
+ FILS_SHA256 = 1 << 18,
+ /**
+ * FILS shared key authentication with sha-384
+ */
+ FILS_SHA384 = 1 << 19,
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/LegacyMode.aidl
similarity index 62%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/LegacyMode.aidl
index 0a93c9e..f933f6c 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/LegacyMode.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -14,20 +14,25 @@
* limitations under the License.
*/
-package android.hardware.graphics.composer3;
+package android.hardware.wifi.supplicant;
/**
- * Special index values (always negative) for command queue commands.
+ * Detailed network mode for legacy network
*/
@VintfStability
@Backing(type="int")
-enum HandleIndex {
+enum LegacyMode {
+ UNKNOWN = 0,
/**
- * No handle
+ * For 802.11a
*/
- EMPTY = -1,
+ A_MODE = 1,
/**
- * Use cached handle
+ * For 802.11b
*/
- CACHED = -2,
+ B_MODE = 2,
+ /**
+ * For 802.11g
+ */
+ G_MODE = 3,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MacAddress.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MacAddress.aidl
new file mode 100644
index 0000000..40ad22a
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MacAddress.aidl
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Byte array representing a Mac Address. Use when we need
+ * to pass an array of Mac Addresses to a method, as 2D
+ * arrays are not supported in AIDL.
+ *
+ * TODO (b/210705533): Replace this type with a 2D byte array.
+ */
+@VintfStability
+parcelable MacAddress {
+ byte[/* 6 */] data;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MboAssocDisallowedReasonCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MboAssocDisallowedReasonCode.aidl
new file mode 100644
index 0000000..41868aa
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MboAssocDisallowedReasonCode.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * MBO spec v1.2, 4.2.4 Table 14: MBO Association disallowed reason code attribute
+ * values.
+ */
+@VintfStability
+@Backing(type="byte")
+enum MboAssocDisallowedReasonCode {
+ RESERVED = 0,
+ UNSPECIFIED = 1,
+ MAX_NUM_STA_ASSOCIATED = 2,
+ AIR_INTERFACE_OVERLOADED = 3,
+ AUTH_SERVER_OVERLOADED = 4,
+ INSUFFICIENT_RSSI = 5,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MboCellularDataConnectionPrefValue.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MboCellularDataConnectionPrefValue.aidl
new file mode 100644
index 0000000..98f707e
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MboCellularDataConnectionPrefValue.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * MBO spec v1.2, 4.2.5 Table 16: MBO Cellular Data connection preference
+ * attribute values. AP use this to indicate STA, its preference for the
+ * STA to move from BSS to cellular network.
+ */
+@VintfStability
+@Backing(type="int")
+enum MboCellularDataConnectionPrefValue {
+ EXCLUDED = 0,
+ NOT_PREFERRED = 1,
+ /*
+ * 2-254 Reserved.
+ */
+ PREFERRED = 255,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MboTransitionReasonCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MboTransitionReasonCode.aidl
new file mode 100644
index 0000000..66ad9ee
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MboTransitionReasonCode.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * MBO spec v1.2, 4.2.6 Table 18: MBO transition reason code attribute
+ * values.
+ */
+@VintfStability
+@Backing(type="byte")
+enum MboTransitionReasonCode {
+ UNSPECIFIED = 0,
+ EXCESSIVE_FRAME_LOSS = 1,
+ EXCESSIVE_TRAFFIC_DELAY = 2,
+ INSUFFICIENT_BANDWIDTH = 3,
+ LOAD_BALANCING = 4,
+ LOW_RSSI = 5,
+ RX_EXCESSIVE_RETRIES = 6,
+ HIGH_INTERFERENCE = 7,
+ GRAY_ZONE = 8,
+ TRANSITION_TO_PREMIUM_AP = 9,
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MiracastMode.aidl
similarity index 60%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/MiracastMode.aidl
index 0a93c9e..4eaaf1d 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MiracastMode.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -14,20 +14,22 @@
* limitations under the License.
*/
-package android.hardware.graphics.composer3;
+package android.hardware.wifi.supplicant;
/**
- * Special index values (always negative) for command queue commands.
+ * Enum describing the modes of Miracast supported
+ * via driver commands.
*/
@VintfStability
-@Backing(type="int")
-enum HandleIndex {
+@Backing(type="byte")
+enum MiracastMode {
+ DISABLED = 0,
/**
- * No handle
+ * Operating as source.
*/
- EMPTY = -1,
+ SOURCE = 1,
/**
- * Use cached handle
+ * Operating as sink.
*/
- CACHED = -2,
+ SINK = 2,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/NetworkRequestEapSimGsmAuthParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/NetworkRequestEapSimGsmAuthParams.aidl
new file mode 100644
index 0000000..c706c81
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/NetworkRequestEapSimGsmAuthParams.aidl
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.GsmRand;
+
+/**
+ * Params of |onNetworkEapSimGsmAuthRequest| request. (Refer RFC 4186)
+ */
+@VintfStability
+parcelable NetworkRequestEapSimGsmAuthParams {
+ GsmRand[] rands;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/NetworkRequestEapSimUmtsAuthParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/NetworkRequestEapSimUmtsAuthParams.aidl
new file mode 100644
index 0000000..2f5e7fa
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/NetworkRequestEapSimUmtsAuthParams.aidl
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Params of |onNetworkEapSimUmtsAuthRequest| request. (Refer RFC 4187)
+ */
+@VintfStability
+parcelable NetworkRequestEapSimUmtsAuthParams {
+ byte[/* 16 */] rand;
+ byte[/* 16 */] autn;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/NetworkResponseEapSimGsmAuthParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/NetworkResponseEapSimGsmAuthParams.aidl
new file mode 100644
index 0000000..38929a2
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/NetworkResponseEapSimGsmAuthParams.aidl
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Params of |sendNetworkEapSimGsmAuthResponse| request. (Refer RFC 4186)
+ */
+@VintfStability
+parcelable NetworkResponseEapSimGsmAuthParams {
+ byte[/* 8 */] kc;
+ byte[/* 4 */] sres;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/NetworkResponseEapSimUmtsAuthParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/NetworkResponseEapSimUmtsAuthParams.aidl
new file mode 100644
index 0000000..5311016
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/NetworkResponseEapSimUmtsAuthParams.aidl
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Params of |sendNetworkEapSimUmtsAuthResponse| request. (Refer RFC 4187)
+ */
+@VintfStability
+parcelable NetworkResponseEapSimUmtsAuthParams {
+ byte[] res;
+ byte[/* 16 */] ik;
+ byte[/* 16 */] ck;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/OceRssiBasedAssocRejectAttr.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/OceRssiBasedAssocRejectAttr.aidl
new file mode 100644
index 0000000..09ec09c
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/OceRssiBasedAssocRejectAttr.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * OceRssiBasedAssocRejectAttr is extracted from (Re-)Association response
+ * frame from an OCE AP to indicate that the AP has rejected the
+ * (Re-)Association request on the basis of insufficient RSSI.
+ * Refer OCE spec v1.0 section 4.2.2 Table 7.
+ */
+@VintfStability
+parcelable OceRssiBasedAssocRejectAttr {
+ /*
+ * Delta RSSI - The difference in dB between the minimum RSSI at which
+ * the AP would accept a (Re-)Association request from the STA before
+ * Retry Delay expires and the AP's measurement of the RSSI at which the
+ * (Re-)Association request was received.
+ */
+ int deltaRssi;
+ /*
+ * Retry Delay - The time period in seconds for which the AP will not
+ * accept any subsequent (Re-)Association requests from the STA, unless
+ * the received RSSI has improved by Delta RSSI.
+ */
+ int retryDelayS;
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/OcspType.aidl
similarity index 61%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/OcspType.aidl
index 0a93c9e..876fb11 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/OcspType.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -14,20 +14,16 @@
* limitations under the License.
*/
-package android.hardware.graphics.composer3;
+package android.hardware.wifi.supplicant;
/**
- * Special index values (always negative) for command queue commands.
+ * OcspType: The type of OCSP request.
*/
@VintfStability
@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+enum OcspType {
+ NONE,
+ REQUEST_CERT_STATUS,
+ REQUIRE_CERT_STATUS,
+ REQUIRE_ALL_CERTS_STATUS,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/OsuMethod.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/OsuMethod.aidl
new file mode 100644
index 0000000..a060365
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/OsuMethod.aidl
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * OSU Method. Refer to section 4.8.1.3 of the Hotspot 2.0 spec.
+ */
+@VintfStability
+@Backing(type="byte")
+enum OsuMethod {
+ OMA_DM = 0,
+ SOAP_XML_SPP = 1,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl
new file mode 100644
index 0000000..bda3c34
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * P2P group capability.
+ * See /external/wpa_supplicant_8/src/common/ieee802_11_defs.h
+ * for all possible values (starting at P2P_GROUP_CAPAB_GROUP_OWNER).
+ */
+@VintfStability
+@Backing(type="int")
+enum P2pGroupCapabilityMask {
+ GROUP_OWNER = 1 << 0,
+ PERSISTENT_GROUP = 1 << 1,
+ GROUP_LIMIT = 1 << 2,
+ INTRA_BSS_DIST = 1 << 3,
+ CROSS_CONN = 1 << 4,
+ PERSISTENT_RECONN = 1 << 5,
+ GROUP_FORMATION = 1 << 6,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvDiscStatusCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvDiscStatusCode.aidl
new file mode 100644
index 0000000..9effd0a
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvDiscStatusCode.aidl
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Status codes for P2P discovery.
+ */
+@VintfStability
+@Backing(type="byte")
+enum P2pProvDiscStatusCode {
+ SUCCESS = 0,
+ TIMEOUT = 1,
+ REJECTED = 2,
+ TIMEOUT_JOIN = 3,
+ INFO_UNAVAILABLE = 4,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pStatusCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pStatusCode.aidl
new file mode 100644
index 0000000..4020f9e
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pStatusCode.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Status codes for P2P operations.
+ */
+@VintfStability
+@Backing(type="int")
+enum P2pStatusCode {
+ SUCCESS = 0,
+ FAIL_INFO_CURRENTLY_UNAVAILABLE = 1,
+ FAIL_INCOMPATIBLE_PARAMS = 2,
+ FAIL_LIMIT_REACHED = 3,
+ FAIL_INVALID_PARAMS = 4,
+ FAIL_UNABLE_TO_ACCOMMODATE = 5,
+ FAIL_PREV_PROTOCOL_ERROR = 6,
+ FAIL_NO_COMMON_CHANNELS = 7,
+ FAIL_UNKNOWN_GROUP = 8,
+ FAIL_BOTH_GO_INTENT_15 = 9,
+ FAIL_INCOMPATIBLE_PROV_METHOD = 10,
+ FAIL_REJECTED_BY_USER = 11,
+ SUCCESS_DEFERRED = 12,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl
new file mode 100644
index 0000000..ad134fa
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Possible mask of values for PairwiseCipher param.
+ * See /external/wpa_supplicant_8/src/common/defs.h for
+ * all possible values (starting at WPA_CIPHER_NONE).
+ */
+@VintfStability
+@Backing(type="int")
+enum PairwiseCipherMask {
+ NONE = 1 << 0,
+ TKIP = 1 << 3,
+ CCMP = 1 << 4,
+ /**
+ * GCMP-128 Pairwise Cipher
+ */
+ GCMP_128 = 1 << 6,
+ /**
+ * SMS4 Pairwise Cipher
+ */
+ SMS4 = 1 << 7,
+ /**
+ * GCMP-256 Pairwise Cipher
+ */
+ GCMP_256 = 1 << 8,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ProtoMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ProtoMask.aidl
new file mode 100644
index 0000000..65c832b
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ProtoMask.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Possible mask of values for Proto param.
+ * See /external/wpa_supplicant_8/src/common/defs.h for
+ * all possible values (starting at WPA_PROTO_WPA).
+ */
+@VintfStability
+@Backing(type="int")
+enum ProtoMask {
+ WPA = 1 << 0,
+ RSN = 1 << 1,
+ WAPI = 1 << 2,
+ OSEN = 1 << 3,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/RxFilterType.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/RxFilterType.aidl
new file mode 100644
index 0000000..5dfb73e
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/RxFilterType.aidl
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Enum describing the types of RX filter supported
+ * via driver commands.
+ */
+@VintfStability
+@Backing(type="byte")
+enum RxFilterType {
+ V4_MULTICAST = 0,
+ V6_MULTICAST = 1,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SaeH2eMode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SaeH2eMode.aidl
new file mode 100644
index 0000000..48a879b
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SaeH2eMode.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * SAE Hash-to-Element mode.
+ */
+@VintfStability
+@Backing(type="byte")
+enum SaeH2eMode {
+ /**
+ * Hash-to-Element is disabled, only Hunting & Pecking is allowed.
+ */
+ DISABLED,
+ /**
+ * Both Hash-to-Element and Hunting & Pecking are allowed.
+ */
+ H2E_OPTIONAL,
+ /**
+ * Only Hash-to-Element is allowed.
+ */
+ H2E_MANDATORY,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/StaIfaceCallbackState.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/StaIfaceCallbackState.aidl
new file mode 100644
index 0000000..19f6f88
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/StaIfaceCallbackState.aidl
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Various states of the interface reported by |onStateChanged|.
+ */
+@VintfStability
+@Backing(type="int")
+enum StaIfaceCallbackState {
+ /**
+ * This state indicates that client is not associated, but is likely to
+ * start looking for an access point. This state is entered when a
+ * connection is lost.
+ */
+ DISCONNECTED = 0,
+ /**
+ * This state is entered if the network interface is disabled, e.g.,
+ * due to rfkill. the supplicant refuses any new operations that would
+ * use the radio until the interface has been enabled.
+ */
+ IFACE_DISABLED = 1,
+ /**
+ * This state is entered if there are no enabled networks in the
+ * configuration. the supplicant is not trying to associate with a new
+ * network and external interaction (e.g., ctrl_iface call to add or
+ * enable a network) is needed to start association.
+ */
+ INACTIVE = 2,
+ /**
+ * This state is entered when the supplicant starts scanning for a
+ * network.
+ */
+ SCANNING = 3,
+ /**
+ * This state is entered when the supplicant has found a suitable BSS
+ * to authenticate with and the driver is configured to try to
+ * authenticate with this BSS. This state is used only with drivers
+ * that use the supplicant as the SME.
+ */
+ AUTHENTICATING = 4,
+ /**
+ * This state is entered when the supplicant has found a suitable BSS
+ * to associate with and the driver is configured to try to associate
+ * with this BSS in ap_scan=1 mode. When using ap_scan=2 mode, this
+ * state is entered when the driver is configured to try to associate
+ * with a network using the configured SSID and security policy.
+ */
+ ASSOCIATING = 5,
+ /**
+ * This state is entered when the driver reports that association has
+ * been successfully completed with an AP. If IEEE 802.1X is used
+ * (with or without WPA/WPA2), the supplicant remains in this state
+ * until the IEEE 802.1X/EAPOL authentication has been completed.
+ */
+ ASSOCIATED = 6,
+ /**
+ * This state is entered when WPA/WPA2 4-Way Handshake is started. In
+ * case of WPA-PSK, this happens when receiving the first EAPOL-Key
+ * frame after association. In case of WPA-EAP, this state is entered
+ * when the IEEE 802.1X/EAPOL authentication has been completed.
+ */
+ FOURWAY_HANDSHAKE = 7,
+ /**
+ * This state is entered when 4-Way Key Handshake has been completed
+ * (i.e., when the supplicant sends out message 4/4) and when Group
+ * Key rekeying is started by the AP (i.e., when supplicant receives
+ * message 1/2).
+ */
+ GROUP_HANDSHAKE = 8,
+ /**
+ * This state is entered when the full authentication process is
+ * completed. In case of WPA2, this happens when the 4-Way Handshake is
+ * successfully completed. With WPA, this state is entered after the
+ * Group Key Handshake; with IEEE 802.1X (non-WPA) connection is
+ * completed after dynamic keys are received (or if not used, after
+ * the EAP authentication has been completed). With static WEP keys and
+ * plaintext connections, this state is entered when an association
+ * has been completed.
+ *
+ * This state indicates that the supplicant has completed its
+ * processing for the association phase and that data connection is
+ * fully configured.
+ */
+ COMPLETED = 9,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/StaIfaceReasonCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/StaIfaceReasonCode.aidl
new file mode 100644
index 0000000..6b05c07
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/StaIfaceReasonCode.aidl
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Reason codes (IEEE Std 802.11-2016, 9.4.1.7, Table 9-45).
+ */
+@VintfStability
+@Backing(type="int")
+enum StaIfaceReasonCode {
+ UNSPECIFIED = 1,
+ PREV_AUTH_NOT_VALID = 2,
+ DEAUTH_LEAVING = 3,
+ DISASSOC_DUE_TO_INACTIVITY = 4,
+ DISASSOC_AP_BUSY = 5,
+ CLASS2_FRAME_FROM_NONAUTH_STA = 6,
+ CLASS3_FRAME_FROM_NONASSOC_STA = 7,
+ DISASSOC_STA_HAS_LEFT = 8,
+ STA_REQ_ASSOC_WITHOUT_AUTH = 9,
+ PWR_CAPABILITY_NOT_VALID = 10,
+ SUPPORTED_CHANNEL_NOT_VALID = 11,
+ BSS_TRANSITION_DISASSOC = 12,
+ INVALID_IE = 13,
+ MICHAEL_MIC_FAILURE = 14,
+ FOURWAY_HANDSHAKE_TIMEOUT = 15,
+ GROUP_KEY_UPDATE_TIMEOUT = 16,
+ IE_IN_4WAY_DIFFERS = 17,
+ GROUP_CIPHER_NOT_VALID = 18,
+ PAIRWISE_CIPHER_NOT_VALID = 19,
+ AKMP_NOT_VALID = 20,
+ UNSUPPORTED_RSN_IE_VERSION = 21,
+ INVALID_RSN_IE_CAPAB = 22,
+ IEEE_802_1X_AUTH_FAILED = 23,
+ CIPHER_SUITE_REJECTED = 24,
+ TDLS_TEARDOWN_UNREACHABLE = 25,
+ TDLS_TEARDOWN_UNSPECIFIED = 26,
+ SSP_REQUESTED_DISASSOC = 27,
+ NO_SSP_ROAMING_AGREEMENT = 28,
+ BAD_CIPHER_OR_AKM = 29,
+ NOT_AUTHORIZED_THIS_LOCATION = 30,
+ SERVICE_CHANGE_PRECLUDES_TS = 31,
+ UNSPECIFIED_QOS_REASON = 32,
+ NOT_ENOUGH_BANDWIDTH = 33,
+ DISASSOC_LOW_ACK = 34,
+ EXCEEDED_TXOP = 35,
+ STA_LEAVING = 36,
+ END_TS_BA_DLS = 37,
+ UNKNOWN_TS_BA = 38,
+ TIMEOUT = 39,
+ PEERKEY_MISMATCH = 45,
+ AUTHORIZED_ACCESS_LIMIT_REACHED = 46,
+ EXTERNAL_SERVICE_REQUIREMENTS = 47,
+ INVALID_FT_ACTION_FRAME_COUNT = 48,
+ INVALID_PMKID = 49,
+ INVALID_MDE = 50,
+ INVALID_FTE = 51,
+ MESH_PEERING_CANCELLED = 52,
+ MESH_MAX_PEERS = 53,
+ MESH_CONFIG_POLICY_VIOLATION = 54,
+ MESH_CLOSE_RCVD = 55,
+ MESH_MAX_RETRIES = 56,
+ MESH_CONFIRM_TIMEOUT = 57,
+ MESH_INVALID_GTK = 58,
+ MESH_INCONSISTENT_PARAMS = 59,
+ MESH_INVALID_SECURITY_CAP = 60,
+ MESH_PATH_ERROR_NO_PROXY_INFO = 61,
+ MESH_PATH_ERROR_NO_FORWARDING_INFO = 62,
+ MESH_PATH_ERROR_DEST_UNREACHABLE = 63,
+ MAC_ADDRESS_ALREADY_EXISTS_IN_MBSS = 64,
+ MESH_CHANNEL_SWITCH_REGULATORY_REQ = 65,
+ MESH_CHANNEL_SWITCH_UNSPECIFIED = 66,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/StaIfaceStatusCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/StaIfaceStatusCode.aidl
new file mode 100644
index 0000000..75e7f68
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/StaIfaceStatusCode.aidl
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Status codes (IEEE Std 802.11-2016, 9.4.1.9, Table 9-46).
+ */
+@VintfStability
+@Backing(type="int")
+enum StaIfaceStatusCode {
+ SUCCESS = 0,
+ UNSPECIFIED_FAILURE = 1,
+ TDLS_WAKEUP_ALTERNATE = 2,
+ TDLS_WAKEUP_REJECT = 3,
+ SECURITY_DISABLED = 5,
+ UNACCEPTABLE_LIFETIME = 6,
+ NOT_IN_SAME_BSS = 7,
+ CAPS_UNSUPPORTED = 10,
+ REASSOC_NO_ASSOC = 11,
+ ASSOC_DENIED_UNSPEC = 12,
+ NOT_SUPPORTED_AUTH_ALG = 13,
+ UNKNOWN_AUTH_TRANSACTION = 14,
+ CHALLENGE_FAIL = 15,
+ AUTH_TIMEOUT = 16,
+ AP_UNABLE_TO_HANDLE_NEW_STA = 17,
+ ASSOC_DENIED_RATES = 18,
+ ASSOC_DENIED_NOSHORT = 19,
+ SPEC_MGMT_REQUIRED = 22,
+ PWR_CAPABILITY_NOT_VALID = 23,
+ SUPPORTED_CHANNEL_NOT_VALID = 24,
+ ASSOC_DENIED_NO_SHORT_SLOT_TIME = 25,
+ ASSOC_DENIED_NO_HT = 27,
+ R0KH_UNREACHABLE = 28,
+ ASSOC_DENIED_NO_PCO = 29,
+ ASSOC_REJECTED_TEMPORARILY = 30,
+ ROBUST_MGMT_FRAME_POLICY_VIOLATION = 31,
+ UNSPECIFIED_QOS_FAILURE = 32,
+ DENIED_INSUFFICIENT_BANDWIDTH = 33,
+ DENIED_POOR_CHANNEL_CONDITIONS = 34,
+ DENIED_QOS_NOT_SUPPORTED = 35,
+ REQUEST_DECLINED = 37,
+ INVALID_PARAMETERS = 38,
+ REJECTED_WITH_SUGGESTED_CHANGES = 39,
+ INVALID_IE = 40,
+ GROUP_CIPHER_NOT_VALID = 41,
+ PAIRWISE_CIPHER_NOT_VALID = 42,
+ AKMP_NOT_VALID = 43,
+ UNSUPPORTED_RSN_IE_VERSION = 44,
+ INVALID_RSN_IE_CAPAB = 45,
+ CIPHER_REJECTED_PER_POLICY = 46,
+ TS_NOT_CREATED = 47,
+ DIRECT_LINK_NOT_ALLOWED = 48,
+ DEST_STA_NOT_PRESENT = 49,
+ DEST_STA_NOT_QOS_STA = 50,
+ ASSOC_DENIED_LISTEN_INT_TOO_LARGE = 51,
+ INVALID_FT_ACTION_FRAME_COUNT = 52,
+ INVALID_PMKID = 53,
+ INVALID_MDIE = 54,
+ INVALID_FTIE = 55,
+ REQUESTED_TCLAS_NOT_SUPPORTED = 56,
+ INSUFFICIENT_TCLAS_PROCESSING_RESOURCES = 57,
+ TRY_ANOTHER_BSS = 58,
+ GAS_ADV_PROTO_NOT_SUPPORTED = 59,
+ NO_OUTSTANDING_GAS_REQ = 60,
+ GAS_RESP_NOT_RECEIVED = 61,
+ STA_TIMED_OUT_WAITING_FOR_GAS_RESP = 62,
+ GAS_RESP_LARGER_THAN_LIMIT = 63,
+ REQ_REFUSED_HOME = 64,
+ ADV_SRV_UNREACHABLE = 65,
+ REQ_REFUSED_SSPN = 67,
+ REQ_REFUSED_UNAUTH_ACCESS = 68,
+ INVALID_RSNIE = 72,
+ U_APSD_COEX_NOT_SUPPORTED = 73,
+ U_APSD_COEX_MODE_NOT_SUPPORTED = 74,
+ BAD_INTERVAL_WITH_U_APSD_COEX = 75,
+ ANTI_CLOGGING_TOKEN_REQ = 76,
+ FINITE_CYCLIC_GROUP_NOT_SUPPORTED = 77,
+ CANNOT_FIND_ALT_TBTT = 78,
+ TRANSMISSION_FAILURE = 79,
+ REQ_TCLAS_NOT_SUPPORTED = 80,
+ TCLAS_RESOURCES_EXCHAUSTED = 81,
+ REJECTED_WITH_SUGGESTED_BSS_TRANSITION = 82,
+ REJECT_WITH_SCHEDULE = 83,
+ REJECT_NO_WAKEUP_SPECIFIED = 84,
+ SUCCESS_POWER_SAVE_MODE = 85,
+ PENDING_ADMITTING_FST_SESSION = 86,
+ PERFORMING_FST_NOW = 87,
+ PENDING_GAP_IN_BA_WINDOW = 88,
+ REJECT_U_PID_SETTING = 89,
+ REFUSED_EXTERNAL_REASON = 92,
+ REFUSED_AP_OUT_OF_MEMORY = 93,
+ REJECTED_EMERGENCY_SERVICE_NOT_SUPPORTED = 94,
+ QUERY_RESP_OUTSTANDING = 95,
+ REJECT_DSE_BAND = 96,
+ TCLAS_PROCESSING_TERMINATED = 97,
+ TS_SCHEDULE_CONFLICT = 98,
+ DENIED_WITH_SUGGESTED_BAND_AND_CHANNEL = 99,
+ MCCAOP_RESERVATION_CONFLICT = 100,
+ MAF_LIMIT_EXCEEDED = 101,
+ MCCA_TRACK_LIMIT_EXCEEDED = 102,
+ DENIED_DUE_TO_SPECTRUM_MANAGEMENT = 103,
+ ASSOC_DENIED_NO_VHT = 104,
+ ENABLEMENT_DENIED = 105,
+ RESTRICTION_FROM_AUTHORIZED_GDB = 106,
+ AUTHORIZATION_DEENABLED = 107,
+ FILS_AUTHENTICATION_FAILURE = 112,
+ UNKNOWN_AUTHENTICATION_SERVER = 113,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
new file mode 100644
index 0000000..c7b7ffd
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * Enum values indicating the status of any supplicant operation.
+ */
+@VintfStability
+@Backing(type="int")
+enum SupplicantStatusCode {
+ /**
+ * No errors.
+ */
+ SUCCESS,
+ /**
+ * Unknown failure occurred.
+ */
+ FAILURE_UNKNOWN,
+ /**
+ * One of the incoming args is invalid.
+ */
+ FAILURE_ARGS_INVALID,
+ /**
+ * |ISupplicantIface| AIDL interface object is no longer valid.
+ */
+ FAILURE_IFACE_INVALID,
+ /**
+ * Iface with the provided name does not exist.
+ */
+ FAILURE_IFACE_UNKNOWN,
+ /**
+ * Iface with the provided name already exists.
+ */
+ FAILURE_IFACE_EXISTS,
+ /**
+ * Iface is disabled and cannot be used.
+ */
+ FAILURE_IFACE_DISABLED,
+ /**
+ * Iface is not currently disconnected, so cannot reconnect.
+ */
+ FAILURE_IFACE_NOT_DISCONNECTED,
+ /**
+ * |ISupplicantNetwork| AIDL interface object is no longer valid.
+ */
+ FAILURE_NETWORK_INVALID,
+ /**
+ * Network with the provided id does not exist.
+ */
+ FAILURE_NETWORK_UNKNOWN,
+ FAILURE_UNSUPPORTED,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl
new file mode 100644
index 0000000..baf20a8
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * WPA3™ Specification Addendum for WPA3 R3 - Table 3.
+ * Transition Disable Indication filled in the third
+ * 4-way handshake message.
+ * See /external/wpa_supplicant_8/src/common/wpa_common.h for
+ * all possible values (starting at TRANSITION_DISABLE_WPA3_PERSONAL).
+ */
+@VintfStability
+@Backing(type="int")
+enum TransitionDisableIndication {
+ USE_WPA3_PERSONAL = 1 << 0,
+ USE_SAE_PK = 1 << 1,
+ USE_WPA3_ENTERPRISE = 1 << 2,
+ USE_ENHANCED_OPEN = 1 << 3,
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WifiTechnology.aidl
similarity index 60%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/WifiTechnology.aidl
index 0a93c9e..00c16b4 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WifiTechnology.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -14,20 +14,29 @@
* limitations under the License.
*/
-package android.hardware.graphics.composer3;
+package android.hardware.wifi.supplicant;
/**
- * Special index values (always negative) for command queue commands.
+ * Wifi Technologies
*/
@VintfStability
@Backing(type="int")
-enum HandleIndex {
+enum WifiTechnology {
+ UNKNOWN = 0,
/**
- * No handle
+ * For 802.11a/b/g
*/
- EMPTY = -1,
+ LEGACY = 1,
/**
- * Use cached handle
+ * For 802.11n
*/
- CACHED = -2,
+ HT = 2,
+ /**
+ * For 802.11ac
+ */
+ VHT = 3,
+ /**
+ * For 802.11ax
+ */
+ HE = 4,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl
new file mode 100644
index 0000000..e174199
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * WPA Driver capability.
+ */
+@VintfStability
+@Backing(type="int")
+enum WpaDriverCapabilitiesMask {
+ /**
+ * Multi Band Operation.
+ */
+ MBO = 1 << 0,
+ /**
+ * Optimized Connectivity Experience.
+ */
+ OCE = 1 << 1,
+ /**
+ * WPA3 SAE Public-Key.
+ */
+ SAE_PK = 1 << 2,
+ /**
+ * Wi-Fi Display R2
+ */
+ WFD_R2 = 1 << 3,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpsConfigError.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpsConfigError.aidl
new file mode 100644
index 0000000..926946c
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpsConfigError.aidl
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * WPS Configuration Error.
+ */
+@VintfStability
+@Backing(type="int")
+enum WpsConfigError {
+ NO_ERROR = 0,
+ OOB_IFACE_READ_ERROR = 1,
+ DECRYPTION_CRC_FAILURE = 2,
+ CHAN_24_NOT_SUPPORTED = 3,
+ CHAN_50_NOT_SUPPORTED = 4,
+ SIGNAL_TOO_WEAK = 5,
+ NETWORK_AUTH_FAILURE = 6,
+ NETWORK_ASSOC_FAILURE = 7,
+ NO_DHCP_RESPONSE = 8,
+ FAILED_DHCP_CONFIG = 9,
+ IP_ADDR_CONFLICT = 10,
+ NO_CONN_TO_REGISTRAR = 11,
+ MULTIPLE_PBC_DETECTED = 12,
+ ROGUE_SUSPECTED = 13,
+ DEVICE_BUSY = 14,
+ SETUP_LOCKED = 15,
+ MSG_TIMEOUT = 16,
+ REG_SESS_TIMEOUT = 17,
+ DEV_PASSWORD_AUTH_FAILURE = 18,
+ CHAN_60G_NOT_SUPPORTED = 19,
+ PUBLIC_KEY_HASH_MISMATCH = 20,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpsConfigMethods.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpsConfigMethods.aidl
new file mode 100644
index 0000000..ec08a45
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpsConfigMethods.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * WPS config methods.
+ * Refer to section 3 of IBSS with Wi-Fi Protected Setup
+ * Technical Specification Version 1.0.0.
+ */
+@VintfStability
+@Backing(type="int")
+enum WpsConfigMethods {
+ USBA = 0x0001,
+ ETHERNET = 0x0002,
+ LABEL = 0x0004,
+ DISPLAY = 0x0008,
+ EXT_NFC_TOKEN = 0x0010,
+ INT_NFC_TOKEN = 0x0020,
+ NFC_INTERFACE = 0x0040,
+ PUSHBUTTON = 0x0080,
+ KEYPAD = 0x0100,
+ VIRT_PUSHBUTTON = 0x0280,
+ PHY_PUSHBUTTON = 0x0480,
+ P2PS = 0x1000,
+ VIRT_DISPLAY = 0x2008,
+ PHY_DISPLAY = 0x4008,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl
new file mode 100644
index 0000000..ca5a533
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+/**
+ * WPS Device Password ID
+ */
+@VintfStability
+@Backing(type="int")
+enum WpsDevPasswordId {
+ DEFAULT = 0x0000,
+ USER_SPECIFIED = 0x0001,
+ MACHINE_SPECIFIED = 0x0002,
+ REKEY = 0x0003,
+ PUSHBUTTON = 0x0004,
+ REGISTRAR_SPECIFIED = 0x0005,
+ NFC_CONNECTION_HANDOVER = 0x0007,
+ P2PS_DEFAULT = 0x0008,
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpsErrorIndication.aidl
similarity index 61%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpsErrorIndication.aidl
index 0a93c9e..4866acc 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/HandleIndex.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpsErrorIndication.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright (C) 2021 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
+ * 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,
@@ -14,20 +14,16 @@
* limitations under the License.
*/
-package android.hardware.graphics.composer3;
+package android.hardware.wifi.supplicant;
/**
- * Special index values (always negative) for command queue commands.
+ * Vendor specific Error Indication for WPS event messages.
*/
@VintfStability
@Backing(type="int")
-enum HandleIndex {
- /**
- * No handle
- */
- EMPTY = -1,
- /**
- * Use cached handle
- */
- CACHED = -2,
+enum WpsErrorIndication {
+ NO_ERROR = 0,
+ SECURITY_TKIP_ONLY_PROHIBITED = 1,
+ SECURITY_WEP_PROHIBITED = 2,
+ AUTH_FAILURE = 3,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl
new file mode 100644
index 0000000..5b59392
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2021 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.wifi.supplicant;
+
+@VintfStability
+@Backing(type="int")
+enum WpsProvisionMethod {
+ /**
+ * Push button method.
+ */
+ PBC,
+ /**
+ * Display pin method configuration - pin is generated and displayed on
+ * device.
+ */
+ DISPLAY,
+ /**
+ * Keypad pin method configuration - pin is entered on device.
+ */
+ KEYPAD,
+}
diff --git a/wifi/supplicant/aidl/vts/functional/Android.bp b/wifi/supplicant/aidl/vts/functional/Android.bp
new file mode 100644
index 0000000..65f9652
--- /dev/null
+++ b/wifi/supplicant/aidl/vts/functional/Android.bp
@@ -0,0 +1,90 @@
+//
+// Copyright (C) 2021 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 {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_test {
+ name: "VtsHalWifiSupplicantStaIfaceTargetTest",
+ defaults: [
+ "VtsHalTargetTestDefaults",
+ "use_libaidlvintf_gtest_helper_static",
+ ],
+ srcs: ["supplicant_sta_iface_aidl_test.cpp"],
+ shared_libs: [
+ "libbinder",
+ "libbinder_ndk",
+ ],
+ static_libs: [
+ "android.hardware.wifi.supplicant-V1-ndk",
+ "libwifi-system",
+ "libwifi-system-iface",
+ ],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
+}
+
+cc_test {
+ name: "VtsHalWifiSupplicantStaNetworkTargetTest",
+ defaults: [
+ "VtsHalTargetTestDefaults",
+ "use_libaidlvintf_gtest_helper_static",
+ ],
+ srcs: ["supplicant_sta_network_aidl_test.cpp"],
+ shared_libs: [
+ "libbinder",
+ "libbinder_ndk",
+ ],
+ static_libs: [
+ "android.hardware.wifi.supplicant-V1-ndk",
+ "libwifi-system",
+ "libwifi-system-iface",
+ ],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
+}
+
+cc_test {
+ name: "VtsHalWifiSupplicantP2pIfaceTargetTest",
+ defaults: [
+ "VtsHalTargetTestDefaults",
+ "use_libaidlvintf_gtest_helper_static",
+ ],
+ srcs: ["supplicant_p2p_iface_aidl_test.cpp"],
+ shared_libs: [
+ "libbinder",
+ "libbinder_ndk",
+ ],
+ static_libs: [
+ "android.hardware.wifi.supplicant-V1-ndk",
+ "libwifi-system",
+ "libwifi-system-iface",
+ ],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
+}
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp
new file mode 100644
index 0000000..2f4f06d
--- /dev/null
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp
@@ -0,0 +1,633 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <VtsCoreUtil.h>
+#include <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/wifi/supplicant/BnSupplicant.h>
+#include <aidl/android/hardware/wifi/supplicant/BnSupplicantP2pIfaceCallback.h>
+#include <android/binder_manager.h>
+#include <android/binder_status.h>
+#include <binder/IServiceManager.h>
+#include <binder/ProcessState.h>
+#include <cutils/properties.h>
+
+#include "supplicant_test_utils.h"
+
+using aidl::android::hardware::wifi::supplicant::BnSupplicantP2pIfaceCallback;
+using aidl::android::hardware::wifi::supplicant::DebugLevel;
+using aidl::android::hardware::wifi::supplicant::FreqRange;
+using aidl::android::hardware::wifi::supplicant::IfaceType;
+using aidl::android::hardware::wifi::supplicant::ISupplicant;
+using aidl::android::hardware::wifi::supplicant::ISupplicantP2pIface;
+using aidl::android::hardware::wifi::supplicant::MiracastMode;
+using aidl::android::hardware::wifi::supplicant::P2pGroupCapabilityMask;
+using aidl::android::hardware::wifi::supplicant::P2pProvDiscStatusCode;
+using aidl::android::hardware::wifi::supplicant::P2pStatusCode;
+using aidl::android::hardware::wifi::supplicant::WpsConfigMethods;
+using aidl::android::hardware::wifi::supplicant::WpsDevPasswordId;
+using aidl::android::hardware::wifi::supplicant::WpsProvisionMethod;
+using android::ProcessState;
+
+namespace {
+const std::string kTestSsidStr = "TestSsid1234";
+const std::vector<uint8_t> kTestSsid =
+ std::vector<uint8_t>(kTestSsidStr.begin(), kTestSsidStr.end());
+const std::vector<uint8_t> kTestMacAddr = {0x56, 0x67, 0x67, 0xf4, 0x56, 0x92};
+const std::vector<uint8_t> kTestPeerMacAddr = {0x56, 0x67, 0x55,
+ 0xf4, 0x56, 0x92};
+const std::vector<uint8_t> kTestZeroMacAddr = std::vector<uint8_t>(6, 0);
+const std::string kTestPassphrase = "P2pWorld1234";
+const std::string kTestConnectPin = "34556665";
+const std::string kTestGroupIfName = "TestGroup";
+const uint32_t kTestFindTimeout = 5;
+const uint32_t kTestConnectGoIntent = 6;
+const uint32_t kTestNetworkId = 7;
+const uint32_t kTestGroupFreq = 0;
+const bool kTestGroupPersistent = false;
+const bool kTestGroupIsJoin = false;
+
+} // namespace
+
+class SupplicantP2pIfaceCallback : public BnSupplicantP2pIfaceCallback {
+ public:
+ SupplicantP2pIfaceCallback() = default;
+
+ ::ndk::ScopedAStatus onDeviceFound(
+ const std::vector<uint8_t>& /* srcAddress */,
+ const std::vector<uint8_t>& /* p2pDeviceAddress */,
+ const std::vector<uint8_t>& /* primaryDeviceType */,
+ const std::string& /* deviceName */,
+ WpsConfigMethods /* configMethods */, int8_t /* deviceCapabilities */,
+ P2pGroupCapabilityMask /* groupCapabilities */,
+ const std::vector<uint8_t>& /* wfdDeviceInfo */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onDeviceLost(
+ const std::vector<uint8_t>& /* p2pDeviceAddress */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onFindStopped() override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onGoNegotiationCompleted(
+ P2pStatusCode /* status */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onGoNegotiationRequest(
+ const std::vector<uint8_t>& /* srcAddress */,
+ WpsDevPasswordId /* passwordId */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onGroupFormationFailure(
+ const std::string& /* failureReason */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onGroupFormationSuccess() override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onGroupRemoved(const std::string& /* groupIfname */,
+ bool /* isGroupOwner */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onGroupStarted(
+ const std::string& /* groupIfname */, bool /* isGroupOwner */,
+ const std::vector<uint8_t>& /* ssid */, int32_t /* frequency */,
+ const std::vector<uint8_t>& /* psk */,
+ const std::string& /* passphrase */,
+ const std::vector<uint8_t>& /* goDeviceAddress */,
+ bool /* isPersistent */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onInvitationReceived(
+ const std::vector<uint8_t>& /* srcAddress */,
+ const std::vector<uint8_t>& /* goDeviceAddress */,
+ const std::vector<uint8_t>& /* bssid */,
+ int32_t /* persistentNetworkId */,
+ int32_t /* operatingFrequency */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onInvitationResult(
+ const std::vector<uint8_t>& /* bssid */,
+ P2pStatusCode /* status */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onProvisionDiscoveryCompleted(
+ const std::vector<uint8_t>& /* p2pDeviceAddress */,
+ bool /* isRequest */, P2pProvDiscStatusCode /* status */,
+ WpsConfigMethods /* configMethods */,
+ const std::string& /* generatedPin */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onR2DeviceFound(
+ const std::vector<uint8_t>& /* srcAddress */,
+ const std::vector<uint8_t>& /* p2pDeviceAddress */,
+ const std::vector<uint8_t>& /* primaryDeviceType */,
+ const std::string& /* deviceName */,
+ WpsConfigMethods /* configMethods */, int8_t /* deviceCapabilities */,
+ P2pGroupCapabilityMask /* groupCapabilities */,
+ const std::vector<uint8_t>& /* wfdDeviceInfo */,
+ const std::vector<uint8_t>& /* wfdR2DeviceInfo */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onServiceDiscoveryResponse(
+ const std::vector<uint8_t>& /* srcAddress */,
+ char16_t /* updateIndicator */,
+ const std::vector<uint8_t>& /* tlvs */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onStaAuthorized(
+ const std::vector<uint8_t>& /* srcAddress */,
+ const std::vector<uint8_t>& /* p2pDeviceAddress */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onStaDeauthorized(
+ const std::vector<uint8_t>& /* srcAddress */,
+ const std::vector<uint8_t>& /* p2pDeviceAddress */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+};
+
+class SupplicantP2pIfaceAidlTest : public testing::TestWithParam<std::string> {
+ public:
+ void SetUp() override {
+ initializeService();
+ supplicant_ = ISupplicant::fromBinder(ndk::SpAIBinder(
+ AServiceManager_waitForService(GetParam().c_str())));
+ ASSERT_NE(supplicant_, nullptr);
+ ASSERT_TRUE(supplicant_
+ ->setDebugParams(DebugLevel::EXCESSIVE,
+ true, // show timestamps
+ true)
+ .isOk());
+
+ bool p2pEnabled =
+ testing::deviceSupportsFeature("android.hardware.wifi.direct");
+ if (!p2pEnabled) {
+ GTEST_SKIP() << "Wi-Fi Direct is not supported, skip this test.";
+ }
+
+ EXPECT_TRUE(supplicant_->addP2pInterface(getP2pIfaceName(), &p2p_iface_)
+ .isOk());
+ ASSERT_NE(p2p_iface_, nullptr);
+ }
+
+ void TearDown() override {
+ stopSupplicant();
+ startWifiFramework();
+ }
+
+ protected:
+ std::shared_ptr<ISupplicant> supplicant_;
+ std::shared_ptr<ISupplicantP2pIface> p2p_iface_;
+};
+
+/*
+ * RegisterCallback
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, RegisterCallback) {
+ std::shared_ptr<SupplicantP2pIfaceCallback> callback =
+ ndk::SharedRefBase::make<SupplicantP2pIfaceCallback>();
+ ASSERT_NE(callback, nullptr);
+ EXPECT_TRUE(p2p_iface_->registerCallback(callback).isOk());
+}
+
+/*
+ * GetName
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, GetName) {
+ std::string name;
+ EXPECT_TRUE(p2p_iface_->getName(&name).isOk());
+ EXPECT_NE(name.size(), 0);
+}
+
+/*
+ * GetType
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, GetType) {
+ IfaceType type;
+ EXPECT_TRUE(p2p_iface_->getType(&type).isOk());
+ EXPECT_EQ(type, IfaceType::P2P);
+}
+
+/*
+ * GetDeviceAddress
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, GetDeviceAddress) {
+ std::vector<uint8_t> macAddr;
+ EXPECT_TRUE(p2p_iface_->getDeviceAddress(&macAddr).isOk());
+ EXPECT_EQ(macAddr.size(), 6);
+}
+
+/*
+ * GetSsid
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, GetSsid) {
+ // This will fail with fake values.
+ std::vector<uint8_t> ssid;
+ EXPECT_FALSE(p2p_iface_->getSsid(kTestMacAddr, &ssid).isOk());
+}
+
+/*
+ * GetGroupCapability
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, GetGroupCapability) {
+ // This will fail with fake values.
+ P2pGroupCapabilityMask cap;
+ EXPECT_FALSE(p2p_iface_->getGroupCapability(kTestMacAddr, &cap).isOk());
+}
+
+/*
+ * Set/Get Edmg
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, SetGetEdmg) {
+ bool emdg = false;
+ EXPECT_TRUE(p2p_iface_->setEdmg(true).isOk());
+ EXPECT_TRUE(p2p_iface_->getEdmg(&emdg).isOk());
+ EXPECT_EQ(emdg, true);
+
+ EXPECT_TRUE(p2p_iface_->setEdmg(false).isOk());
+ EXPECT_TRUE(p2p_iface_->getEdmg(&emdg).isOk());
+ EXPECT_EQ(emdg, false);
+}
+
+/*
+ * SetWpsDeviceName
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, SetWpsDeviceName) {
+ const std::string deviceName = "TestWpsDeviceName";
+ EXPECT_TRUE(p2p_iface_->setWpsDeviceName(deviceName).isOk());
+}
+
+/*
+ * SetWpsDeviceType
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, SetWpsDeviceType) {
+ const std::vector<uint8_t> deviceType = std::vector<uint8_t>(8, 0x01);
+ EXPECT_TRUE(p2p_iface_->setWpsDeviceType(deviceType).isOk());
+}
+
+/*
+ * SetWpsManufacturer
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, SetWpsManufacturer) {
+ const std::string deviceManufacturer = "TestManufacturer";
+ EXPECT_TRUE(p2p_iface_->setWpsManufacturer(deviceManufacturer).isOk());
+}
+
+/*
+ * SetWpsModelName
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, SetWpsModelName) {
+ const std::string modelName = "TestModelName";
+ EXPECT_TRUE(p2p_iface_->setWpsModelName(modelName).isOk());
+}
+
+/*
+ * SetWpsModelNumber
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, SetWpsModelNumber) {
+ const std::string modelNumber = "TestModelNumber";
+ EXPECT_TRUE(p2p_iface_->setWpsModelName(modelNumber).isOk());
+}
+
+/*
+ * SetWpsSerialNumber
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, SetWpsSerialNumber) {
+ const std::string serialNumber = "TestSerialNumber";
+ EXPECT_TRUE(p2p_iface_->setWpsSerialNumber(serialNumber).isOk());
+}
+
+/*
+ * SetWpsConfigMethods
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, SetWpsConfigMethods) {
+ const WpsConfigMethods config = WpsConfigMethods::DISPLAY;
+ EXPECT_TRUE(p2p_iface_->setWpsConfigMethods(config).isOk());
+}
+
+/*
+ * SetSsidPostfix
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, SetSsidPostfix) {
+ const std::vector<uint8_t> ssidPostfix = {'t', 'e', 's', 't'};
+ EXPECT_TRUE(p2p_iface_->setSsidPostfix(ssidPostfix).isOk());
+}
+
+/*
+ * SetWfdDeviceInfo
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, SetWfdDeviceInfo) {
+ const std::vector<uint8_t> wfdDeviceInfo = std::vector<uint8_t>(6, 0x01);
+ EXPECT_TRUE(p2p_iface_->setWfdDeviceInfo(wfdDeviceInfo).isOk());
+}
+
+/*
+ * SetWfdR2DeviceInfo
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, SetWfdR2DeviceInfo) {
+ const std::vector<uint8_t> wfdR2DeviceInfo = std::vector<uint8_t>(4, 0x01);
+ EXPECT_TRUE(p2p_iface_->setWfdR2DeviceInfo(wfdR2DeviceInfo).isOk());
+}
+
+/*
+ * SetGroupIdle
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, SetGroupIdle) {
+ // This will fail with fake values.
+ const uint32_t groupIdleTimeout = 8;
+ EXPECT_FALSE(
+ p2p_iface_->setGroupIdle(kTestGroupIfName, groupIdleTimeout).isOk());
+}
+
+/*
+ * SetPowerSave
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, SetPowerSave) {
+ // This will fail with fake values.
+ EXPECT_FALSE(p2p_iface_->setPowerSave(kTestGroupIfName, true).isOk());
+ EXPECT_FALSE(p2p_iface_->setPowerSave(kTestGroupIfName, false).isOk());
+}
+
+/*
+ * SetMiracastMode
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, SetMiracastMode) {
+ EXPECT_TRUE(p2p_iface_->setMiracastMode(MiracastMode::DISABLED).isOk());
+ EXPECT_TRUE(p2p_iface_->setMiracastMode(MiracastMode::SOURCE).isOk());
+ EXPECT_TRUE(p2p_iface_->setMiracastMode(MiracastMode::SINK).isOk());
+}
+
+/*
+ * SetDisallowedFrequencies
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, SetDisallowedFrequencies) {
+ FreqRange range1;
+ range1.min = 2412;
+ range1.max = 2432;
+ const std::vector<FreqRange> ranges = {range1};
+ EXPECT_TRUE(p2p_iface_->setDisallowedFrequencies(ranges).isOk());
+}
+
+/*
+ * SetListenChannel
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, SetListenChannel) {
+ const uint32_t testChannel = 1;
+ const uint32_t testOperatingClass = 81;
+ EXPECT_TRUE(
+ p2p_iface_->setListenChannel(testChannel, testOperatingClass).isOk());
+}
+
+/*
+ * SetMacRandomization
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, EnableMacRandomization) {
+ // Enable twice
+ EXPECT_TRUE(p2p_iface_->setMacRandomization(true).isOk());
+ EXPECT_TRUE(p2p_iface_->setMacRandomization(true).isOk());
+
+ // Disable twice
+ EXPECT_TRUE(p2p_iface_->setMacRandomization(false).isOk());
+ EXPECT_TRUE(p2p_iface_->setMacRandomization(false).isOk());
+}
+
+/*
+ * AddGroup
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, AddGroup) {
+ EXPECT_TRUE(p2p_iface_->addGroup(false, kTestNetworkId).isOk());
+}
+
+/*
+ * RemoveGroup
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, RemoveGroup) {
+ // This will fail with fake values.
+ EXPECT_FALSE(p2p_iface_->removeGroup(kTestGroupIfName).isOk());
+}
+
+/*
+ * AddGroupWithConfig - success.
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, AddGroupWithConfig_Success) {
+ EXPECT_TRUE(p2p_iface_
+ ->addGroupWithConfig(kTestSsid, kTestPassphrase,
+ kTestGroupPersistent, kTestGroupFreq,
+ kTestZeroMacAddr, kTestGroupIsJoin)
+ .isOk());
+}
+
+/*
+ * AddGroupWithConfig - failure due to invalid SSID.
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, AddGroupWithConfig_FailureInvalidSsid) {
+ const std::vector<uint8_t> ssid;
+ EXPECT_FALSE(p2p_iface_
+ ->addGroupWithConfig(ssid, kTestPassphrase,
+ kTestGroupPersistent, kTestGroupFreq,
+ kTestZeroMacAddr, kTestGroupIsJoin)
+ .isOk());
+}
+
+/*
+ * AddGroupWithConfig - failure due to invalid passphrase.
+ */
+TEST_P(SupplicantP2pIfaceAidlTest,
+ AddGroupWithConfig_FailureInvalidPassphrase) {
+ const std::string passphrase = "1234";
+ EXPECT_FALSE(p2p_iface_
+ ->addGroupWithConfig(kTestSsid, passphrase,
+ kTestGroupPersistent, kTestGroupFreq,
+ kTestZeroMacAddr, kTestGroupIsJoin)
+ .isOk());
+}
+
+/*
+ * AddGroupWithConfig - failure due to invalid frequency.
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, AddGroupWithConfig_FailureInvalidFrequency) {
+ const int freq = 9999;
+ EXPECT_FALSE(p2p_iface_
+ ->addGroupWithConfig(kTestSsid, kTestPassphrase,
+ kTestGroupPersistent, freq,
+ kTestZeroMacAddr, kTestGroupIsJoin)
+ .isOk());
+}
+
+/*
+ * Find
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, Find) {
+ EXPECT_TRUE(p2p_iface_->find(kTestFindTimeout).isOk());
+}
+
+/*
+ * StopFind
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, StopFind) {
+ EXPECT_TRUE(p2p_iface_->find(kTestFindTimeout).isOk());
+ EXPECT_TRUE(p2p_iface_->stopFind().isOk());
+}
+
+/*
+ * Flush
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, Flush) {
+ EXPECT_TRUE(p2p_iface_->flush().isOk());
+}
+
+/*
+ * Connect
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, Connect) {
+ /*
+ * Auto-join is not enabled before R. After enabling auto-join,
+ * this should always succeed.
+ */
+ std::string pin;
+ EXPECT_TRUE(p2p_iface_
+ ->connect(kTestMacAddr, WpsProvisionMethod::PBC,
+ kTestConnectPin, false, false,
+ kTestConnectGoIntent, &pin)
+ .isOk());
+}
+
+/*
+ * CancelConnect
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, CancelConnect) {
+ std::string pin;
+ EXPECT_TRUE(p2p_iface_
+ ->connect(kTestMacAddr, WpsProvisionMethod::PBC,
+ kTestConnectPin, false, false,
+ kTestConnectGoIntent, &pin)
+ .isOk());
+ EXPECT_TRUE(p2p_iface_->cancelConnect().isOk());
+}
+
+/*
+ * ProvisionDiscovery
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, ProvisionDiscovery) {
+ // This will fail with fake values.
+ EXPECT_FALSE(
+ p2p_iface_->provisionDiscovery(kTestMacAddr, WpsProvisionMethod::PBC)
+ .isOk());
+}
+
+/*
+ * Reject
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, Reject) {
+ // This will fail with fake values.
+ ASSERT_FALSE(p2p_iface_->reject(kTestMacAddr).isOk());
+}
+
+/*
+ * Invite
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, Invite) {
+ // This will fail with fake values.
+ EXPECT_FALSE(
+ p2p_iface_->invite(kTestGroupIfName, kTestMacAddr, kTestPeerMacAddr)
+ .isOk());
+}
+
+/*
+ * Reinvoke
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, Reinvoke) {
+ // This will fail with fake values.
+ EXPECT_FALSE(p2p_iface_->reinvoke(kTestNetworkId, kTestMacAddr).isOk());
+}
+
+/*
+ * ConfigureExtListen
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, ConfigureExtListen) {
+ const uint32_t extListenPeriod = 400;
+ const uint32_t extListenInterval = 400;
+ EXPECT_TRUE(
+ p2p_iface_->configureExtListen(extListenPeriod, extListenInterval)
+ .isOk());
+}
+
+/*
+ * FlushServices
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, FlushServices) {
+ EXPECT_TRUE(p2p_iface_->flushServices().isOk());
+}
+
+/*
+ * EnableWfd
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, EnableWfd) {
+ EXPECT_TRUE(p2p_iface_->enableWfd(true).isOk());
+ EXPECT_TRUE(p2p_iface_->enableWfd(false).isOk());
+}
+
+/*
+ * Add/Remove BonjourService
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, AddAndRemoveBonjourService) {
+ const std::string serviceQueryStr = "testquery";
+ const std::string serviceResponseStr = "testresponse";
+ const std::vector<uint8_t> bonjourServiceQuery =
+ std::vector<uint8_t>(serviceQueryStr.begin(), serviceQueryStr.end());
+ const std::vector<uint8_t> bonjourServiceResponse = std::vector<uint8_t>(
+ serviceResponseStr.begin(), serviceResponseStr.end());
+
+ EXPECT_TRUE(
+ p2p_iface_
+ ->addBonjourService(bonjourServiceQuery, bonjourServiceResponse)
+ .isOk());
+ EXPECT_TRUE(p2p_iface_->removeBonjourService(bonjourServiceQuery).isOk());
+
+ // This will fail because the boujour service with
+ // bonjourServiceQuery was already removed.
+ EXPECT_FALSE(p2p_iface_->removeBonjourService(bonjourServiceQuery).isOk());
+}
+
+/*
+ * Add/Remove UpnpService
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, AddAndRemoveUpnpService) {
+ const std::string upnpServiceName = "TestServiceName";
+ EXPECT_TRUE(
+ p2p_iface_->addUpnpService(0 /* version */, upnpServiceName).isOk());
+ EXPECT_TRUE(
+ p2p_iface_->removeUpnpService(0 /* version */, upnpServiceName).isOk());
+
+ // This will fail because Upnp service with
+ // upnpServiceName was already removed.
+ EXPECT_FALSE(
+ p2p_iface_->removeUpnpService(0 /* version */, upnpServiceName).isOk());
+}
+
+INSTANTIATE_TEST_SUITE_P(Supplicant, SupplicantP2pIfaceAidlTest,
+ testing::ValuesIn(android::getAidlHalInstanceNames(
+ ISupplicant::descriptor)),
+ android::PrintInstanceNameToString);
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ ProcessState::self()->setThreadPoolMaxThreadCount(1);
+ ProcessState::self()->startThreadPool();
+ return RUN_ALL_TESTS();
+}
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
new file mode 100644
index 0000000..f51c07f
--- /dev/null
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
@@ -0,0 +1,782 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <VtsCoreUtil.h>
+#include <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/wifi/supplicant/BnSupplicant.h>
+#include <aidl/android/hardware/wifi/supplicant/BnSupplicantStaIfaceCallback.h>
+#include <android/binder_manager.h>
+#include <android/binder_status.h>
+#include <binder/IServiceManager.h>
+#include <binder/ProcessState.h>
+#include <cutils/properties.h>
+
+#include "supplicant_test_utils.h"
+
+using aidl::android::hardware::wifi::supplicant::AnqpInfoId;
+using aidl::android::hardware::wifi::supplicant::BnSupplicantStaIfaceCallback;
+using aidl::android::hardware::wifi::supplicant::BtCoexistenceMode;
+using aidl::android::hardware::wifi::supplicant::ConnectionCapabilities;
+using aidl::android::hardware::wifi::supplicant::DebugLevel;
+using aidl::android::hardware::wifi::supplicant::DppAkm;
+using aidl::android::hardware::wifi::supplicant::DppCurve;
+using aidl::android::hardware::wifi::supplicant::DppNetRole;
+using aidl::android::hardware::wifi::supplicant::DppResponderBootstrapInfo;
+using aidl::android::hardware::wifi::supplicant::Hs20AnqpSubtypes;
+using aidl::android::hardware::wifi::supplicant::IfaceType;
+using aidl::android::hardware::wifi::supplicant::ISupplicant;
+using aidl::android::hardware::wifi::supplicant::ISupplicantStaIface;
+using aidl::android::hardware::wifi::supplicant::ISupplicantStaNetwork;
+using aidl::android::hardware::wifi::supplicant::KeyMgmtMask;
+using aidl::android::hardware::wifi::supplicant::RxFilterType;
+using aidl::android::hardware::wifi::supplicant::WpaDriverCapabilitiesMask;
+using aidl::android::hardware::wifi::supplicant::WpsConfigMethods;
+using android::ProcessState;
+
+static constexpr int TIMEOUT_PERIOD = 60;
+class IfaceDppCallback;
+
+namespace {
+const std::vector<uint8_t> kTestMacAddr = {0x56, 0x67, 0x67, 0xf4, 0x56, 0x92};
+const std::string kTestUri =
+ "DPP:C:81/1,117/"
+ "40;M:48d6d5bd1de1;I:G1197843;K:MDkwEwYHKoZIzj0CAQYIKoZIzj"
+ "0DAQcDIgAD0edY4X3N//HhMFYsZfMbQJTiNFtNIWF/cIwMB/gzqOM=;;";
+} // namespace
+
+class SupplicantStaIfaceCallback : public BnSupplicantStaIfaceCallback {
+ public:
+ SupplicantStaIfaceCallback() = default;
+
+ ::ndk::ScopedAStatus onAnqpQueryDone(
+ const std::vector<uint8_t>& /* bssid */,
+ const ::aidl::android::hardware::wifi::supplicant::AnqpData& /* data */,
+ const ::aidl::android::hardware::wifi::supplicant::
+ Hs20AnqpData& /* hs20Data */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onAssociationRejected(
+ const ::aidl::android::hardware::wifi::supplicant::
+ AssociationRejectionData& /* assocRejectData */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onAuthenticationTimeout(
+ const std::vector<uint8_t>& /* bssid */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onBssTmHandlingDone(
+ const ::aidl::android::hardware::wifi::supplicant::
+ BssTmData& /* tmData */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onBssidChanged(
+ ::aidl::android::hardware::wifi::supplicant::
+ BssidChangeReason /* reason */,
+ const std::vector<uint8_t>& /* bssid */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onDisconnected(
+ const std::vector<uint8_t>& /* bssid */, bool /* locallyGenerated */,
+ ::aidl::android::hardware::wifi::supplicant::
+ StaIfaceReasonCode /* reasonCode */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onDppFailure(
+ ::aidl::android::hardware::wifi::supplicant::DppFailureCode /* code */,
+ const std::string& /* ssid */, const std::string& /* channelList */,
+ const std::vector<char16_t>& /* bandList */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onDppProgress(
+ ::aidl::android::hardware::wifi::supplicant::DppProgressCode /* code */)
+ override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onDppSuccess(
+ ::aidl::android::hardware::wifi::supplicant::DppEventType /* type */)
+ override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onDppSuccessConfigReceived(
+ const std::vector<uint8_t>& /* ssid */,
+ const std::string& /* password */,
+ const std::vector<uint8_t>& /* psk */,
+ ::aidl::android::hardware::wifi::supplicant::DppAkm /* securityAkm */)
+ override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onDppSuccessConfigSent() override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onEapFailure(int32_t /* errorCode */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onExtRadioWorkStart(int32_t /* id */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onExtRadioWorkTimeout(int32_t /* id */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onHs20DeauthImminentNotice(
+ const std::vector<uint8_t>& /* bssid */, int32_t /* reasonCode */,
+ int32_t /* reAuthDelayInSec */, const std::string& /* url */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onHs20IconQueryDone(
+ const std::vector<uint8_t>& /* bssid */,
+ const std::string& /* fileName */,
+ const std::vector<uint8_t>& /* data */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onHs20SubscriptionRemediation(
+ const std::vector<uint8_t>& /* bssid */,
+ ::aidl::android::hardware::wifi::supplicant::OsuMethod /* osuMethod */,
+ const std::string& /* url */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus
+ onHs20TermsAndConditionsAcceptanceRequestedNotification(
+ const std::vector<uint8_t>& /* bssid */,
+ const std::string& /* url */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onNetworkAdded(int32_t /* id */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onNetworkNotFound(
+ const std::vector<uint8_t>& /* ssid */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onNetworkRemoved(int32_t /* id */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onPmkCacheAdded(
+ int64_t /* expirationTimeInSec */,
+ const std::vector<uint8_t>& /* serializedEntry */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onStateChanged(
+ ::aidl::android::hardware::wifi::supplicant::
+ StaIfaceCallbackState /* newState */,
+ const std::vector<uint8_t>& /* bssid */, int32_t /* id */,
+ const std::vector<uint8_t>& /* ssid */,
+ bool /* filsHlpSent */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onWpsEventFail(
+ const std::vector<uint8_t>& /* bssid */,
+ ::aidl::android::hardware::wifi::supplicant::
+ WpsConfigError /* configError */,
+ ::aidl::android::hardware::wifi::supplicant::
+ WpsErrorIndication /* errorInd */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onWpsEventPbcOverlap() override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onWpsEventSuccess() override {
+ return ndk::ScopedAStatus::ok();
+ }
+};
+
+class SupplicantStaIfaceAidlTest : public testing::TestWithParam<std::string> {
+ public:
+ void SetUp() override {
+ initializeService();
+ supplicant_ = ISupplicant::fromBinder(ndk::SpAIBinder(
+ AServiceManager_waitForService(GetParam().c_str())));
+ ASSERT_NE(supplicant_, nullptr);
+ ASSERT_TRUE(supplicant_
+ ->setDebugParams(DebugLevel::EXCESSIVE,
+ true, // show timestamps
+ true)
+ .isOk());
+ EXPECT_TRUE(supplicant_->addStaInterface(getStaIfaceName(), &sta_iface_)
+ .isOk());
+ ASSERT_NE(sta_iface_, nullptr);
+ }
+
+ void TearDown() override {
+ stopSupplicant();
+ startWifiFramework();
+ }
+
+ enum DppCallbackType {
+ ANY_CALLBACK = -2,
+ INVALID = -1,
+ EVENT_SUCCESS = 0,
+ EVENT_PROGRESS,
+ EVENT_FAILURE,
+ };
+
+ DppCallbackType dppCallbackType;
+ uint32_t code;
+
+ // Used as a mechanism to inform the test about data/event callback
+ inline void notify() {
+ std::unique_lock<std::mutex> lock(mtx_);
+ cv_.notify_one();
+ }
+
+ // Test code calls this function to wait for data/event callback
+ inline std::cv_status wait(DppCallbackType waitForCallbackType) {
+ std::unique_lock<std::mutex> lock(mtx_);
+ EXPECT_NE(INVALID, waitForCallbackType); // can't ASSERT in a
+ // non-void-returning method
+ auto now = std::chrono::system_clock::now();
+ std::cv_status status =
+ cv_.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD));
+ return status;
+ }
+
+ protected:
+ std::shared_ptr<ISupplicant> supplicant_;
+ std::shared_ptr<ISupplicantStaIface> sta_iface_;
+
+ private:
+ // synchronization objects
+ std::mutex mtx_;
+ std::condition_variable cv_;
+};
+
+/*
+ * RegisterCallback
+ */
+TEST_P(SupplicantStaIfaceAidlTest, RegisterCallback) {
+ std::shared_ptr<SupplicantStaIfaceCallback> callback =
+ ndk::SharedRefBase::make<SupplicantStaIfaceCallback>();
+ ASSERT_NE(callback, nullptr);
+ EXPECT_TRUE(sta_iface_->registerCallback(callback).isOk());
+}
+
+/*
+ * GetConnectionCapabilities
+ */
+TEST_P(SupplicantStaIfaceAidlTest, GetConnectionCapabilities) {
+ ConnectionCapabilities cap;
+ EXPECT_TRUE(sta_iface_->getConnectionCapabilities(&cap).isOk());
+}
+
+/*
+ * GetWpaDriverCapabilities
+ */
+TEST_P(SupplicantStaIfaceAidlTest, GetWpaDriverCapabilities) {
+ WpaDriverCapabilitiesMask cap;
+ EXPECT_TRUE(sta_iface_->getWpaDriverCapabilities(&cap).isOk());
+}
+
+/*
+ * GetKeyMgmtCapabilities
+ */
+TEST_P(SupplicantStaIfaceAidlTest, GetKeyMgmtCapabilities) {
+ KeyMgmtMask cap;
+ EXPECT_TRUE(sta_iface_->getKeyMgmtCapabilities(&cap).isOk());
+
+ // Even though capabilities vary, these two are always set.
+ EXPECT_TRUE(!!(static_cast<uint32_t>(cap) &
+ static_cast<uint32_t>(KeyMgmtMask::NONE)));
+ EXPECT_TRUE(!!(static_cast<uint32_t>(cap) &
+ static_cast<uint32_t>(KeyMgmtMask::IEEE8021X)));
+}
+
+/*
+ * GetName
+ */
+TEST_P(SupplicantStaIfaceAidlTest, GetName) {
+ std::string name;
+ EXPECT_TRUE(sta_iface_->getName(&name).isOk());
+ EXPECT_NE(name.size(), 0);
+}
+
+/*
+ * GetType
+ */
+TEST_P(SupplicantStaIfaceAidlTest, GetType) {
+ IfaceType type;
+ EXPECT_TRUE(sta_iface_->getType(&type).isOk());
+ EXPECT_EQ(type, IfaceType::STA);
+}
+
+/*
+ * GetMacAddress
+ */
+TEST_P(SupplicantStaIfaceAidlTest, GetMacAddress) {
+ std::vector<uint8_t> macAddr;
+ EXPECT_TRUE(sta_iface_->getMacAddress(&macAddr).isOk());
+ EXPECT_EQ(macAddr.size(), 6);
+}
+
+/*
+ * ListNetworks
+ */
+TEST_P(SupplicantStaIfaceAidlTest, ListNetworks) {
+ std::vector<int32_t> networks;
+ EXPECT_TRUE(sta_iface_->listNetworks(&networks).isOk());
+}
+
+/*
+ * SetBtCoexistenceMode
+ */
+TEST_P(SupplicantStaIfaceAidlTest, SetBtCoexistenceMode) {
+ EXPECT_TRUE(
+ sta_iface_->setBtCoexistenceMode(BtCoexistenceMode::ENABLED).isOk());
+ EXPECT_TRUE(
+ sta_iface_->setBtCoexistenceMode(BtCoexistenceMode::DISABLED).isOk());
+ EXPECT_TRUE(
+ sta_iface_->setBtCoexistenceMode(BtCoexistenceMode::SENSE).isOk());
+}
+
+/*
+ * SetBtCoexistenceScanModeEnabled
+ */
+TEST_P(SupplicantStaIfaceAidlTest, SetBtCoexistenceScanModeEnabled) {
+ EXPECT_TRUE(sta_iface_->setBtCoexistenceScanModeEnabled(true).isOk());
+ EXPECT_TRUE(sta_iface_->setBtCoexistenceScanModeEnabled(false).isOk());
+}
+
+/*
+ * SetSuspendModeEnabled
+ */
+TEST_P(SupplicantStaIfaceAidlTest, SetSuspendModeEnabled) {
+ EXPECT_TRUE(sta_iface_->setSuspendModeEnabled(true).isOk());
+ EXPECT_TRUE(sta_iface_->setSuspendModeEnabled(false).isOk());
+}
+
+/*
+ * SetCountryCode
+ */
+TEST_P(SupplicantStaIfaceAidlTest, SetCountryCode) {
+ const std::vector<uint8_t> countryCode = {'M', 'X'};
+ EXPECT_TRUE(sta_iface_->setCountryCode(countryCode).isOk());
+}
+
+/*
+ * SetWpsDeviceName
+ */
+TEST_P(SupplicantStaIfaceAidlTest, SetWpsDeviceName) {
+ const std::string deviceName = "TestWpsDeviceName";
+ EXPECT_TRUE(sta_iface_->setWpsDeviceName(deviceName).isOk());
+}
+
+/*
+ * SetWpsDeviceType
+ */
+TEST_P(SupplicantStaIfaceAidlTest, SetWpsDeviceType) {
+ const std::vector<uint8_t> deviceType = {8, 0x1};
+ EXPECT_TRUE(sta_iface_->setWpsDeviceType(deviceType).isOk());
+}
+
+/*
+ * SetWpsManufacturer
+ */
+TEST_P(SupplicantStaIfaceAidlTest, SetWpsManufacturer) {
+ const std::string wpsManufacturer = "TestManufacturer";
+ EXPECT_TRUE(sta_iface_->setWpsManufacturer(wpsManufacturer).isOk());
+}
+
+/*
+ * SetWpsModelName
+ */
+TEST_P(SupplicantStaIfaceAidlTest, SetWpsModelName) {
+ const std::string modelName = "TestModelName";
+ EXPECT_TRUE(sta_iface_->setWpsModelName(modelName).isOk());
+}
+
+/*
+ * SetWpsModelNumber
+ */
+TEST_P(SupplicantStaIfaceAidlTest, SetWpsModelNumber) {
+ const std::string modelNumber = "TestModelNumber";
+ EXPECT_TRUE(sta_iface_->setWpsModelNumber(modelNumber).isOk());
+}
+
+/*
+ * SetWpsSerialNumber
+ */
+TEST_P(SupplicantStaIfaceAidlTest, SetWpsSerialNumber) {
+ const std::string serialNumber = "TestSerialNumber";
+ EXPECT_TRUE(sta_iface_->setWpsSerialNumber(serialNumber).isOk());
+}
+
+/*
+ * SetWpsConfigMethods
+ */
+TEST_P(SupplicantStaIfaceAidlTest, SetWpsConfigMethods) {
+ const WpsConfigMethods configMethods = WpsConfigMethods::KEYPAD;
+ EXPECT_TRUE(sta_iface_->setWpsConfigMethods(configMethods).isOk());
+}
+
+/*
+ * SetExternalSim
+ */
+TEST_P(SupplicantStaIfaceAidlTest, SetExternalSim) {
+ EXPECT_TRUE(sta_iface_->setExternalSim(true).isOk());
+ EXPECT_TRUE(sta_iface_->setExternalSim(false).isOk());
+}
+
+/*
+ * SetMboCellularDataStatus
+ */
+TEST_P(SupplicantStaIfaceAidlTest, SetMboCellularDataStatus) {
+ WpaDriverCapabilitiesMask cap;
+ EXPECT_TRUE(sta_iface_->getWpaDriverCapabilities(&cap).isOk());
+
+ // Operation should succeed if MBO is supported, or fail if it's not.
+ bool mboSupported =
+ !!(static_cast<uint32_t>(cap) &
+ static_cast<uint32_t>(WpaDriverCapabilitiesMask::MBO));
+ EXPECT_EQ(mboSupported, sta_iface_->setMboCellularDataStatus(true).isOk());
+}
+
+/*
+ * InitiateTdlsDiscover
+ */
+TEST_P(SupplicantStaIfaceAidlTest, InitiateTdlsDiscover) {
+ EXPECT_TRUE(sta_iface_->initiateTdlsDiscover(kTestMacAddr).isOk());
+}
+
+/*
+ * InitiateTdlsSetup
+ */
+TEST_P(SupplicantStaIfaceAidlTest, InitiateTdlsSetup) {
+ EXPECT_TRUE(sta_iface_->initiateTdlsSetup(kTestMacAddr).isOk());
+}
+
+/*
+ * InitiateTdlsTeardown
+ */
+TEST_P(SupplicantStaIfaceAidlTest, InitiateTdlsTeardown) {
+ EXPECT_TRUE(sta_iface_->initiateTdlsTeardown(kTestMacAddr).isOk());
+}
+
+/*
+ * InitiateAnqpQuery
+ */
+TEST_P(SupplicantStaIfaceAidlTest, InitiateAnqpQuery) {
+ const std::vector<AnqpInfoId> anqpIds = {
+ AnqpInfoId::VENUE_NAME, AnqpInfoId::NAI_REALM, AnqpInfoId::DOMAIN_NAME};
+ const std::vector<Hs20AnqpSubtypes> hsTypes = {
+ Hs20AnqpSubtypes::WAN_METRICS,
+ Hs20AnqpSubtypes::OPERATOR_FRIENDLY_NAME};
+
+ // Request should fail since the BSSID mentioned
+ // is not present in the scan results
+ EXPECT_FALSE(
+ sta_iface_->initiateAnqpQuery(kTestMacAddr, anqpIds, hsTypes).isOk());
+}
+
+/*
+ * InitiateHs20IconQuery
+ */
+TEST_P(SupplicantStaIfaceAidlTest, InitiateHs20IconQuery) {
+ // Request should fail since the BSSID mentioned
+ // is not present in the scan results
+ const std::string hs20IconFile = "TestFile";
+ EXPECT_FALSE(
+ sta_iface_->initiateHs20IconQuery(kTestMacAddr, hs20IconFile).isOk());
+}
+
+/*
+ * InitiateVenueUrlAnqpQuery.
+ */
+TEST_P(SupplicantStaIfaceAidlTest, InitiateVenueUrlAnqpQuery) {
+ // Request should fail since the BSSID mentioned
+ // is not present in the scan results
+ EXPECT_FALSE(sta_iface_->initiateVenueUrlAnqpQuery(kTestMacAddr).isOk());
+}
+
+/*
+ * Reassociate
+ */
+TEST_P(SupplicantStaIfaceAidlTest, Reassociate) {
+ EXPECT_TRUE(sta_iface_->reassociate().isOk());
+}
+
+/*
+ * Reconnect
+ */
+TEST_P(SupplicantStaIfaceAidlTest, Reconnect) {
+ EXPECT_FALSE(sta_iface_->reconnect().isOk());
+}
+
+/*
+ * Disconnect
+ */
+TEST_P(SupplicantStaIfaceAidlTest, Disconnect) {
+ EXPECT_TRUE(sta_iface_->disconnect().isOk());
+}
+
+/*
+ * SetPowerSave
+ */
+TEST_P(SupplicantStaIfaceAidlTest, SetPowerSave) {
+ EXPECT_TRUE(sta_iface_->setPowerSave(true).isOk());
+ EXPECT_TRUE(sta_iface_->setPowerSave(false).isOk());
+}
+
+/*
+ * StartRxFilter
+ */
+TEST_P(SupplicantStaIfaceAidlTest, StartRxFilter) {
+ EXPECT_TRUE(sta_iface_->startRxFilter().isOk());
+}
+
+/*
+ * StopRxFilter
+ */
+TEST_P(SupplicantStaIfaceAidlTest, StopRxFilter) {
+ EXPECT_TRUE(sta_iface_->stopRxFilter().isOk());
+}
+
+/*
+ * AddRxFilter
+ */
+TEST_P(SupplicantStaIfaceAidlTest, AddRxFilter) {
+ EXPECT_TRUE(sta_iface_->addRxFilter(RxFilterType::V4_MULTICAST).isOk());
+ EXPECT_TRUE(sta_iface_->addRxFilter(RxFilterType::V6_MULTICAST).isOk());
+}
+
+/*
+ * RemoveRxFilter
+ */
+TEST_P(SupplicantStaIfaceAidlTest, RemoveRxFilter) {
+ EXPECT_TRUE(sta_iface_->removeRxFilter(RxFilterType::V4_MULTICAST).isOk());
+ EXPECT_TRUE(sta_iface_->removeRxFilter(RxFilterType::V6_MULTICAST).isOk());
+}
+
+/*
+ * AddExtRadioWork
+ */
+TEST_P(SupplicantStaIfaceAidlTest, AddExtRadioWork) {
+ const std::string radioWorkName = "TestRadioWork";
+ const int32_t radioWorkFreq = 2412;
+ const int32_t radioWorkTimeout = 8;
+ int32_t radioWorkId;
+ EXPECT_TRUE(sta_iface_
+ ->addExtRadioWork(radioWorkName, radioWorkFreq,
+ radioWorkTimeout, &radioWorkId)
+ .isOk());
+ // removeExtRadio only succeeds if the added radio work hasn't started yet,
+ // so there is no guaranteed result from calling removeExtRadioWork here.
+ // Given that, we can't currently test removeExtRadioWork following
+ // a call to addExtRadioWork.
+}
+
+/*
+ * RemoveExtRadioWork
+ */
+TEST_P(SupplicantStaIfaceAidlTest, RemoveExtRadioWork) {
+ // This fails because there is no ongoing radio work with radioWorkId
+ const int32_t radioWorkId = 16;
+ EXPECT_FALSE(sta_iface_->removeExtRadioWork(radioWorkId).isOk());
+}
+
+/*
+ * Add/Remove DppPeerUri
+ */
+TEST_P(SupplicantStaIfaceAidlTest, AddRemoveDppPeerUri) {
+ if (!keyMgmtSupported(sta_iface_, KeyMgmtMask::DPP)) {
+ GTEST_SKIP() << "Missing DPP support";
+ }
+ // Add a peer URI and then remove it.
+ int32_t peerId;
+ EXPECT_TRUE(sta_iface_->addDppPeerUri(kTestUri, &peerId).isOk());
+ EXPECT_TRUE(sta_iface_->removeDppUri(peerId).isOk());
+}
+
+/*
+ * FilsHlpAddRequest
+ */
+TEST_P(SupplicantStaIfaceAidlTest, FilsHlpAddRequest) {
+ if (!isFilsSupported(sta_iface_)) {
+ GTEST_SKIP()
+ << "Skipping test since driver/supplicant doesn't support FILS";
+ }
+ const std::vector<uint8_t> destMacAddr = {0x00, 0x11, 0x22,
+ 0x33, 0x44, 0x55};
+ const std::vector<uint8_t> pktBuffer = std::vector<uint8_t>(300, 0x3a);
+ EXPECT_TRUE(sta_iface_->filsHlpAddRequest(destMacAddr, pktBuffer).isOk());
+}
+
+/*
+ * FilsHlpFlushRequest
+ */
+TEST_P(SupplicantStaIfaceAidlTest, FilsHlpFlushRequest) {
+ if (!isFilsSupported(sta_iface_)) {
+ GTEST_SKIP()
+ << "Skipping test since driver/supplicant doesn't support FILS";
+ }
+ EXPECT_TRUE(sta_iface_->filsHlpFlushRequest().isOk());
+}
+
+/*
+ * StartDppEnrolleeResponder
+ */
+TEST_P(SupplicantStaIfaceAidlTest, StartDppEnrolleeResponder) {
+ if (!keyMgmtSupported(sta_iface_, KeyMgmtMask::DPP)) {
+ GTEST_SKIP() << "Missing DPP support";
+ }
+
+ const std::string deviceInfo = "DPP_Responder_Mode_VTS_Test";
+ const std::vector<uint8_t> mac_address = {0x22, 0x33, 0x44,
+ 0x55, 0x66, 0x77};
+
+ // Generate DPP bootstrap information.
+ DppResponderBootstrapInfo bootstrapInfo;
+ EXPECT_TRUE(
+ sta_iface_
+ ->generateDppBootstrapInfoForResponder(
+ mac_address, deviceInfo, DppCurve::PRIME256V1, &bootstrapInfo)
+ .isOk());
+ EXPECT_NE(-1, bootstrapInfo.bootstrapId);
+ EXPECT_NE(0, bootstrapInfo.bootstrapId);
+ EXPECT_NE(0, bootstrapInfo.listenChannel);
+ const uint32_t bootstrap_id = bootstrapInfo.bootstrapId;
+ const uint32_t listen_channel = bootstrapInfo.listenChannel;
+
+ // Start DPP as Enrollee-Responder.
+ EXPECT_TRUE(sta_iface_->startDppEnrolleeResponder(listen_channel).isOk());
+
+ // Stop DPP Enrollee-Responder mode, ie remove the URI and stop listen.
+ EXPECT_TRUE(sta_iface_->stopDppResponder(bootstrap_id).isOk());
+}
+
+class IfaceDppCallback : public SupplicantStaIfaceCallback {
+ SupplicantStaIfaceAidlTest& parent_;
+ ::ndk::ScopedAStatus onDppSuccess(
+ ::aidl::android::hardware::wifi::supplicant::DppEventType event)
+ override {
+ parent_.code = (uint32_t)event;
+ parent_.dppCallbackType =
+ SupplicantStaIfaceAidlTest::DppCallbackType::EVENT_SUCCESS;
+ parent_.notify();
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onDppProgress(
+ aidl::android::hardware::wifi::supplicant::DppProgressCode code)
+ override {
+ parent_.code = (uint32_t)code;
+ parent_.dppCallbackType =
+ SupplicantStaIfaceAidlTest::DppCallbackType::EVENT_PROGRESS;
+ parent_.notify();
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onDppFailure(
+ aidl::android::hardware::wifi::supplicant::DppFailureCode code,
+ const std::string& ssid __attribute__((unused)),
+ const std::string& channelList __attribute__((unused)),
+ const std::vector<char16_t>& bandList
+ __attribute__((unused))) override {
+ parent_.code = (uint32_t)code;
+ parent_.dppCallbackType =
+ SupplicantStaIfaceAidlTest::DppCallbackType::EVENT_FAILURE;
+ parent_.notify();
+ return ndk::ScopedAStatus::ok();
+ }
+
+ public:
+ IfaceDppCallback(SupplicantStaIfaceAidlTest& parent) : parent_(parent){};
+};
+
+/*
+ * StartDppEnrolleeInitiator
+ */
+TEST_P(SupplicantStaIfaceAidlTest, StartDppEnrolleeInitiator) {
+ if (!keyMgmtSupported(sta_iface_, KeyMgmtMask::DPP)) {
+ GTEST_SKIP() << "Missing DPP support";
+ }
+
+ // Register callback
+ std::shared_ptr<IfaceDppCallback> callback =
+ ndk::SharedRefBase::make<IfaceDppCallback>(*this);
+ EXPECT_NE(callback, nullptr);
+ EXPECT_TRUE(sta_iface_->registerCallback(callback).isOk());
+
+ // Add a peer URI
+ int32_t peer_id = 0;
+ EXPECT_TRUE(sta_iface_->addDppPeerUri(kTestUri, &peer_id).isOk());
+ EXPECT_NE(0, peer_id);
+ EXPECT_NE(-1, peer_id);
+
+ // Start DPP as Enrollee-Initiator. Since this operation requires two
+ // devices, we start the operation and expect a timeout.
+ EXPECT_TRUE(sta_iface_->startDppEnrolleeInitiator(peer_id, 0).isOk());
+
+ // Wait for the timeout callback
+ EXPECT_EQ(std::cv_status::no_timeout,
+ wait(SupplicantStaIfaceAidlTest::DppCallbackType::EVENT_FAILURE));
+ EXPECT_EQ(SupplicantStaIfaceAidlTest::DppCallbackType::EVENT_FAILURE,
+ dppCallbackType);
+
+ // ...and then remove the peer URI.
+ EXPECT_TRUE(sta_iface_->removeDppUri(peer_id).isOk());
+}
+
+/*
+ * StartDppConfiguratorInitiator
+ */
+TEST_P(SupplicantStaIfaceAidlTest, StartDppConfiguratorInitiator) {
+ if (!keyMgmtSupported(sta_iface_, KeyMgmtMask::DPP)) {
+ GTEST_SKIP() << "Missing DPP support";
+ }
+
+ // Register callback
+ std::shared_ptr<IfaceDppCallback> callback =
+ ndk::SharedRefBase::make<IfaceDppCallback>(*this);
+ EXPECT_NE(callback, nullptr);
+ EXPECT_TRUE(sta_iface_->registerCallback(callback).isOk());
+
+ // Add a peer URI
+ int32_t peer_id = 0;
+ EXPECT_TRUE(sta_iface_->addDppPeerUri(kTestUri, &peer_id).isOk());
+ EXPECT_NE(0, peer_id);
+ EXPECT_NE(-1, peer_id);
+
+ const std::string ssid =
+ "6D795F746573745F73736964"; // 'my_test_ssid' encoded in hex
+ const std::string password =
+ "746F70736563726574"; // 'topsecret' encoded in hex
+
+ // Start DPP as Configurator-Initiator. Since this operation requires two
+ // devices, we start the operation and expect a timeout.
+ EXPECT_TRUE(sta_iface_
+ ->startDppConfiguratorInitiator(peer_id, 0, ssid, password,
+ "", DppNetRole::STA,
+ DppAkm::PSK)
+ .isOk());
+
+ // Wait for the timeout callback
+ ASSERT_EQ(std::cv_status::no_timeout,
+ wait(SupplicantStaIfaceAidlTest::DppCallbackType::EVENT_FAILURE));
+ ASSERT_EQ(SupplicantStaIfaceAidlTest::DppCallbackType::EVENT_FAILURE,
+ dppCallbackType);
+
+ // ...and then remove the peer URI.
+ EXPECT_TRUE(sta_iface_->removeDppUri(peer_id).isOk());
+}
+
+INSTANTIATE_TEST_SUITE_P(Supplicant, SupplicantStaIfaceAidlTest,
+ testing::ValuesIn(android::getAidlHalInstanceNames(
+ ISupplicant::descriptor)),
+ android::PrintInstanceNameToString);
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ ProcessState::self()->setThreadPoolMaxThreadCount(1);
+ ProcessState::self()->startThreadPool();
+ return RUN_ALL_TESTS();
+}
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp
new file mode 100644
index 0000000..66c8807
--- /dev/null
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp
@@ -0,0 +1,791 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <VtsCoreUtil.h>
+#include <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/wifi/supplicant/BnSupplicant.h>
+#include <aidl/android/hardware/wifi/supplicant/BnSupplicantStaNetworkCallback.h>
+#include <android/binder_manager.h>
+#include <android/binder_status.h>
+#include <binder/IServiceManager.h>
+#include <binder/ProcessState.h>
+#include <cutils/properties.h>
+
+#include "supplicant_test_utils.h"
+
+using aidl::android::hardware::wifi::supplicant::AuthAlgMask;
+using aidl::android::hardware::wifi::supplicant::BnSupplicantStaNetworkCallback;
+using aidl::android::hardware::wifi::supplicant::DebugLevel;
+using aidl::android::hardware::wifi::supplicant::EapMethod;
+using aidl::android::hardware::wifi::supplicant::EapPhase2Method;
+using aidl::android::hardware::wifi::supplicant::GroupCipherMask;
+using aidl::android::hardware::wifi::supplicant::GroupMgmtCipherMask;
+using aidl::android::hardware::wifi::supplicant::IfaceType;
+using aidl::android::hardware::wifi::supplicant::ISupplicant;
+using aidl::android::hardware::wifi::supplicant::ISupplicantStaIface;
+using aidl::android::hardware::wifi::supplicant::ISupplicantStaNetwork;
+using aidl::android::hardware::wifi::supplicant::KeyMgmtMask;
+using aidl::android::hardware::wifi::supplicant::
+ NetworkRequestEapSimGsmAuthParams;
+using aidl::android::hardware::wifi::supplicant::
+ NetworkRequestEapSimUmtsAuthParams;
+using aidl::android::hardware::wifi::supplicant::
+ NetworkResponseEapSimGsmAuthParams;
+using aidl::android::hardware::wifi::supplicant::
+ NetworkResponseEapSimUmtsAuthParams;
+using aidl::android::hardware::wifi::supplicant::OcspType;
+using aidl::android::hardware::wifi::supplicant::PairwiseCipherMask;
+using aidl::android::hardware::wifi::supplicant::ProtoMask;
+using aidl::android::hardware::wifi::supplicant::SaeH2eMode;
+using aidl::android::hardware::wifi::supplicant::TransitionDisableIndication;
+using aidl::android::hardware::wifi::supplicant::WpaDriverCapabilitiesMask;
+using android::ProcessState;
+
+namespace {
+const std::vector<uint8_t> kTestIdentity = {0x45, 0x67, 0x98, 0x67, 0x56};
+const std::vector<uint8_t> kTestEncryptedIdentity = {0x35, 0x37, 0x58, 0x57,
+ 0x26};
+const std::string kTestSsidStr = "TestSsid1234";
+const std::vector<uint8_t> kTestSsid =
+ std::vector<uint8_t>(kTestSsidStr.begin(), kTestSsidStr.end());
+const std::vector<uint8_t> kTestBssid = {0x56, 0x67, 0x67, 0xf4, 0x56, 0x92};
+const std::string kTestPskPassphrase =
+ "\"123456780abcdef0123456780abcdef0deadbeef\"";
+const std::string kTestEapCert = "keystore://CERT";
+const std::string kTestEapMatch = "match";
+const KeyMgmtMask kTestKeyMgmt =
+ static_cast<KeyMgmtMask>(static_cast<uint32_t>(KeyMgmtMask::WPA_PSK) |
+ static_cast<uint32_t>(KeyMgmtMask::WPA_EAP));
+
+} // namespace
+
+class SupplicantStaNetworkCallback : public BnSupplicantStaNetworkCallback {
+ public:
+ SupplicantStaNetworkCallback() = default;
+
+ ::ndk::ScopedAStatus onNetworkEapIdentityRequest() override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onNetworkEapSimGsmAuthRequest(
+ const NetworkRequestEapSimGsmAuthParams& /* params */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onNetworkEapSimUmtsAuthRequest(
+ const NetworkRequestEapSimUmtsAuthParams& /* params */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onTransitionDisable(
+ TransitionDisableIndication /* ind */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+};
+
+class SupplicantStaNetworkAidlTest
+ : public testing::TestWithParam<std::string> {
+ public:
+ void SetUp() override {
+ initializeService();
+ supplicant_ = ISupplicant::fromBinder(ndk::SpAIBinder(
+ AServiceManager_waitForService(GetParam().c_str())));
+ ASSERT_NE(supplicant_, nullptr);
+ ASSERT_TRUE(supplicant_
+ ->setDebugParams(DebugLevel::EXCESSIVE,
+ true, // show timestamps
+ true)
+ .isOk());
+ EXPECT_TRUE(supplicant_->addStaInterface(getStaIfaceName(), &sta_iface_)
+ .isOk());
+ ASSERT_NE(sta_iface_, nullptr);
+ EXPECT_TRUE(sta_iface_->addNetwork(&sta_network_).isOk());
+ ASSERT_NE(sta_network_, nullptr);
+ }
+
+ void TearDown() override {
+ stopSupplicant();
+ startWifiFramework();
+ }
+
+ protected:
+ std::shared_ptr<ISupplicant> supplicant_;
+ std::shared_ptr<ISupplicantStaIface> sta_iface_;
+ std::shared_ptr<ISupplicantStaNetwork> sta_network_;
+
+ void removeNetwork() {
+ ASSERT_NE(sta_iface_, nullptr);
+ int32_t net_id;
+ EXPECT_TRUE(sta_network_->getId(&net_id).isOk());
+ EXPECT_TRUE(sta_iface_->removeNetwork(net_id).isOk());
+ }
+};
+
+/*
+ * RegisterCallback
+ */
+TEST_P(SupplicantStaNetworkAidlTest, RegisterCallback) {
+ std::shared_ptr<SupplicantStaNetworkCallback> callback =
+ ndk::SharedRefBase::make<SupplicantStaNetworkCallback>();
+ ASSERT_NE(callback, nullptr);
+ EXPECT_TRUE(sta_network_->registerCallback(callback).isOk());
+}
+
+/*
+ * GetInterfaceName
+ */
+TEST_P(SupplicantStaNetworkAidlTest, GetInterfaceName) {
+ std::string name;
+ EXPECT_TRUE(sta_network_->getInterfaceName(&name).isOk());
+ EXPECT_NE(name.size(), 0);
+}
+
+/*
+ * GetType
+ */
+TEST_P(SupplicantStaNetworkAidlTest, GetType) {
+ IfaceType type;
+ EXPECT_TRUE(sta_network_->getType(&type).isOk());
+ EXPECT_EQ(type, IfaceType::STA);
+}
+
+/*
+ * Set/Get ScanSsid
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetScanSsid) {
+ bool scanSsid = false;
+ EXPECT_TRUE(sta_network_->setScanSsid(true).isOk());
+ EXPECT_TRUE(sta_network_->getScanSsid(&scanSsid).isOk());
+ EXPECT_TRUE(scanSsid);
+}
+
+/*
+ * Set/Get RequirePmf
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetRequirePmf) {
+ bool requirePmf = false;
+ EXPECT_TRUE(sta_network_->setRequirePmf(true).isOk());
+ EXPECT_TRUE(sta_network_->getRequirePmf(&requirePmf).isOk());
+ EXPECT_TRUE(requirePmf);
+}
+
+/*
+ * Set/Get IdStr
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetIdStr) {
+ const std::string savedIdStr = "TestIdstr";
+ EXPECT_TRUE(sta_network_->setIdStr(savedIdStr).isOk());
+
+ std::string retrievedIdStr;
+ EXPECT_TRUE(sta_network_->getIdStr(&retrievedIdStr).isOk());
+ EXPECT_EQ(retrievedIdStr, savedIdStr);
+}
+
+/*
+ * Set/Get EapMethod
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetEapMethod) {
+ const EapMethod savedMethod = EapMethod::PEAP;
+ EXPECT_TRUE(sta_network_->setEapMethod(savedMethod).isOk());
+
+ EapMethod retrievedMethod;
+ EXPECT_TRUE(sta_network_->getEapMethod(&retrievedMethod).isOk());
+ EXPECT_EQ(retrievedMethod, savedMethod);
+}
+
+/*
+ * Set/Get EapPhase2Method
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetEapPhase2Method) {
+ const EapMethod savedEapMethod = EapMethod::PEAP;
+ EXPECT_TRUE(sta_network_->setEapMethod(savedEapMethod).isOk());
+
+ const EapPhase2Method savedPhase2Method = EapPhase2Method::NONE;
+ EXPECT_TRUE(sta_network_->setEapPhase2Method(savedPhase2Method).isOk());
+
+ EapPhase2Method retrievedMethod;
+ EXPECT_TRUE(sta_network_->getEapPhase2Method(&retrievedMethod).isOk());
+ EXPECT_EQ(retrievedMethod, savedPhase2Method);
+}
+
+/*
+ * Set/Get EapIdentity
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetEapIdentity) {
+ EXPECT_TRUE(sta_network_->setEapIdentity(kTestIdentity).isOk());
+
+ std::vector<uint8_t> retrievedIdentity;
+ EXPECT_TRUE(sta_network_->getEapIdentity(&retrievedIdentity).isOk());
+ EXPECT_EQ(retrievedIdentity, kTestIdentity);
+}
+
+/*
+ * Set/Get EapAnonymousIdentity
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetEapAnonymousIdentity) {
+ EXPECT_TRUE(sta_network_->setEapAnonymousIdentity(kTestIdentity).isOk());
+
+ std::vector<uint8_t> retrievedIdentity;
+ EXPECT_TRUE(
+ sta_network_->getEapAnonymousIdentity(&retrievedIdentity).isOk());
+ EXPECT_EQ(retrievedIdentity, kTestIdentity);
+}
+
+/*
+ * Set/Get EapPassword
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetEapPassword) {
+ const std::string eapPasswdStr = "TestEapPasswd1234";
+ const std::vector<uint8_t> savedEapPasswd =
+ std::vector<uint8_t>(eapPasswdStr.begin(), eapPasswdStr.end());
+ ASSERT_TRUE(sta_network_->setEapPassword(savedEapPasswd).isOk());
+
+ std::vector<uint8_t> retrievedEapPasswd;
+ ASSERT_TRUE(sta_network_->getEapPassword(&retrievedEapPasswd).isOk());
+ ASSERT_EQ(retrievedEapPasswd, savedEapPasswd);
+}
+
+/*
+ * Set/Get EapCACert
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetEapCACert) {
+ EXPECT_TRUE(sta_network_->setEapCACert(kTestEapCert).isOk());
+
+ std::string retrievedCert;
+ EXPECT_TRUE(sta_network_->getEapCACert(&retrievedCert).isOk());
+ EXPECT_EQ(retrievedCert, kTestEapCert);
+}
+
+/*
+ * Set/Get EapCAPath
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetEapCAPath) {
+ EXPECT_TRUE(sta_network_->setEapCAPath(kTestEapCert).isOk());
+
+ std::string retrievedCert;
+ EXPECT_TRUE(sta_network_->getEapCAPath(&retrievedCert).isOk());
+ EXPECT_EQ(retrievedCert, kTestEapCert);
+}
+
+/*
+ * Set/Get EapClientCert
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetEapClientCert) {
+ EXPECT_TRUE(sta_network_->setEapClientCert(kTestEapCert).isOk());
+
+ std::string retrievedCert;
+ EXPECT_TRUE(sta_network_->getEapClientCert(&retrievedCert).isOk());
+ EXPECT_EQ(retrievedCert, kTestEapCert);
+}
+
+/*
+ * Set/Get EapPrivateKeyId
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetEapPrivateKeyId) {
+ std::string savedKeyId = "key_id";
+ EXPECT_TRUE(sta_network_->setEapPrivateKeyId(savedKeyId).isOk());
+
+ std::string retrievedKeyId;
+ EXPECT_TRUE(sta_network_->getEapPrivateKeyId(&retrievedKeyId).isOk());
+ EXPECT_EQ(retrievedKeyId, savedKeyId);
+}
+
+/*
+ * Set/Get EapAltSubjectMatch
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetEapAltSubjectMatch) {
+ EXPECT_TRUE(sta_network_->setEapAltSubjectMatch(kTestEapMatch).isOk());
+
+ std::string retrievedMatch;
+ EXPECT_TRUE(sta_network_->getEapAltSubjectMatch(&retrievedMatch).isOk());
+ EXPECT_EQ(retrievedMatch, kTestEapMatch);
+}
+
+/*
+ * Set/Get EapSubjectMatch
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetEapSubjectMatch) {
+ EXPECT_TRUE(sta_network_->setEapSubjectMatch(kTestEapMatch).isOk());
+
+ std::string retrievedMatch;
+ EXPECT_TRUE(sta_network_->getEapSubjectMatch(&retrievedMatch).isOk());
+ EXPECT_EQ(retrievedMatch, kTestEapMatch);
+}
+
+/*
+ * Set/Get EapDomainSuffixMatch
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetEapDomainSuffixMatch) {
+ EXPECT_TRUE(sta_network_->setEapDomainSuffixMatch(kTestEapMatch).isOk());
+
+ std::string retrievedMatch;
+ EXPECT_TRUE(sta_network_->getEapDomainSuffixMatch(&retrievedMatch).isOk());
+ EXPECT_EQ(retrievedMatch, kTestEapMatch);
+}
+
+/*
+ * Set/Get EapEngine
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetEapEngine) {
+ bool retrievedEapEngine = false;
+ EXPECT_TRUE(sta_network_->setEapEngine(true).isOk());
+ EXPECT_TRUE(sta_network_->getEapEngine(&retrievedEapEngine).isOk());
+ EXPECT_TRUE(retrievedEapEngine);
+}
+
+/*
+ * Set/Get EapEngineID
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetEapEngineId) {
+ const std::string savedEngineId = "engine_id";
+ EXPECT_TRUE(sta_network_->setEapEngineID(savedEngineId).isOk());
+
+ std::string retrievedId;
+ EXPECT_TRUE(sta_network_->getEapEngineId(&retrievedId).isOk());
+ EXPECT_EQ(retrievedId, savedEngineId);
+}
+
+/*
+ * Set/Get Ocsp
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetOcsp) {
+ const OcspType savedOcspType = OcspType::REQUEST_CERT_STATUS;
+ EXPECT_TRUE(sta_network_->setOcsp(savedOcspType).isOk());
+
+ const OcspType invalidOcspType = static_cast<OcspType>(-1);
+ EXPECT_FALSE(sta_network_->setOcsp(invalidOcspType).isOk());
+
+ OcspType retrievedOcspType;
+ EXPECT_TRUE(sta_network_->getOcsp(&retrievedOcspType).isOk());
+ EXPECT_EQ(retrievedOcspType, savedOcspType);
+}
+
+/*
+ * Set/Get KeyMgmt
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetKeyMgmt) {
+ KeyMgmtMask savedKeyMgmt = KeyMgmtMask::WAPI_PSK;
+ EXPECT_TRUE(sta_network_->setKeyMgmt(savedKeyMgmt).isOk());
+
+ KeyMgmtMask retrievedKeyMgmt;
+ EXPECT_TRUE(sta_network_->getKeyMgmt(&retrievedKeyMgmt).isOk());
+ EXPECT_EQ(retrievedKeyMgmt, savedKeyMgmt);
+
+ savedKeyMgmt = KeyMgmtMask::WAPI_CERT;
+ EXPECT_TRUE(sta_network_->setKeyMgmt(savedKeyMgmt).isOk());
+
+ EXPECT_TRUE(sta_network_->getKeyMgmt(&retrievedKeyMgmt).isOk());
+ EXPECT_EQ(retrievedKeyMgmt, savedKeyMgmt);
+}
+
+/*
+ * Set/Get Proto
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetProto) {
+ const ProtoMask savedProto = ProtoMask::WAPI;
+ EXPECT_TRUE(sta_network_->setProto(savedProto).isOk());
+
+ ProtoMask retrievedProto;
+ EXPECT_TRUE(sta_network_->getProto(&retrievedProto).isOk());
+ EXPECT_EQ(retrievedProto, savedProto);
+}
+
+/*
+ * Set/Get GroupCipher
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetGroupCipher) {
+ const GroupCipherMask savedCipher = GroupCipherMask::SMS4;
+ EXPECT_TRUE(sta_network_->setGroupCipher(savedCipher).isOk());
+
+ GroupCipherMask retrievedCipher;
+ EXPECT_TRUE(sta_network_->getGroupCipher(&retrievedCipher).isOk());
+ EXPECT_EQ(retrievedCipher, savedCipher);
+}
+
+/*
+ * Set/Get PairwiseCipher
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetPairwiseCipher) {
+ const PairwiseCipherMask savedCipher = PairwiseCipherMask::SMS4;
+ EXPECT_TRUE(sta_network_->setPairwiseCipher(savedCipher).isOk());
+
+ PairwiseCipherMask retrievedCipher;
+ EXPECT_TRUE(sta_network_->getPairwiseCipher(&retrievedCipher).isOk());
+ EXPECT_EQ(retrievedCipher, savedCipher);
+}
+
+/*
+ * Set/Get WapiCertSuite
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetWapiCertSuite) {
+ if (!keyMgmtSupported(sta_iface_, KeyMgmtMask::WAPI_PSK)) {
+ GTEST_SKIP() << "Skipping test since WAPI is not supported.";
+ }
+
+ const std::string savedCertSuite = "suite";
+ EXPECT_TRUE(sta_network_->setWapiCertSuite(savedCertSuite).isOk());
+
+ std::string retrievedCertSuite;
+ EXPECT_TRUE(sta_network_->getWapiCertSuite(&retrievedCertSuite).isOk());
+ EXPECT_EQ(retrievedCertSuite, savedCertSuite);
+}
+
+/*
+ * Set/Get WapiPsk
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetWapiPsk) {
+ if (!keyMgmtSupported(sta_iface_, KeyMgmtMask::WAPI_PSK)) {
+ GTEST_SKIP() << "Skipping test since WAPI is not supported.";
+ }
+
+ EXPECT_TRUE(sta_network_->setKeyMgmt(KeyMgmtMask::WAPI_PSK).isOk());
+ EXPECT_TRUE(sta_network_->setPskPassphrase(kTestPskPassphrase).isOk());
+
+ std::string retrievedPassphrase;
+ EXPECT_TRUE(sta_network_->getPskPassphrase(&retrievedPassphrase).isOk());
+ EXPECT_EQ(retrievedPassphrase, kTestPskPassphrase);
+
+ const std::string pskHex = "12345678";
+ EXPECT_TRUE(sta_network_->setPskPassphrase(pskHex).isOk());
+
+ EXPECT_TRUE(sta_network_->getPskPassphrase(&retrievedPassphrase).isOk());
+ EXPECT_EQ(retrievedPassphrase, pskHex);
+}
+
+/*
+ * Set/Get SaePassword
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetSaePassword) {
+ const std::string savedPassword = "topsecret";
+ EXPECT_TRUE(sta_network_->setSaePassword(savedPassword).isOk());
+
+ std::string retrievedPassword;
+ EXPECT_TRUE(sta_network_->getSaePassword(&retrievedPassword).isOk());
+ EXPECT_EQ(retrievedPassword, savedPassword);
+}
+
+/*
+ * Set/Get SaePasswordId
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetSaePasswordId) {
+ const std::string savedPasswdId = "id1";
+ EXPECT_TRUE(sta_network_->setSaePasswordId(savedPasswdId).isOk());
+
+ std::string retrievedPasswdId;
+ EXPECT_TRUE(sta_network_->getSaePasswordId(&retrievedPasswdId).isOk());
+ EXPECT_EQ(retrievedPasswdId, savedPasswdId);
+}
+
+/*
+ * Set/Get GroupMgmtCipher
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetGroupMgmtCipher) {
+ const GroupMgmtCipherMask savedCipher = GroupMgmtCipherMask::BIP_GMAC_256;
+ EXPECT_TRUE(sta_network_->setGroupMgmtCipher(savedCipher).isOk());
+
+ GroupMgmtCipherMask retrievedCipher;
+ EXPECT_TRUE(sta_network_->getGroupMgmtCipher(&retrievedCipher).isOk());
+ EXPECT_EQ(retrievedCipher, savedCipher);
+}
+
+/*
+ * Set/Get Ssid
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetSsid) {
+ EXPECT_TRUE(sta_network_->setSsid(kTestSsid).isOk());
+
+ std::vector<uint8_t> retrievedSsid;
+ EXPECT_TRUE(sta_network_->getSsid(&retrievedSsid).isOk());
+ EXPECT_EQ(retrievedSsid, kTestSsid);
+}
+
+/*
+ * Set/Get Bssid
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetBssid) {
+ EXPECT_TRUE(sta_network_->setBssid(kTestBssid).isOk());
+
+ std::vector<uint8_t> retrievedBssid;
+ EXPECT_TRUE(sta_network_->getBssid(&retrievedBssid).isOk());
+ EXPECT_EQ(retrievedBssid, kTestBssid);
+}
+
+/*
+ * Set/Get KeyAuthAlg
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetAuthAlg) {
+ const AuthAlgMask savedAlg =
+ static_cast<AuthAlgMask>(static_cast<uint32_t>(AuthAlgMask::OPEN) |
+ static_cast<uint32_t>(AuthAlgMask::SHARED));
+ EXPECT_TRUE(sta_network_->setAuthAlg(savedAlg).isOk());
+
+ AuthAlgMask retrievedAlg;
+ EXPECT_TRUE(sta_network_->getAuthAlg(&retrievedAlg).isOk());
+ EXPECT_EQ(retrievedAlg, savedAlg);
+}
+
+/*
+ * Set/Get WepTxKeyIdx
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetWepTxKeyIdx) {
+ const int32_t savedKeyIdx = 2;
+ EXPECT_TRUE(sta_network_->setWepTxKeyIdx(savedKeyIdx).isOk());
+
+ int32_t retrievedKeyIdx;
+ EXPECT_TRUE(sta_network_->getWepTxKeyIdx(&retrievedKeyIdx).isOk());
+ EXPECT_EQ(retrievedKeyIdx, savedKeyIdx);
+}
+
+/*
+ * Set SAE H2E (Hash-to-Element) mode
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetSaeH2eMode) {
+ EXPECT_TRUE(sta_network_->setSaeH2eMode(SaeH2eMode::DISABLED).isOk());
+ EXPECT_TRUE(sta_network_->setSaeH2eMode(SaeH2eMode::H2E_MANDATORY).isOk());
+ EXPECT_TRUE(sta_network_->setSaeH2eMode(SaeH2eMode::H2E_OPTIONAL).isOk());
+}
+
+/*
+ * Set/Get Psk
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetPsk) {
+ const std::vector<uint8_t> savedPsk = std::vector<uint8_t>(32, 0x12);
+ EXPECT_TRUE(sta_network_->setPsk(savedPsk).isOk());
+
+ std::vector<uint8_t> retrievedPsk;
+ EXPECT_TRUE(sta_network_->getPsk(&retrievedPsk).isOk());
+ EXPECT_EQ(retrievedPsk, savedPsk);
+}
+
+/*
+ * Set/Get WepKeys
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetGetWepKeys) {
+ const uint32_t maxKeys = 4;
+ const std::vector<uint8_t> testWepKey = {0x56, 0x67, 0x67, 0xf4, 0x56};
+
+ for (uint32_t i = 0; i < maxKeys; i++) {
+ std::vector<uint8_t> retrievedKey;
+ EXPECT_TRUE(sta_network_->setWepKey(i, testWepKey).isOk());
+ EXPECT_TRUE(sta_network_->getWepKey(i, &retrievedKey).isOk());
+ EXPECT_EQ(retrievedKey, testWepKey);
+ }
+}
+
+/*
+ * SetPmkCacheEntry
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetPmkCache) {
+ const std::vector<uint8_t> serializedEntry(128, 0);
+ EXPECT_TRUE(sta_network_->setPmkCache(serializedEntry).isOk());
+}
+
+/*
+ * SetEapErp
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetEapErp) {
+ if (!isFilsSupported(sta_iface_)) {
+ GTEST_SKIP()
+ << "Skipping test since driver/supplicant doesn't support FILS";
+ }
+ EXPECT_TRUE(sta_network_->setEapErp(true).isOk());
+}
+
+/*
+ * SetUpdateIdentifier
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetUpdateIdentifier) {
+ const uint32_t updateIdentifier = 21;
+ EXPECT_TRUE(sta_network_->setUpdateIdentifier(updateIdentifier).isOk());
+}
+
+/*
+ * SetProactiveKeyCaching
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetProactiveKeyCaching) {
+ EXPECT_TRUE(sta_network_->setProactiveKeyCaching(true).isOk());
+ EXPECT_TRUE(sta_network_->setProactiveKeyCaching(false).isOk());
+}
+
+/*
+ * EnableSuiteBEapOpenSslCiphers
+ */
+TEST_P(SupplicantStaNetworkAidlTest, EnableSuiteBEapOpenSslCiphers) {
+ EXPECT_TRUE(sta_network_->enableSuiteBEapOpenSslCiphers().isOk());
+}
+
+/*
+ * EnableTlsSuiteBEapPhase1Param
+ */
+TEST_P(SupplicantStaNetworkAidlTest, EnableTlsSuiteBEapPhase1Param) {
+ EXPECT_TRUE(sta_network_->enableTlsSuiteBEapPhase1Param(true).isOk());
+ EXPECT_TRUE(sta_network_->enableTlsSuiteBEapPhase1Param(false).isOk());
+}
+
+/*
+ * SetEapEncryptedImsiIdentity
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetEapEncryptedImsiIdentity) {
+ EXPECT_TRUE(
+ sta_network_->setEapEncryptedImsiIdentity(kTestEncryptedIdentity)
+ .isOk());
+}
+
+/*
+ * SendNetworkEapIdentityResponse
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SendNetworkEapIdentityResponse) {
+ EXPECT_TRUE(sta_network_
+ ->sendNetworkEapIdentityResponse(kTestIdentity,
+ kTestEncryptedIdentity)
+ .isOk());
+}
+
+/*
+ * Enable SAE PK only mode
+ */
+TEST_P(SupplicantStaNetworkAidlTest, EnableSaePkOnlyMode) {
+ // Check for SAE PK support
+ WpaDriverCapabilitiesMask caps;
+ EXPECT_TRUE(sta_iface_->getWpaDriverCapabilities(&caps).isOk());
+ const bool saePkSupported =
+ !!(static_cast<uint32_t>(caps) &
+ static_cast<uint32_t>(WpaDriverCapabilitiesMask::SAE_PK));
+ LOG(INFO) << "SAE-PK Supported: " << saePkSupported;
+
+ // Operation will succeed if SAE PK is supported, or fail otherwise.
+ EXPECT_EQ(sta_network_->enableSaePkOnlyMode(true).isOk(), saePkSupported);
+ EXPECT_EQ(sta_network_->enableSaePkOnlyMode(false).isOk(), saePkSupported);
+}
+
+/*
+ * Enable
+ */
+TEST_P(SupplicantStaNetworkAidlTest, Enable) {
+ // wpa_supplicant won't perform any connection initiation
+ // unless at least the SSID and key mgmt params are set.
+ EXPECT_TRUE(sta_network_->setSsid(kTestSsid).isOk());
+ EXPECT_TRUE(sta_network_->setKeyMgmt(kTestKeyMgmt).isOk());
+
+ EXPECT_TRUE(sta_network_->enable(false).isOk());
+ EXPECT_TRUE(sta_network_->enable(true).isOk());
+
+ // Now remove the network and ensure that the call fails.
+ removeNetwork();
+ ASSERT_FALSE(sta_network_->enable(true).isOk());
+}
+
+/*
+ * Disable
+ */
+TEST_P(SupplicantStaNetworkAidlTest, Disable) {
+ // wpa_supplicant won't perform any connection initiation
+ // unless at least the SSID and key mgmt params are set.
+ EXPECT_TRUE(sta_network_->setSsid(kTestSsid).isOk());
+ EXPECT_TRUE(sta_network_->setKeyMgmt(kTestKeyMgmt).isOk());
+
+ EXPECT_TRUE(sta_network_->disable().isOk());
+
+ // Now remove the network and ensure that the call fails.
+ removeNetwork();
+ EXPECT_FALSE(sta_network_->disable().isOk());
+}
+
+/*
+ * Select
+ */
+TEST_P(SupplicantStaNetworkAidlTest, Select) {
+ // wpa_supplicant won't perform any connection initiation
+ // unless at least the SSID and key mgmt params are set.
+ EXPECT_TRUE(sta_network_->setSsid(kTestSsid).isOk());
+ EXPECT_TRUE(sta_network_->setKeyMgmt(kTestKeyMgmt).isOk());
+
+ EXPECT_TRUE(sta_network_->select().isOk());
+
+ // Now remove the network and ensure that the call fails.
+ removeNetwork();
+ EXPECT_FALSE(sta_network_->select().isOk());
+}
+
+/*
+ * SendNetworkEapSimGsmAuthResponse
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SendNetworkEapSimGsmAuthResponse) {
+ NetworkResponseEapSimGsmAuthParams param;
+ param.kc =
+ std::vector<uint8_t>({0x56, 0x67, 0x67, 0xf4, 0x76, 0x87, 0x98, 0x12});
+ param.sres = std::vector<uint8_t>({0x56, 0x67, 0x67, 0xf4});
+ const std::vector<NetworkResponseEapSimGsmAuthParams> params = {param};
+ EXPECT_TRUE(sta_network_->sendNetworkEapSimGsmAuthResponse(params).isOk());
+}
+
+/*
+ * SendNetworkEapSimGsmAuthFailure
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SendNetworkEapSimGsmAuthFailure) {
+ EXPECT_TRUE(sta_network_->sendNetworkEapSimGsmAuthFailure().isOk());
+}
+
+/*
+ * SendNetworkEapSimUmtsAuthResponse
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SendNetworkEapSimUmtsAuthResponse) {
+ NetworkResponseEapSimUmtsAuthParams params;
+ params.res = std::vector<uint8_t>({0x56, 0x67, 0x67, 0xf4, 0x67});
+ params.ik = std::vector<uint8_t>(16, 0x65);
+ params.ck = std::vector<uint8_t>(16, 0x45);
+ EXPECT_TRUE(sta_network_->sendNetworkEapSimUmtsAuthResponse(params).isOk());
+}
+
+/*
+ * SendNetworkEapSimUmtsAuthFailure
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SendNetworkEapSimUmtsAuthFailure) {
+ EXPECT_TRUE(sta_network_->sendNetworkEapSimUmtsAuthFailure().isOk());
+}
+
+/*
+ * SendNetworkEapSimUmtsAutsResponse
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SendNetworkEapSimUmtsAutsResponse) {
+ const std::vector<uint8_t> testAutParam = std::vector<uint8_t>(14, 0xe1);
+ EXPECT_TRUE(
+ sta_network_->sendNetworkEapSimUmtsAutsResponse(testAutParam).isOk());
+}
+
+/*
+ * GetWpsNfcConfigurationToken
+ */
+TEST_P(SupplicantStaNetworkAidlTest, GetWpsNfcConfigurationToken) {
+ EXPECT_TRUE(sta_network_->setSsid(kTestSsid).isOk());
+ EXPECT_TRUE(sta_network_->setKeyMgmt(kTestKeyMgmt).isOk());
+ EXPECT_TRUE(sta_network_->setPskPassphrase(kTestPskPassphrase).isOk());
+
+ std::vector<uint8_t> retrievedToken;
+ EXPECT_TRUE(
+ sta_network_->getWpsNfcConfigurationToken(&retrievedToken).isOk());
+ EXPECT_NE(retrievedToken.size(), 0);
+}
+
+INSTANTIATE_TEST_SUITE_P(Supplicant, SupplicantStaNetworkAidlTest,
+ testing::ValuesIn(android::getAidlHalInstanceNames(
+ ISupplicant::descriptor)),
+ android::PrintInstanceNameToString);
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ ProcessState::self()->setThreadPoolMaxThreadCount(1);
+ ProcessState::self()->startThreadPool();
+ return RUN_ALL_TESTS();
+}
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_test_utils.h b/wifi/supplicant/aidl/vts/functional/supplicant_test_utils.h
new file mode 100644
index 0000000..b7e1a80
--- /dev/null
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_test_utils.h
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#ifndef SUPPLICANT_TEST_UTILS_H
+#define SUPPLICANT_TEST_UTILS_H
+
+#include <VtsCoreUtil.h>
+#include <android-base/logging.h>
+#include <wifi_system/supplicant_manager.h>
+
+using aidl::android::hardware::wifi::supplicant::ISupplicantStaIface;
+using aidl::android::hardware::wifi::supplicant::KeyMgmtMask;
+using android::wifi_system::SupplicantManager;
+
+std::string getStaIfaceName() {
+ std::array<char, PROPERTY_VALUE_MAX> buffer;
+ property_get("wifi.interface", buffer.data(), "wlan0");
+ return std::string(buffer.data());
+}
+
+std::string getP2pIfaceName() {
+ std::array<char, PROPERTY_VALUE_MAX> buffer;
+ property_get("wifi.direct.interface", buffer.data(), "p2p0");
+ return std::string(buffer.data());
+}
+
+bool keyMgmtSupported(std::shared_ptr<ISupplicantStaIface> iface,
+ KeyMgmtMask expected) {
+ KeyMgmtMask caps;
+ if (!iface->getKeyMgmtCapabilities(&caps).isOk()) {
+ return false;
+ }
+ return !!(static_cast<uint32_t>(caps) & static_cast<uint32_t>(expected));
+}
+
+bool isFilsSupported(std::shared_ptr<ISupplicantStaIface> iface) {
+ KeyMgmtMask filsMask = static_cast<KeyMgmtMask>(
+ static_cast<uint32_t>(KeyMgmtMask::FILS_SHA256) |
+ static_cast<uint32_t>(KeyMgmtMask::FILS_SHA384));
+ return keyMgmtSupported(iface, filsMask);
+}
+
+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;
+}
+
+bool waitForFrameworkReady() {
+ int waitCount = 15;
+ do {
+ // Check whether package service is ready or not.
+ if (!testing::checkSubstringInCommandOutput(
+ "/system/bin/service check package", ": not found")) {
+ return true;
+ }
+ LOG(INFO) << "Framework is not ready";
+ sleep(1);
+ } while (waitCount-- > 0);
+ return false;
+}
+
+bool waitForSupplicantStart() { return waitForSupplicantState(true); }
+
+bool waitForSupplicantStop() { return waitForSupplicantState(false); }
+
+void stopSupplicant() {
+ SupplicantManager supplicant_manager;
+ ASSERT_TRUE(supplicant_manager.StopSupplicant());
+ ASSERT_FALSE(supplicant_manager.IsSupplicantRunning());
+}
+
+bool startWifiFramework() {
+ std::system("svc wifi enable");
+ std::system("cmd wifi set-scan-always-available enabled");
+ return waitForSupplicantStart();
+}
+
+bool stopWifiFramework() {
+ std::system("svc wifi disable");
+ std::system("cmd wifi set-scan-always-available disabled");
+ return waitForSupplicantStop();
+}
+
+void initializeService() {
+ ASSERT_TRUE(stopWifiFramework());
+ std::system("/system/bin/start");
+ ASSERT_TRUE(waitForFrameworkReady());
+ stopSupplicant();
+}
+
+#endif // SUPPLICANT_TEST_UTILS_H
\ No newline at end of file