diff options
author | 2025-03-30 15:24:34 -0700 | |
---|---|---|
committer | 2025-03-30 15:24:34 -0700 | |
commit | b5f6b84933f8421e67e1121224656c55ce38d445 (patch) | |
tree | d473450eadcb2dba6fa625ee1e8b1d6a40b1bda3 /src | |
parent | e7fba6d6e8eea20661da6445e478ea1cb9e751df (diff) | |
parent | 3557c8b10d5c44283eeabb61344838203d4993be (diff) |
Merge cherrypicks of ['googleplex-android-review.googlesource.com/32710850', 'googleplex-android-review.googlesource.com/32711605', 'googleplex-android-review.googlesource.com/32744249'] into 25Q2-release.
Change-Id: I44b4e719004d211babfd876d9373c5d1cf169480
Diffstat (limited to 'src')
3 files changed, 51 insertions, 19 deletions
diff --git a/src/java/com/android/internal/telephony/satellite/DatagramDispatcher.java b/src/java/com/android/internal/telephony/satellite/DatagramDispatcher.java index 0d4a2daefe..dc6be3a5d5 100644 --- a/src/java/com/android/internal/telephony/satellite/DatagramDispatcher.java +++ b/src/java/com/android/internal/telephony/satellite/DatagramDispatcher.java @@ -1382,8 +1382,6 @@ public class DatagramDispatcher extends Handler { } private boolean allowMtSmsPolling() { - if (!mFeatureFlags.carrierRoamingNbIotNtn()) return false; - SatelliteController satelliteController = SatelliteController.getInstance(); int subId = satelliteController.getSelectedSatelliteSubId(); boolean isP2PSmsDisallowed = @@ -1394,20 +1392,33 @@ public class DatagramDispatcher extends Handler { } boolean isModemStateConnectedOrTransferring; + boolean isAligned; + boolean isMtSmsPollingThrottled; synchronized (mLock) { - if (!mIsAligned) return false; - + isMtSmsPollingThrottled = mIsMtSmsPollingThrottled; + isAligned = mIsAligned; isModemStateConnectedOrTransferring = mModemState == SATELLITE_MODEM_STATE_CONNECTED || mModemState == SATELLITE_MODEM_STATE_DATAGRAM_TRANSFERRING; } + if (isMtSmsPollingThrottled) { + plogd("allowMtSmsPolling: polling is throttled"); + return false; + } + + if (!isAligned) { + plogd("allowMtSmsPolling: not aligned"); + return false; + } + if (!isModemStateConnectedOrTransferring && !allowCheckMessageInNotConnected()) { - plogd("EVENT_MT_SMS_POLLING_THROTTLE_TIMED_OUT:" - + " allow_check_message_in_not_connected is disabled"); + plogd("allowMtSmsPolling: not in service and " + + "allow_check_message_in_not_connected is disabled"); return false; } + plogd("allowMtSmsPolling: return true"); return true; } diff --git a/src/java/com/android/internal/telephony/satellite/SatelliteController.java b/src/java/com/android/internal/telephony/satellite/SatelliteController.java index e4cf041e23..a39ba91bda 100644 --- a/src/java/com/android/internal/telephony/satellite/SatelliteController.java +++ b/src/java/com/android/internal/telephony/satellite/SatelliteController.java @@ -1307,7 +1307,8 @@ public class SatelliteController extends Handler { } } - private static final class SatelliteControllerHandlerRequest { + @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE) + public static final class SatelliteControllerHandlerRequest { /** The argument to use for the request */ public @NonNull Object argument; /** The caller needs to specify the phone to be used for the request */ @@ -1315,7 +1316,7 @@ public class SatelliteController extends Handler { /** The result of the request that is run on the main thread */ public @Nullable Object result; - SatelliteControllerHandlerRequest(Object argument, Phone phone) { + public SatelliteControllerHandlerRequest(Object argument, Phone phone) { this.argument = argument; this.phone = phone; } @@ -2302,7 +2303,7 @@ public class SatelliteController extends Handler { int subId = (int) ar.userObj; int error = SatelliteServiceUtils.getSatelliteError( ar, "isSatelliteEnabledForCarrier"); - boolean satelliteEnabled = (boolean) ar.result; + boolean satelliteEnabled = (Boolean) ar.result; plogd("EVENT_GET_SATELLITE_ENABLED_FOR_CARRIER_DONE: subId=" + subId + " error=" + error + " satelliteEnabled=" + satelliteEnabled); @@ -6129,7 +6130,8 @@ public class SatelliteController extends Handler { * @param subId subscription ID * @return {@code true} if satellite modem is enabled, {@code false} otherwise. */ - private boolean isSatelliteEnabledForCarrierAtModem(int subId) { + @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE) + public boolean isSatelliteEnabledForCarrierAtModem(int subId) { synchronized (mIsSatelliteEnabledLock) { return mIsSatelliteAttachEnabledForCarrierArrayPerSub.getOrDefault(subId, false); } @@ -7925,14 +7927,37 @@ public class SatelliteController extends Handler { } if(carrierTagIds == null) { - plogd("isSatelliteAvailableAtCurrentLocation: tagids for carrier satellite enabled " + - "are not available"); - return false; + String satelliteAccessConfigFile = + getSatelliteAccessConfigurationFileFromOverlayConfig(); + if (TextUtils.isEmpty(satelliteAccessConfigFile)) { + plogd("isSatelliteAvailableAtCurrentLocation: device does not support" + + " custom satellite access configuration per location"); + return true; + } else { + plogd("isSatelliteAvailableAtCurrentLocation: tagids for carrier " + + info.getCarrierName() + ", subId=" + info.getSubscriptionId() + + " are not available"); + return false; + } } return isCarrierSatelliteAvailableAtCurrentLocation(carrierTagIds); } + @Nullable + private String getSatelliteAccessConfigurationFileFromOverlayConfig() { + String satelliteAccessConfigFile = null; + try { + satelliteAccessConfigFile = mContext.getResources().getString( + com.android.internal.R.string.satellite_access_config_file); + } catch (Resources.NotFoundException ex) { + loge("getSatelliteAccessConfigurationFileFromOverlayConfig: got ex=" + ex); + } + + logd("satelliteAccessConfigFile =" + satelliteAccessConfigFile); + return satelliteAccessConfigFile; + } + /** * Compares tagIds and determine if * carrier satellite is available at current location while selecting highest priority profile. diff --git a/src/java/com/android/internal/telephony/satellite/SatelliteModemInterface.java b/src/java/com/android/internal/telephony/satellite/SatelliteModemInterface.java index 2ebd258a1b..9e5d9de20b 100644 --- a/src/java/com/android/internal/telephony/satellite/SatelliteModemInterface.java +++ b/src/java/com/android/internal/telephony/satellite/SatelliteModemInterface.java @@ -1160,13 +1160,9 @@ public class SatelliteModemInterface { }, new IBooleanConsumer.Stub() { @Override public void accept(boolean result) { - // Convert for compatibility with SatelliteResponse - // TODO: This should just report result instead. - int[] enabled = new int[] {result ? 1 : 0}; - plogd("requestIsSatelliteEnabledForCarrier: " - + Arrays.toString(enabled)); + plogd("requestIsSatelliteEnabledForCarrier: " + result); Binder.withCleanCallingIdentity(() -> sendMessageWithResult( - message, enabled, + message, result, SatelliteManager.SATELLITE_RESULT_SUCCESS)); } }); |