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

Commit fe732844 authored by Collin Fijalkovich's avatar Collin Fijalkovich
Browse files

Disable Telephony service handle caching for tests

Telephony binder handle caching breaks HeadsetPhoneStateTest,
this change disables the caching in setUp and re-enables it in
tear-down.

Test: will test in presubmit
Bug: 140788621
Change-Id: I315762abc064fa31d46b7e9790e4552badbda622
parent d2350225
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ public class HeadsetPhoneStateTest {
    @Before
    public void setUp() throws Exception {
        MockitoAnnotations.initMocks(this);
        TelephonyManager.disableServiceHandleCaching();
        // Mock SubscriptionManager.getDefaultSubscriptionId() to return a valid value
        when(mISub.getDefaultSubId()).thenReturn(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID);
        when(mISubBinder.queryLocalInterface(anyString())).thenReturn(mISub);
@@ -91,7 +92,7 @@ public class HeadsetPhoneStateTest {
                    mServiceManagerOriginalServices);
            mServiceManagerOriginalServices = null;
        }

        TelephonyManager.enableServiceHandleCaching();
    }

    /**