Loading src/java/com/android/internal/telephony/RIL.java +3 −3 Original line number Diff line number Diff line Loading @@ -5345,7 +5345,7 @@ public class RIL extends BaseCommands implements CommandsInterface { public void setSatellitePlmn(int simSlot, @NonNull List<String> carrierPlmnList, @NonNull List<String> allSatellitePlmnList, Message result) { RadioNetworkProxy networkProxy = getRadioServiceProxy(RadioNetworkProxy.class); if (getHalVersion(HAL_SERVICE_NETWORK).less(RADIO_HAL_VERSION_2_4)) { if (getHalVersion(HAL_SERVICE_NETWORK).less(RADIO_HAL_VERSION_2_3)) { riljLog("setSatellitePlmn: SatelliteModemInterface is used."); SatelliteModemInterface.getInstance().setSatellitePlmn( simSlot, carrierPlmnList, allSatellitePlmnList, result); Loading Loading @@ -5378,7 +5378,7 @@ public class RIL extends BaseCommands implements CommandsInterface { public void setSatelliteEnabledForCarrier(int simSlot, boolean satelliteEnabled, Message result) { RadioNetworkProxy networkProxy = getRadioServiceProxy(RadioNetworkProxy.class); if (getHalVersion(HAL_SERVICE_NETWORK).less(RADIO_HAL_VERSION_2_4)) { if (getHalVersion(HAL_SERVICE_NETWORK).less(RADIO_HAL_VERSION_2_3)) { riljLog("setSatelliteEnabledForCarrier: SatelliteModemInterface is used."); SatelliteModemInterface.getInstance().requestSetSatelliteEnabledForCarrier( simSlot, satelliteEnabled, result); Loading Loading @@ -5408,7 +5408,7 @@ public class RIL extends BaseCommands implements CommandsInterface { @Override public void isSatelliteEnabledForCarrier(int simSlot, Message result) { RadioNetworkProxy networkProxy = getRadioServiceProxy(RadioNetworkProxy.class); if (getHalVersion(HAL_SERVICE_NETWORK).less(RADIO_HAL_VERSION_2_4)) { if (getHalVersion(HAL_SERVICE_NETWORK).less(RADIO_HAL_VERSION_2_3)) { riljLog("isSatelliteEnabledForCarrier: SatelliteModemInterface is used."); SatelliteModemInterface.getInstance().requestIsSatelliteEnabledForCarrier( simSlot, result); Loading src/java/com/android/internal/telephony/satellite/SatelliteController.java +13 −22 Original line number Diff line number Diff line Loading @@ -5813,12 +5813,6 @@ public class SatelliteController extends Handler { + "SetSatelliteAttachEnableForCarrier error code =" + errorCode); } if (!isSatelliteSupportedViaCarrier(subId)) { plogd("Satellite for carrier is not supported. Only user setting is stored"); callback.accept(SATELLITE_RESULT_SUCCESS); return; } Phone phone = SatelliteServiceUtils.getPhone(subId); if (phone == null) { ploge("evaluateEnablingSatelliteForCarrier: phone is null for subId=" + subId); Loading @@ -5828,9 +5822,9 @@ public class SatelliteController extends Handler { /* Request to enable or disable the satellite in the cellular modem only when the desired state and the current state are different. */ boolean isSatelliteExpectedToBeEnabled = !isSatelliteRestrictedForCarrier(subId); boolean isSatelliteExpectedToBeEnabled = !isSatelliteRestrictedForCarrier(subId) && isSatelliteSupportedViaCarrier(subId); if (isSatelliteExpectedToBeEnabled != isSatelliteEnabledForCarrierAtModem(subId)) { if (mSatelliteModemInterface.isSatelliteServiceSupported()) { int simSlot = SubscriptionManager.getSlotIndex(subId); RequestHandleSatelliteAttachRestrictionForCarrierArgument argument = new RequestHandleSatelliteAttachRestrictionForCarrierArgument(subId, Loading @@ -5842,9 +5836,6 @@ public class SatelliteController extends Handler { EVENT_EVALUATE_SATELLITE_ATTACH_RESTRICTION_CHANGE_DONE, request); phone.setSatelliteEnabledForCarrier(simSlot, isSatelliteExpectedToBeEnabled, onCompleted); } else { callback.accept(SatelliteManager.SATELLITE_RESULT_INVALID_TELEPHONY_STATE); } } else { callback.accept(SATELLITE_RESULT_SUCCESS); } Loading src/java/com/android/internal/telephony/satellite/SatelliteServiceUtils.java +26 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import android.telephony.satellite.stub.SatelliteResult; import android.text.TextUtils; import com.android.internal.R; import com.android.internal.telephony.CommandException; import com.android.internal.telephony.Phone; import com.android.internal.telephony.PhoneFactory; import com.android.internal.telephony.subscription.SubscriptionManagerService; Loading Loading @@ -318,6 +319,10 @@ public class SatelliteServiceUtils { if (ar.exception instanceof SatelliteManager.SatelliteException) { errorCode = ((SatelliteManager.SatelliteException) ar.exception).getErrorCode(); loge(caller + " SatelliteException: " + ar.exception); } else if (ar.exception instanceof CommandException) { errorCode = convertCommandExceptionErrorToSatelliteError( ((CommandException) ar.exception).getCommandError()); loge(caller + " CommandException: " + ar.exception); } else { loge(caller + " unknown exception: " + ar.exception); } Loading @@ -326,6 +331,27 @@ public class SatelliteServiceUtils { return errorCode; } private static int convertCommandExceptionErrorToSatelliteError( CommandException.Error commandExceptionError) { logd("convertCommandExceptionErrorToSatelliteError: commandExceptionError=" + commandExceptionError.toString()); switch(commandExceptionError) { case REQUEST_NOT_SUPPORTED: return SatelliteManager.SATELLITE_RESULT_REQUEST_NOT_SUPPORTED; case RADIO_NOT_AVAILABLE: return SatelliteManager.SATELLITE_RESULT_RADIO_NOT_AVAILABLE; case INTERNAL_ERR: case INVALID_STATE: case INVALID_MODEM_STATE: return SatelliteManager.SATELLITE_RESULT_INVALID_MODEM_STATE; case MODEM_ERR: return SatelliteManager.SATELLITE_RESULT_MODEM_ERROR; default: return SatelliteManager.SATELLITE_RESULT_ERROR; } } /** * Get valid subscription id for satellite communication. * Loading Loading
src/java/com/android/internal/telephony/RIL.java +3 −3 Original line number Diff line number Diff line Loading @@ -5345,7 +5345,7 @@ public class RIL extends BaseCommands implements CommandsInterface { public void setSatellitePlmn(int simSlot, @NonNull List<String> carrierPlmnList, @NonNull List<String> allSatellitePlmnList, Message result) { RadioNetworkProxy networkProxy = getRadioServiceProxy(RadioNetworkProxy.class); if (getHalVersion(HAL_SERVICE_NETWORK).less(RADIO_HAL_VERSION_2_4)) { if (getHalVersion(HAL_SERVICE_NETWORK).less(RADIO_HAL_VERSION_2_3)) { riljLog("setSatellitePlmn: SatelliteModemInterface is used."); SatelliteModemInterface.getInstance().setSatellitePlmn( simSlot, carrierPlmnList, allSatellitePlmnList, result); Loading Loading @@ -5378,7 +5378,7 @@ public class RIL extends BaseCommands implements CommandsInterface { public void setSatelliteEnabledForCarrier(int simSlot, boolean satelliteEnabled, Message result) { RadioNetworkProxy networkProxy = getRadioServiceProxy(RadioNetworkProxy.class); if (getHalVersion(HAL_SERVICE_NETWORK).less(RADIO_HAL_VERSION_2_4)) { if (getHalVersion(HAL_SERVICE_NETWORK).less(RADIO_HAL_VERSION_2_3)) { riljLog("setSatelliteEnabledForCarrier: SatelliteModemInterface is used."); SatelliteModemInterface.getInstance().requestSetSatelliteEnabledForCarrier( simSlot, satelliteEnabled, result); Loading Loading @@ -5408,7 +5408,7 @@ public class RIL extends BaseCommands implements CommandsInterface { @Override public void isSatelliteEnabledForCarrier(int simSlot, Message result) { RadioNetworkProxy networkProxy = getRadioServiceProxy(RadioNetworkProxy.class); if (getHalVersion(HAL_SERVICE_NETWORK).less(RADIO_HAL_VERSION_2_4)) { if (getHalVersion(HAL_SERVICE_NETWORK).less(RADIO_HAL_VERSION_2_3)) { riljLog("isSatelliteEnabledForCarrier: SatelliteModemInterface is used."); SatelliteModemInterface.getInstance().requestIsSatelliteEnabledForCarrier( simSlot, result); Loading
src/java/com/android/internal/telephony/satellite/SatelliteController.java +13 −22 Original line number Diff line number Diff line Loading @@ -5813,12 +5813,6 @@ public class SatelliteController extends Handler { + "SetSatelliteAttachEnableForCarrier error code =" + errorCode); } if (!isSatelliteSupportedViaCarrier(subId)) { plogd("Satellite for carrier is not supported. Only user setting is stored"); callback.accept(SATELLITE_RESULT_SUCCESS); return; } Phone phone = SatelliteServiceUtils.getPhone(subId); if (phone == null) { ploge("evaluateEnablingSatelliteForCarrier: phone is null for subId=" + subId); Loading @@ -5828,9 +5822,9 @@ public class SatelliteController extends Handler { /* Request to enable or disable the satellite in the cellular modem only when the desired state and the current state are different. */ boolean isSatelliteExpectedToBeEnabled = !isSatelliteRestrictedForCarrier(subId); boolean isSatelliteExpectedToBeEnabled = !isSatelliteRestrictedForCarrier(subId) && isSatelliteSupportedViaCarrier(subId); if (isSatelliteExpectedToBeEnabled != isSatelliteEnabledForCarrierAtModem(subId)) { if (mSatelliteModemInterface.isSatelliteServiceSupported()) { int simSlot = SubscriptionManager.getSlotIndex(subId); RequestHandleSatelliteAttachRestrictionForCarrierArgument argument = new RequestHandleSatelliteAttachRestrictionForCarrierArgument(subId, Loading @@ -5842,9 +5836,6 @@ public class SatelliteController extends Handler { EVENT_EVALUATE_SATELLITE_ATTACH_RESTRICTION_CHANGE_DONE, request); phone.setSatelliteEnabledForCarrier(simSlot, isSatelliteExpectedToBeEnabled, onCompleted); } else { callback.accept(SatelliteManager.SATELLITE_RESULT_INVALID_TELEPHONY_STATE); } } else { callback.accept(SATELLITE_RESULT_SUCCESS); } Loading
src/java/com/android/internal/telephony/satellite/SatelliteServiceUtils.java +26 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import android.telephony.satellite.stub.SatelliteResult; import android.text.TextUtils; import com.android.internal.R; import com.android.internal.telephony.CommandException; import com.android.internal.telephony.Phone; import com.android.internal.telephony.PhoneFactory; import com.android.internal.telephony.subscription.SubscriptionManagerService; Loading Loading @@ -318,6 +319,10 @@ public class SatelliteServiceUtils { if (ar.exception instanceof SatelliteManager.SatelliteException) { errorCode = ((SatelliteManager.SatelliteException) ar.exception).getErrorCode(); loge(caller + " SatelliteException: " + ar.exception); } else if (ar.exception instanceof CommandException) { errorCode = convertCommandExceptionErrorToSatelliteError( ((CommandException) ar.exception).getCommandError()); loge(caller + " CommandException: " + ar.exception); } else { loge(caller + " unknown exception: " + ar.exception); } Loading @@ -326,6 +331,27 @@ public class SatelliteServiceUtils { return errorCode; } private static int convertCommandExceptionErrorToSatelliteError( CommandException.Error commandExceptionError) { logd("convertCommandExceptionErrorToSatelliteError: commandExceptionError=" + commandExceptionError.toString()); switch(commandExceptionError) { case REQUEST_NOT_SUPPORTED: return SatelliteManager.SATELLITE_RESULT_REQUEST_NOT_SUPPORTED; case RADIO_NOT_AVAILABLE: return SatelliteManager.SATELLITE_RESULT_RADIO_NOT_AVAILABLE; case INTERNAL_ERR: case INVALID_STATE: case INVALID_MODEM_STATE: return SatelliteManager.SATELLITE_RESULT_INVALID_MODEM_STATE; case MODEM_ERR: return SatelliteManager.SATELLITE_RESULT_MODEM_ERROR; default: return SatelliteManager.SATELLITE_RESULT_ERROR; } } /** * Get valid subscription id for satellite communication. * Loading