Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f79db1f authored by Terry Huang's avatar Terry Huang
Browse files

[test_suite] Add Location Privacy HAL

Bug: 244637957
Test: Build test_suite pass

Change-Id: Id874a52d7ab62ae31b2d840cc236543be903191e
parent 2f2a0482
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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();

+14 −0
Original line number Diff line number Diff line
@@ -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
+5 −0
Original line number Diff line number Diff line
@@ -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();
}
+14 −0
Original line number Diff line number Diff line
@@ -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();
}
+9 −0
Original line number Diff line number Diff line
@@ -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.