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

Commit 6128ce23 authored by Hidayat Khan's avatar Hidayat Khan Committed by Android (Google) Code Review
Browse files

Merge "Add Satellite Availability config check in SatelliteController" into main

parents d4972f39 511db40d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -193,6 +193,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import com.android.internal.R;

/**
 * Satellite controller is the backend service of
@@ -6395,6 +6396,13 @@ public class SatelliteController extends Handler {
     */
    private void updateSatelliteSystemNotification(int subId,
            @CARRIER_ROAMING_NTN_CONNECT_TYPE int carrierRoamingNtnConnectType, boolean visible) {
        boolean notifySatelliteAvailabilityEnabled =
            mContext.getResources().getBoolean(R.bool.config_satellite_should_notify_availability);
        if (!mFeatureFlags.carrierRoamingNbIotNtn() || !notifySatelliteAvailabilityEnabled) {
            plogd("updateSatelliteSystemNotification: satellite notifications are not enabled.");
            return;
        }

        plogd("updateSatelliteSystemNotification subId=" + subId + ", carrierRoamingNtnConnectType="
                + SatelliteServiceUtils.carrierRoamingNtnConnectTypeToString(
                carrierRoamingNtnConnectType) + ", visible=" + visible);
+6 −1
Original line number Diff line number Diff line
@@ -1702,6 +1702,7 @@ public class SatelliteControllerTest extends TelephonyTest {

    @Test
    public void testRegisterForSatelliteProvisionStateChanged() {
        when(mFeatureFlags.carrierRoamingNbIotNtn()).thenReturn(true);
        Semaphore semaphore = new Semaphore(0);
        ISatelliteProvisionStateCallback callback =
                new ISatelliteProvisionStateCallback.Stub() {
@@ -1753,7 +1754,6 @@ public class SatelliteControllerTest extends TelephonyTest {
        processAllMessages();
        assertTrue(waitForForEvents(
                semaphore, 1, "testRegisterForSatelliteProvisionStateChanged"));

        mSatelliteControllerUT.unregisterForSatelliteProvisionStateChanged(callback);
        semaphore.drainPermits();
        cancelRemote = mSatelliteControllerUT.provisionSatelliteService(
@@ -3650,7 +3650,10 @@ public class SatelliteControllerTest extends TelephonyTest {

    @Test
    public void testHandleEventServiceStateChanged() {
        mContextFixture.putBooleanResource(
            R.bool.config_satellite_should_notify_availability, true);
        when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
        when(mFeatureFlags.carrierRoamingNbIotNtn()).thenReturn(true);
        mCarrierConfigBundle.putInt(KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT,
                CARRIER_ROAMING_NTN_CONNECT_AUTOMATIC);
        invokeCarrierConfigChanged();
@@ -4145,6 +4148,8 @@ public class SatelliteControllerTest extends TelephonyTest {

    @Test
    public void testNotifyNtnEligibilityHysteresisTimedOut() {
        mContextFixture.putBooleanResource(
            R.bool.config_satellite_should_notify_availability, true);
        when(mFeatureFlags.carrierRoamingNbIotNtn()).thenReturn(true);
        when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
        when(mServiceState2.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE);