Loading src/java/com/android/internal/telephony/satellite/SatelliteController.java +8 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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); Loading tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java +6 −1 Original line number Diff line number Diff line Loading @@ -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() { Loading Loading @@ -1753,7 +1754,6 @@ public class SatelliteControllerTest extends TelephonyTest { processAllMessages(); assertTrue(waitForForEvents( semaphore, 1, "testRegisterForSatelliteProvisionStateChanged")); mSatelliteControllerUT.unregisterForSatelliteProvisionStateChanged(callback); semaphore.drainPermits(); cancelRemote = mSatelliteControllerUT.provisionSatelliteService( Loading Loading @@ -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(); Loading Loading @@ -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); Loading Loading
src/java/com/android/internal/telephony/satellite/SatelliteController.java +8 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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); Loading
tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java +6 −1 Original line number Diff line number Diff line Loading @@ -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() { Loading Loading @@ -1753,7 +1754,6 @@ public class SatelliteControllerTest extends TelephonyTest { processAllMessages(); assertTrue(waitForForEvents( semaphore, 1, "testRegisterForSatelliteProvisionStateChanged")); mSatelliteControllerUT.unregisterForSatelliteProvisionStateChanged(callback); semaphore.drainPermits(); cancelRemote = mSatelliteControllerUT.provisionSatelliteService( Loading Loading @@ -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(); Loading Loading @@ -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); Loading