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

Commit 1d6af590 authored by Kihong Seong's avatar Kihong Seong
Browse files

Disable BluetoothMapbMessageSmsTest when sms is not supported

Bug: 266850524
Test: atest BluetoothInstrumentationTests
Change-Id: Ia3abb4b29dba872e6bb56fcc55e6832971528073
parent 42573e42
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.bluetooth.map;
import static com.google.common.truth.Truth.assertThat;

import android.content.Context;
import android.telephony.SmsManager;

import androidx.test.filters.SmallTest;
import androidx.test.InstrumentationRegistry;
@@ -26,6 +27,7 @@ import androidx.test.runner.AndroidJUnit4;

import com.android.bluetooth.map.BluetoothMapSmsPdu.SmsPdu;

import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -41,11 +43,14 @@ public class BluetoothMapbMessageSmsTest {
    private static final String TEST_MESSAGE = "test";
    private static final String TEST_ADDRESS = "12";

    private SmsManager mSmsManager = SmsManager.getDefault();
    private Context mTargetContext;
    private ArrayList<SmsPdu> TEST_SMS_BODY_PDUS;

    @Before
    public void setUp() throws Exception {
        // Do not run test if sms is not supported
        Assume.assumeTrue(mSmsManager.isImsSmsSupported());
        mTargetContext = InstrumentationRegistry.getTargetContext();
        TEST_SMS_BODY_PDUS = BluetoothMapSmsPdu.getSubmitPdus(mTargetContext, TEST_MESSAGE,
                TEST_ADDRESS);