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

Commit a2881ffb authored by Chen Baoyu's avatar Chen Baoyu Committed by Jack Yu
Browse files

Fix crash issue on test case RadioHidlTest_v1_5#startNetworkScan.



Bad safe_union access is raised by calling the GET method of
eutranBands(), because in default ctor of safe_union RadioAccessSpecifier::Bands
hidl_d is assigned with hidl_discriminator::geranBands, which conflicts
with hidl_discriminator::eutranBands, and leads to crash.

Should use the SET method of eutranBands(&) for assignment purpose.

Fix: 275077563
Bug: 271642958
Change-Id: Ie241e8968eb7f9a1297203be2ab4e0a1bf738dea
Signed-off-by: default avatarJia Jia <jia.jia@zte.com.cn>
parent 2550e7a7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -565,9 +565,9 @@ TEST_P(RadioHidlTest_v1_5, startNetworkScan) {
    serial = GetRandomSerialNumber();

    ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands band17;
    band17.eutranBands() = {::android::hardware::radio::V1_5::EutranBands::BAND_17};
    band17.eutranBands({::android::hardware::radio::V1_5::EutranBands::BAND_17});
    ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands band20;
    band20.eutranBands() = {::android::hardware::radio::V1_5::EutranBands::BAND_20};
    band20.eutranBands({::android::hardware::radio::V1_5::EutranBands::BAND_20});
    ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier17 = {
            .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::EUTRAN,
            .bands = band17,