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

Commit 082ae25e authored by Saifuddin's avatar Saifuddin Committed by Syed Saifuddin Khazi
Browse files

allowsBackgroundActivityStarts checking

checks the BroadcastOptions option to confirm whether it allows Background activity to start

Bug: 269535969, 269760622
Test: atest FrameworksTelephonyTests
Change-Id: Ia2f46b5d35e61098ec5a83a1c5707b52ee590bbe
(cherry picked from commit 755eed2f)
parent 2034e081
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import android.app.BroadcastOptions;
import android.app.Notification;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
@@ -278,8 +279,8 @@ public class GsmInboundSmsHandlerTest extends TelephonyTest {
        assertEquals("WaitingState", getCurrentState().getName());
        if (allowBgActivityStarts) {
            Bundle broadcastOptions = mContextFixture.getLastBroadcastOptions();
            assertTrue(broadcastOptions
                    .getBoolean("android:broadcast.allowBackgroundActivityStarts"));
            BroadcastOptions brOptions = new BroadcastOptions(broadcastOptions);
            assertTrue(brOptions.allowsBackgroundActivityStarts());
        }

        mContextFixture.sendBroadcastToOrderedBroadcastReceivers();