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

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

Disable caching during HeadsetPhoneStateTest

Mocking of telephony services causes issues with client-side caches, so
we disable caching during HeadsetPhoneStateTest.
Bug: 151953109
Test: atest HeadsetPhoneStateTest

Merged-In: I73b6325a7ea355218c61e279e9b2ca60edc29ac8
Change-Id: I73b6325a7ea355218c61e279e9b2ca60edc29ac8
parent 1552339a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.bluetooth.hfp;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;

import android.app.PropertyInvalidatedCache;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
@@ -66,6 +67,7 @@ public class HeadsetPhoneStateTest {
        if (Looper.myLooper() == null) {
            Looper.prepare();
        }
        PropertyInvalidatedCache.disableForTestMode();
        MockitoAnnotations.initMocks(this);
        TelephonyManager.disableServiceHandleCaching();
        // Mock SubscriptionManager.getDefaultSubscriptionId() to return a valid value