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

Commit 6f58417c authored by Kyunglyul Hyun's avatar Kyunglyul Hyun
Browse files

Skip PbapServiceTest if feature is not supported

TelephonyManager#getLine1Number requires the feature.

Flag: EXEMPT, test only change
Bug: 367395001
Test: atest BluetoothPbapServiceTest
Change-Id: Ifb85d713643394c85ca3b26ae48140fbb63689b2
parent d9eccc61
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.bluetooth.pbap;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertThat;


import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertThrows;
import static org.junit.Assume.assumeNotNull;
import static org.junit.Assume.assumeTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doReturn;
@@ -31,6 +33,7 @@ import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothProfile;
import android.bluetooth.BluetoothProfile;
import android.content.Context;
import android.content.Context;
import android.content.Intent;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Message;
import android.os.Message;
import android.os.UserManager;
import android.os.UserManager;
import android.os.test.TestLooper;
import android.os.test.TestLooper;
@@ -97,6 +100,10 @@ public class BluetoothPbapServiceTest {
        mService = new BluetoothPbapService(mAdapterService, mNotificationManager);
        mService = new BluetoothPbapService(mAdapterService, mNotificationManager);
        mService.start();
        mService.start();
        mService.setAvailable(true);
        mService.setAvailable(true);

        PackageManager pm = mTargetContext.getPackageManager();
        assumeNotNull(pm);
        assumeTrue(pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION));
    }
    }


    @After
    @After