[test_suite] Add Location Privacy HAL

Bug: 244637957
Test: Build test_suite pass

Change-Id: Id874a52d7ab62ae31b2d840cc236543be903191e
This commit is contained in:
Terry Huang
2022-11-18 14:51:51 +08:00
parent 2f2a0482ff
commit 1f79db1faa
5 changed files with 45 additions and 0 deletions

View File

@@ -104,6 +104,9 @@ class RadioNetwork : public RadioCompatBase,
::ndk::ScopedAStatus setNullCipherAndIntegrityEnabled(int32_t serial, bool enabled) override;
::ndk::ScopedAStatus setLocationPrivacySetting(int32_t serial, bool shareLocation) override;
::ndk::ScopedAStatus getLocationPrivacySetting(int32_t serial) override;
protected:
std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> respond();

View File

@@ -360,4 +360,18 @@ ScopedAStatus RadioNetwork::setN1ModeEnabled(int32_t serial, bool /*enable*/) {
respond()->setN1ModeEnabledResponse(notSupported(serial));
return ok();
}
ScopedAStatus RadioNetwork::setLocationPrivacySetting(int32_t serial, bool /*shareLocation*/) {
LOG_CALL << serial;
LOG(ERROR) << " setLocationPrivacySetting is unsupported by HIDL HALs";
respond()->setLocationPrivacySettingResponse(notSupported(serial));
return ok();
}
ScopedAStatus RadioNetwork::getLocationPrivacySetting(int32_t serial) {
LOG_CALL << serial;
LOG(ERROR) << " getLocationPrivacySetting is unsupported by HIDL HALs";
respond()->getLocationPrivacySettingResponse(notSupported(serial), false);
return ok();
}
} // namespace android::hardware::radio::compat

View File

@@ -97,3 +97,8 @@ ndk::ScopedAStatus RadioNetworkIndication::emergencyNetworkScanResult(
RadioIndicationType /*type*/, const EmergencyRegResult& /*result*/) {
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioNetworkIndication::onNetworkInitiatedLocationResult(
RadioIndicationType /*type*/, LocationResponseType /*locationResponseType*/) {
return ndk::ScopedAStatus::ok();
}

View File

@@ -313,3 +313,17 @@ ndk::ScopedAStatus RadioNetworkResponse::setN1ModeEnabledResponse(const RadioRes
parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioNetworkResponse::setLocationPrivacySettingResponse(
const RadioResponseInfo& info) {
rspInfo = info;
parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioNetworkResponse::getLocationPrivacySettingResponse(
const RadioResponseInfo& info, bool /*shareLocation*/) {
rspInfo = info;
parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}

View File

@@ -166,6 +166,12 @@ class RadioNetworkResponse : public BnRadioNetworkResponse {
const RadioResponseInfo& info, bool isEnabled) override;
virtual ndk::ScopedAStatus setN1ModeEnabledResponse(const RadioResponseInfo& info) override;
virtual ndk::ScopedAStatus setLocationPrivacySettingResponse(
const RadioResponseInfo& info) override;
virtual ndk::ScopedAStatus getLocationPrivacySettingResponse(const RadioResponseInfo& info,
bool shareLocation) override;
};
/* Callback class for radio network indication */
@@ -223,6 +229,9 @@ class RadioNetworkIndication : public BnRadioNetworkIndication {
virtual ndk::ScopedAStatus emergencyNetworkScanResult(
RadioIndicationType type, const EmergencyRegResult& result) override;
virtual ndk::ScopedAStatus onNetworkInitiatedLocationResult(
RadioIndicationType type, LocationResponseType locationResponseType) override;
};
// The main test class for Radio AIDL Network.