Loading src/java/com/android/internal/telephony/satellite/SatelliteController.java +23 −23 Original line number Diff line number Diff line Loading @@ -138,7 +138,7 @@ import android.telephony.satellite.ISelectedNbIotSatelliteSubscriptionCallback; import android.telephony.satellite.NtnSignalStrength; import android.telephony.satellite.SatelliteAccessConfiguration; import android.telephony.satellite.SatelliteCapabilities; import android.telephony.satellite.SatelliteCommunicationAllowedStateCallback; import android.telephony.satellite.SatelliteCommunicationAccessStateCallback; import android.telephony.satellite.SatelliteDatagram; import android.telephony.satellite.SatelliteManager; import android.telephony.satellite.SatelliteModemEnableRequestAttributes; Loading Loading @@ -392,7 +392,7 @@ public class SatelliteController extends Handler { new AtomicBoolean(false); private final AtomicBoolean mRegisteredForTerrestrialNetworkAvailableChanged = new AtomicBoolean(false); private final AtomicBoolean mRegisteredForSatelliteCommunicationAllowedStateChanged = private final AtomicBoolean mRegisteredForSatelliteCommunicationAccessStateChanged = new AtomicBoolean(false); /** * Map key: subId, value: callback to get error code of the provision request. Loading Loading @@ -895,7 +895,7 @@ public class SatelliteController extends Handler { registerForSatelliteModemStateChanged(); registerForServiceStateChanged(); registerForSignalStrengthChanged(); registerForSatelliteCommunicationAllowedStateChanged(); registerForSatelliteCommunicationAccessStateChanged(); mContentResolver = mContext.getContentResolver(); mCarrierConfigManager = mContext.getSystemService(CarrierConfigManager.class); Loading Loading @@ -4796,7 +4796,7 @@ public class SatelliteController extends Handler { synchronized (mSatelliteTokenProvisionedLock) { for (SatelliteSubscriberInfo subscriberInfo : newList) { int subId = subscriberInfo.getSubId(); int subId = subscriberInfo.getSubscriptionId(); Boolean currentProvisioned = mProvisionedSubscriberId.get(subscriberInfo.getSubscriberId()); if (currentProvisioned == null) { Loading Loading @@ -6136,7 +6136,7 @@ public class SatelliteController extends Handler { return; } registerForSatelliteCommunicationAllowedStateChanged(); registerForSatelliteCommunicationAccessStateChanged(); boolean eligible = isCarrierRoamingNtnEligible(getSatellitePhone()); plogd("evaluateCarrierRoamingNtnEligibilityChange: " Loading Loading @@ -7380,7 +7380,7 @@ public class SatelliteController extends Handler { SatelliteSubscriberInfo satelliteSubscriberInfo = new SatelliteSubscriberInfo.Builder().setSubscriberId(subscriberId) .setCarrierId(carrierId).setNiddApn(apn) .setSubId(info.getSubscriptionId()) .setSubscriptionId(info.getSubscriptionId()) .setSubscriberIdType(subscriberIdPair.second) .build(); boolean provisioned = mProvisionedSubscriberId.getOrDefault(subscriberId, Loading Loading @@ -7898,25 +7898,25 @@ public class SatelliteController extends Handler { } @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE) protected void registerForSatelliteCommunicationAllowedStateChanged() { if (mRegisteredForSatelliteCommunicationAllowedStateChanged.get()) { protected void registerForSatelliteCommunicationAccessStateChanged() { if (mRegisteredForSatelliteCommunicationAccessStateChanged.get()) { if (DEBUG) { plogd("registerForSatelliteCommunicationAllowedStateChanged: already registered."); plogd("registerForSatelliteCommunicationAccessStateChanged: already registered."); } return; } SatelliteManager satelliteManager = mContext.getSystemService(SatelliteManager.class); if (satelliteManager == null) { ploge("registerForSatelliteCommunicationAllowedStateChanged: SatelliteManager is null"); ploge("registerForSatelliteCommunicationAccessStateChanged: SatelliteManager is null"); return; } SatelliteCommunicationAllowedStateCallback allowedStateCallback = new SatelliteCommunicationAllowedStateCallback() { SatelliteCommunicationAccessStateCallback accessStateCallback = new SatelliteCommunicationAccessStateCallback() { @Override public void onSatelliteCommunicationAllowedStateChanged(boolean isAllowed) { plogd("onSatelliteCommunicationAllowedStateChanged: isAllowed=" public void onAccessAllowedStateChanged(boolean isAllowed) { plogd("onAccessStateChanged: isAllowed=" + isAllowed); synchronized (mSatelliteAccessConfigLock) { mSatelliteAccessAllowed = isAllowed; Loading @@ -7925,23 +7925,23 @@ public class SatelliteController extends Handler { } @Override public void onSatelliteAccessConfigurationChanged( public void onAccessConfigurationChanged( SatelliteAccessConfiguration satelliteAccessConfiguration) { plogd("onSatelliteAccessConfigurationChanged: satelliteAccessConfiguration=" plogd("onAccessConfigurationChanged: satelliteAccessConfiguration=" + satelliteAccessConfiguration); handleSatelliteAccessConfigUpdateResult(satelliteAccessConfiguration); } }; try { satelliteManager.registerForCommunicationAllowedStateChanged( this::post, allowedStateCallback); satelliteManager.registerForCommunicationAccessStateChanged( this::post, accessStateCallback); } catch(RuntimeException e) { plogd("registerForSatelliteCommunicationAllowedStateChanged: " + "satelliteManager.registerForCommunicationAllowedStateChanged() failed, " + "e=" + e); plogd("registerForSatelliteCommunicationAccessStateChanged: " + "satelliteManager.registerForCommunicationAccessStateChanged() failed, " + "e=" + e); return; } mRegisteredForSatelliteCommunicationAllowedStateChanged.set(true); mRegisteredForSatelliteCommunicationAccessStateChanged.set(true); } private void handleSatelliteAccessConfigUpdateResult( Loading Loading @@ -8224,7 +8224,7 @@ public class SatelliteController extends Handler { } return new SatelliteSubscriberInfo.Builder().setSubscriberId(subscriberId) .setCarrierId(carrierId).setNiddApn(apn) .setSubId(subInfo.getSubscriptionId()) .setSubscriptionId(subInfo.getSubscriptionId()) .setSubscriberIdType(subscriberIdPair.second) .build(); } Loading tests/telephonytests/src/com/android/internal/telephony/TelephonyRegistryTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -224,7 +224,7 @@ public class TelephonyRegistryTest extends TelephonyTest { TelephonyCallback.DataActivityListener, TelephonyCallback.SimultaneousCellularCallingSupportListener, TelephonyCallback.EmergencyCallbackModeListener, TelephonyCallback.CarrierRoamingNtnModeListener, TelephonyCallback.CarrierRoamingNtnListener, TelephonyCallback.SecurityAlgorithmsListener, TelephonyCallback.CellularIdentifierDisclosedListener, TelephonyCallback.CallAttributesListener { Loading tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java +6 −6 Original line number Diff line number Diff line Loading @@ -4895,10 +4895,10 @@ public class SatelliteControllerTest extends TelephonyTest { private List<SatelliteSubscriberInfo> getExpectedSatelliteSubscriberInfoList() { List<SatelliteSubscriberInfo> list = new ArrayList<>(); list.add(new SatelliteSubscriberInfo.Builder().setSubscriberId(mSubscriberId).setCarrierId( mCarrierId).setNiddApn(mNiddApn).setSubId(SUB_ID).setSubscriberIdType( mCarrierId).setNiddApn(mNiddApn).setSubscriptionId(SUB_ID).setSubscriberIdType( SatelliteSubscriberInfo.SUBSCRIBER_ID_TYPE_IMSI_MSISDN).build()); list.add(new SatelliteSubscriberInfo.Builder().setSubscriberId(mSubscriberId2).setCarrierId( mCarrierId).setNiddApn(mNiddApn).setSubId(SUB_ID1).setSubscriberIdType( mCarrierId).setNiddApn(mNiddApn).setSubscriptionId(SUB_ID1).setSubscriberIdType( SatelliteSubscriberInfo.SUBSCRIBER_ID_TYPE_ICCID).build()); return list; } Loading Loading @@ -5003,7 +5003,7 @@ public class SatelliteControllerTest extends TelephonyTest { } @Test public void testRegisterForSatelliteCommunicationAllowedStateChanged() throws Exception { public void testRegisterForSatelliteCommunicationAccessStateChanged() throws Exception { when(mFeatureFlags.carrierRoamingNbIotNtn()).thenReturn(true); mContextFixture.putIntArrayResource( R.array.config_verizon_satellite_enabled_tagids, Loading Loading @@ -5035,7 +5035,7 @@ public class SatelliteControllerTest extends TelephonyTest { setComponentName(); mSatelliteControllerUT.setIsSatelliteAllowedState(true); mSatelliteControllerUT.registerForSatelliteCommunicationAllowedStateChanged(); mSatelliteControllerUT.registerForSatelliteCommunicationAccessStateChanged(); // Test satelliteAccessConfigCallback.onSuccess // with current location NOT supporting carrier satellite Loading Loading @@ -6218,8 +6218,8 @@ public class SatelliteControllerTest extends TelephonyTest { } @Override protected void registerForSatelliteCommunicationAllowedStateChanged() { logd("registerForSatelliteCommunicationAllowedStateChanged"); protected void registerForSatelliteCommunicationAccessStateChanged() { logd("registerForSatelliteCommunicationAccessStateChanged"); } void setSatelliteSessionController(SatelliteSessionController satelliteSessionController) { Loading tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteSOSMessageRecommenderTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -877,8 +877,8 @@ public class SatelliteSOSMessageRecommenderTest extends TelephonyTest { } @Override protected void registerForSatelliteCommunicationAllowedStateChanged() { logd("registerForSatelliteCommunicationAllowedStateChanged"); protected void registerForSatelliteCommunicationAccessStateChanged() { logd("registerForSatelliteCommunicationAccessStateChanged"); } @Override Loading Loading @@ -1004,8 +1004,8 @@ public class SatelliteSOSMessageRecommenderTest extends TelephonyTest { } @Override protected void registerForSatelliteCommunicationAllowedStateChanged() { logd("registerForSatelliteCommunicationAllowedStateChanged"); protected void registerForSatelliteCommunicationAccessStateChanged() { logd("registerForSatelliteCommunicationAccessStateChanged"); } } Loading Loading
src/java/com/android/internal/telephony/satellite/SatelliteController.java +23 −23 Original line number Diff line number Diff line Loading @@ -138,7 +138,7 @@ import android.telephony.satellite.ISelectedNbIotSatelliteSubscriptionCallback; import android.telephony.satellite.NtnSignalStrength; import android.telephony.satellite.SatelliteAccessConfiguration; import android.telephony.satellite.SatelliteCapabilities; import android.telephony.satellite.SatelliteCommunicationAllowedStateCallback; import android.telephony.satellite.SatelliteCommunicationAccessStateCallback; import android.telephony.satellite.SatelliteDatagram; import android.telephony.satellite.SatelliteManager; import android.telephony.satellite.SatelliteModemEnableRequestAttributes; Loading Loading @@ -392,7 +392,7 @@ public class SatelliteController extends Handler { new AtomicBoolean(false); private final AtomicBoolean mRegisteredForTerrestrialNetworkAvailableChanged = new AtomicBoolean(false); private final AtomicBoolean mRegisteredForSatelliteCommunicationAllowedStateChanged = private final AtomicBoolean mRegisteredForSatelliteCommunicationAccessStateChanged = new AtomicBoolean(false); /** * Map key: subId, value: callback to get error code of the provision request. Loading Loading @@ -895,7 +895,7 @@ public class SatelliteController extends Handler { registerForSatelliteModemStateChanged(); registerForServiceStateChanged(); registerForSignalStrengthChanged(); registerForSatelliteCommunicationAllowedStateChanged(); registerForSatelliteCommunicationAccessStateChanged(); mContentResolver = mContext.getContentResolver(); mCarrierConfigManager = mContext.getSystemService(CarrierConfigManager.class); Loading Loading @@ -4796,7 +4796,7 @@ public class SatelliteController extends Handler { synchronized (mSatelliteTokenProvisionedLock) { for (SatelliteSubscriberInfo subscriberInfo : newList) { int subId = subscriberInfo.getSubId(); int subId = subscriberInfo.getSubscriptionId(); Boolean currentProvisioned = mProvisionedSubscriberId.get(subscriberInfo.getSubscriberId()); if (currentProvisioned == null) { Loading Loading @@ -6136,7 +6136,7 @@ public class SatelliteController extends Handler { return; } registerForSatelliteCommunicationAllowedStateChanged(); registerForSatelliteCommunicationAccessStateChanged(); boolean eligible = isCarrierRoamingNtnEligible(getSatellitePhone()); plogd("evaluateCarrierRoamingNtnEligibilityChange: " Loading Loading @@ -7380,7 +7380,7 @@ public class SatelliteController extends Handler { SatelliteSubscriberInfo satelliteSubscriberInfo = new SatelliteSubscriberInfo.Builder().setSubscriberId(subscriberId) .setCarrierId(carrierId).setNiddApn(apn) .setSubId(info.getSubscriptionId()) .setSubscriptionId(info.getSubscriptionId()) .setSubscriberIdType(subscriberIdPair.second) .build(); boolean provisioned = mProvisionedSubscriberId.getOrDefault(subscriberId, Loading Loading @@ -7898,25 +7898,25 @@ public class SatelliteController extends Handler { } @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE) protected void registerForSatelliteCommunicationAllowedStateChanged() { if (mRegisteredForSatelliteCommunicationAllowedStateChanged.get()) { protected void registerForSatelliteCommunicationAccessStateChanged() { if (mRegisteredForSatelliteCommunicationAccessStateChanged.get()) { if (DEBUG) { plogd("registerForSatelliteCommunicationAllowedStateChanged: already registered."); plogd("registerForSatelliteCommunicationAccessStateChanged: already registered."); } return; } SatelliteManager satelliteManager = mContext.getSystemService(SatelliteManager.class); if (satelliteManager == null) { ploge("registerForSatelliteCommunicationAllowedStateChanged: SatelliteManager is null"); ploge("registerForSatelliteCommunicationAccessStateChanged: SatelliteManager is null"); return; } SatelliteCommunicationAllowedStateCallback allowedStateCallback = new SatelliteCommunicationAllowedStateCallback() { SatelliteCommunicationAccessStateCallback accessStateCallback = new SatelliteCommunicationAccessStateCallback() { @Override public void onSatelliteCommunicationAllowedStateChanged(boolean isAllowed) { plogd("onSatelliteCommunicationAllowedStateChanged: isAllowed=" public void onAccessAllowedStateChanged(boolean isAllowed) { plogd("onAccessStateChanged: isAllowed=" + isAllowed); synchronized (mSatelliteAccessConfigLock) { mSatelliteAccessAllowed = isAllowed; Loading @@ -7925,23 +7925,23 @@ public class SatelliteController extends Handler { } @Override public void onSatelliteAccessConfigurationChanged( public void onAccessConfigurationChanged( SatelliteAccessConfiguration satelliteAccessConfiguration) { plogd("onSatelliteAccessConfigurationChanged: satelliteAccessConfiguration=" plogd("onAccessConfigurationChanged: satelliteAccessConfiguration=" + satelliteAccessConfiguration); handleSatelliteAccessConfigUpdateResult(satelliteAccessConfiguration); } }; try { satelliteManager.registerForCommunicationAllowedStateChanged( this::post, allowedStateCallback); satelliteManager.registerForCommunicationAccessStateChanged( this::post, accessStateCallback); } catch(RuntimeException e) { plogd("registerForSatelliteCommunicationAllowedStateChanged: " + "satelliteManager.registerForCommunicationAllowedStateChanged() failed, " + "e=" + e); plogd("registerForSatelliteCommunicationAccessStateChanged: " + "satelliteManager.registerForCommunicationAccessStateChanged() failed, " + "e=" + e); return; } mRegisteredForSatelliteCommunicationAllowedStateChanged.set(true); mRegisteredForSatelliteCommunicationAccessStateChanged.set(true); } private void handleSatelliteAccessConfigUpdateResult( Loading Loading @@ -8224,7 +8224,7 @@ public class SatelliteController extends Handler { } return new SatelliteSubscriberInfo.Builder().setSubscriberId(subscriberId) .setCarrierId(carrierId).setNiddApn(apn) .setSubId(subInfo.getSubscriptionId()) .setSubscriptionId(subInfo.getSubscriptionId()) .setSubscriberIdType(subscriberIdPair.second) .build(); } Loading
tests/telephonytests/src/com/android/internal/telephony/TelephonyRegistryTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -224,7 +224,7 @@ public class TelephonyRegistryTest extends TelephonyTest { TelephonyCallback.DataActivityListener, TelephonyCallback.SimultaneousCellularCallingSupportListener, TelephonyCallback.EmergencyCallbackModeListener, TelephonyCallback.CarrierRoamingNtnModeListener, TelephonyCallback.CarrierRoamingNtnListener, TelephonyCallback.SecurityAlgorithmsListener, TelephonyCallback.CellularIdentifierDisclosedListener, TelephonyCallback.CallAttributesListener { Loading
tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java +6 −6 Original line number Diff line number Diff line Loading @@ -4895,10 +4895,10 @@ public class SatelliteControllerTest extends TelephonyTest { private List<SatelliteSubscriberInfo> getExpectedSatelliteSubscriberInfoList() { List<SatelliteSubscriberInfo> list = new ArrayList<>(); list.add(new SatelliteSubscriberInfo.Builder().setSubscriberId(mSubscriberId).setCarrierId( mCarrierId).setNiddApn(mNiddApn).setSubId(SUB_ID).setSubscriberIdType( mCarrierId).setNiddApn(mNiddApn).setSubscriptionId(SUB_ID).setSubscriberIdType( SatelliteSubscriberInfo.SUBSCRIBER_ID_TYPE_IMSI_MSISDN).build()); list.add(new SatelliteSubscriberInfo.Builder().setSubscriberId(mSubscriberId2).setCarrierId( mCarrierId).setNiddApn(mNiddApn).setSubId(SUB_ID1).setSubscriberIdType( mCarrierId).setNiddApn(mNiddApn).setSubscriptionId(SUB_ID1).setSubscriberIdType( SatelliteSubscriberInfo.SUBSCRIBER_ID_TYPE_ICCID).build()); return list; } Loading Loading @@ -5003,7 +5003,7 @@ public class SatelliteControllerTest extends TelephonyTest { } @Test public void testRegisterForSatelliteCommunicationAllowedStateChanged() throws Exception { public void testRegisterForSatelliteCommunicationAccessStateChanged() throws Exception { when(mFeatureFlags.carrierRoamingNbIotNtn()).thenReturn(true); mContextFixture.putIntArrayResource( R.array.config_verizon_satellite_enabled_tagids, Loading Loading @@ -5035,7 +5035,7 @@ public class SatelliteControllerTest extends TelephonyTest { setComponentName(); mSatelliteControllerUT.setIsSatelliteAllowedState(true); mSatelliteControllerUT.registerForSatelliteCommunicationAllowedStateChanged(); mSatelliteControllerUT.registerForSatelliteCommunicationAccessStateChanged(); // Test satelliteAccessConfigCallback.onSuccess // with current location NOT supporting carrier satellite Loading Loading @@ -6218,8 +6218,8 @@ public class SatelliteControllerTest extends TelephonyTest { } @Override protected void registerForSatelliteCommunicationAllowedStateChanged() { logd("registerForSatelliteCommunicationAllowedStateChanged"); protected void registerForSatelliteCommunicationAccessStateChanged() { logd("registerForSatelliteCommunicationAccessStateChanged"); } void setSatelliteSessionController(SatelliteSessionController satelliteSessionController) { Loading
tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteSOSMessageRecommenderTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -877,8 +877,8 @@ public class SatelliteSOSMessageRecommenderTest extends TelephonyTest { } @Override protected void registerForSatelliteCommunicationAllowedStateChanged() { logd("registerForSatelliteCommunicationAllowedStateChanged"); protected void registerForSatelliteCommunicationAccessStateChanged() { logd("registerForSatelliteCommunicationAccessStateChanged"); } @Override Loading Loading @@ -1004,8 +1004,8 @@ public class SatelliteSOSMessageRecommenderTest extends TelephonyTest { } @Override protected void registerForSatelliteCommunicationAllowedStateChanged() { logd("registerForSatelliteCommunicationAllowedStateChanged"); protected void registerForSatelliteCommunicationAccessStateChanged() { logd("registerForSatelliteCommunicationAccessStateChanged"); } } Loading