Loading src/java/com/android/internal/telephony/satellite/SatelliteController.java +31 −4 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPOR import static android.telephony.CarrierConfigManager.KEY_SATELLITE_CONNECTION_HYSTERESIS_SEC_INT; import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL; import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ESOS_SUPPORTED_BOOL; import static android.telephony.CarrierConfigManager.KEY_SATELLITE_SOS_MAX_DATAGRAM_SIZE; import static android.telephony.CarrierConfigManager.KEY_SATELLITE_NIDD_APN_NAME_STRING; import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ROAMING_ESOS_INACTIVITY_TIMEOUT_SEC_INT; import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ROAMING_P2P_SMS_INACTIVITY_TIMEOUT_SEC_INT; Loading Loading @@ -1450,11 +1451,12 @@ public class SatelliteController extends Handler { synchronized (mNeedsSatellitePointingLock) { mNeedsSatellitePointing = capabilities.isPointingRequired(); } if (DBG) plogd("getSatelliteCapabilities: " + capabilities); bundle.putParcelable(SatelliteManager.KEY_SATELLITE_CAPABILITIES, capabilities); synchronized (mSatelliteCapabilitiesLock) { mSatelliteCapabilities = capabilities; overrideSatelliteCapabilitiesIfApplicable(); if (DBG) plogd("getSatelliteCapabilities: " + mSatelliteCapabilities); bundle.putParcelable(SatelliteManager.KEY_SATELLITE_CAPABILITIES, mSatelliteCapabilities); } } } Loading Loading @@ -4338,8 +4340,11 @@ public class SatelliteController extends Handler { List<ISatelliteCapabilitiesCallback> deadCallersList = new ArrayList<>(); mSatelliteCapabilitiesChangedListeners.values().forEach(listener -> { synchronized (this.mSatelliteCapabilitiesLock) { overrideSatelliteCapabilitiesIfApplicable(); } try { listener.onSatelliteCapabilitiesChanged(capabilities); listener.onSatelliteCapabilitiesChanged(this.mSatelliteCapabilities); } catch (RemoteException e) { plogd("handleEventSatelliteCapabilitiesChanged RemoteException: " + e); deadCallersList.add(listener); Loading Loading @@ -7013,4 +7018,26 @@ public class SatelliteController extends Handler { } return true; } /** * This method check for the key KEY_SATELLITE_MAX_DATAGRAM_SIZE in carrier config. If * available it fetches the value and override the same in SatelliteCapabilities. Otherwise it * uses the value in the existed mSatelliteCapabilities. */ private void overrideSatelliteCapabilitiesIfApplicable() { synchronized (this.mSatellitePhoneLock) { if (this.mSatellitePhone == null) { return; } } int subId = getSelectedSatelliteSubId(); PersistableBundle config = getPersistableBundle(subId); if (config.containsKey(KEY_SATELLITE_SOS_MAX_DATAGRAM_SIZE)) { int datagramSize = config.getInt(KEY_SATELLITE_SOS_MAX_DATAGRAM_SIZE); SubscriptionInfo subInfo = mSubscriptionManagerService.getSubscriptionInfo(subId); if (!(subInfo == null || subInfo.isOnlyNonTerrestrialNetwork())) { this.mSatelliteCapabilities.setMaxBytesPerOutgoingDatagram(datagramSize); } } } } Loading
src/java/com/android/internal/telephony/satellite/SatelliteController.java +31 −4 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPOR import static android.telephony.CarrierConfigManager.KEY_SATELLITE_CONNECTION_HYSTERESIS_SEC_INT; import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL; import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ESOS_SUPPORTED_BOOL; import static android.telephony.CarrierConfigManager.KEY_SATELLITE_SOS_MAX_DATAGRAM_SIZE; import static android.telephony.CarrierConfigManager.KEY_SATELLITE_NIDD_APN_NAME_STRING; import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ROAMING_ESOS_INACTIVITY_TIMEOUT_SEC_INT; import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ROAMING_P2P_SMS_INACTIVITY_TIMEOUT_SEC_INT; Loading Loading @@ -1450,11 +1451,12 @@ public class SatelliteController extends Handler { synchronized (mNeedsSatellitePointingLock) { mNeedsSatellitePointing = capabilities.isPointingRequired(); } if (DBG) plogd("getSatelliteCapabilities: " + capabilities); bundle.putParcelable(SatelliteManager.KEY_SATELLITE_CAPABILITIES, capabilities); synchronized (mSatelliteCapabilitiesLock) { mSatelliteCapabilities = capabilities; overrideSatelliteCapabilitiesIfApplicable(); if (DBG) plogd("getSatelliteCapabilities: " + mSatelliteCapabilities); bundle.putParcelable(SatelliteManager.KEY_SATELLITE_CAPABILITIES, mSatelliteCapabilities); } } } Loading Loading @@ -4338,8 +4340,11 @@ public class SatelliteController extends Handler { List<ISatelliteCapabilitiesCallback> deadCallersList = new ArrayList<>(); mSatelliteCapabilitiesChangedListeners.values().forEach(listener -> { synchronized (this.mSatelliteCapabilitiesLock) { overrideSatelliteCapabilitiesIfApplicable(); } try { listener.onSatelliteCapabilitiesChanged(capabilities); listener.onSatelliteCapabilitiesChanged(this.mSatelliteCapabilities); } catch (RemoteException e) { plogd("handleEventSatelliteCapabilitiesChanged RemoteException: " + e); deadCallersList.add(listener); Loading Loading @@ -7013,4 +7018,26 @@ public class SatelliteController extends Handler { } return true; } /** * This method check for the key KEY_SATELLITE_MAX_DATAGRAM_SIZE in carrier config. If * available it fetches the value and override the same in SatelliteCapabilities. Otherwise it * uses the value in the existed mSatelliteCapabilities. */ private void overrideSatelliteCapabilitiesIfApplicable() { synchronized (this.mSatellitePhoneLock) { if (this.mSatellitePhone == null) { return; } } int subId = getSelectedSatelliteSubId(); PersistableBundle config = getPersistableBundle(subId); if (config.containsKey(KEY_SATELLITE_SOS_MAX_DATAGRAM_SIZE)) { int datagramSize = config.getInt(KEY_SATELLITE_SOS_MAX_DATAGRAM_SIZE); SubscriptionInfo subInfo = mSubscriptionManagerService.getSubscriptionInfo(subId); if (!(subInfo == null || subInfo.isOnlyNonTerrestrialNetwork())) { this.mSatelliteCapabilities.setMaxBytesPerOutgoingDatagram(datagramSize); } } } }