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

Commit 0f51ab01 authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Do not crash on ENG builds when we hit a WTF during test

Override WTF handler to ensure WTFs do not cause test
to crash.

Test: atest FrameworksTelephonyTests
Change-Id: I010033f7510a77246f27e9a4f99babc18c838d48
parent 4d1d5049
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@
    <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
        <option name="package" value="com.android.frameworks.telephonytests" />
        <option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
        <option name="exclude-annotation" value="androidx.test.filters.FlakyTest" />
        <option name="exclude-annotation" value="org.junit.Ignore" />
        <option name="hidden-api-checks" value="false"/>
    </test>
</configuration>
+3 −1
Original line number Diff line number Diff line
@@ -443,7 +443,9 @@ public abstract class TelephonyTest {
        MockitoAnnotations.initMocks(this);
        TelephonyManager.disableServiceHandleCaching();
        SubscriptionController.disableCaching();

        // For testing do not allow Log.WTF as it can cause test process to crash
        Log.setWtfHandler((tagString, what, system) -> logd("WTF captured, ignoring. Tag: "
                + tagString + ", exception: " + what));

        mPhones = new Phone[] {mPhone};
        mImsCallProfile = new ImsCallProfile();