Class ShadowSatelliteManager
java.lang.Object
org.robolectric.shadows.ShadowSatelliteManager
@Implements(value=SatelliteManager.class,
minSdk=35,
isInAndroidSdk=false)
public class ShadowSatelliteManager
extends Object
Shadow for
SatelliteManager system service.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAttachRestrictionReasonsForCarrier(int carrierId) protected static com.android.internal.telephony.ITelephonyReturns an immutable set of all currently registeredSatelliteStateChangeListeners.protected intregisterForSupportedStateChanged(Executor executor, Consumer<Boolean> callback) protected voidregisterStateChangeListener(Executor executor, SatelliteStateChangeListener listener) Registers aSatelliteStateChangeListenerto be notified of satellite state changes.protected voidrequestIsCommunicationAllowedForCurrentLocation(Executor executor, OutcomeReceiver<Boolean, SatelliteManager.SatelliteException> callback) protected voidrequestIsSupported(Executor executor, OutcomeReceiver<Boolean, SatelliteManager.SatelliteException> callback) protected voidrequestSatelliteSubscriberProvisionStatus(Executor executor, OutcomeReceiver<List<SatelliteSubscriberProvisionStatus>, SatelliteManager.SatelliteException> callback) static voidreset()voidsetAttachRestrictionReasonsForCarrier(int carrierId, Set<Integer> reasons) Test helper: set attach restriction reasons for a carrier.voidsetEnabledState(boolean isEnabled) Changes the current satellite state and triggers registered listeners (registerStateChangeListener(Executor, SatelliteStateChangeListener)), and caches the state to immediately notify any subsequently registered listeners.voidsetIsCommunicationAllowedForCurrentLocation(boolean newValue, SatelliteManager.SatelliteException error) Sets the result ofSatelliteManager.requestIsCommunicationAllowedForCurrentLocation(Executor, OutcomeReceiver)calls.voidsetIsSupportedResponse(boolean newValue, SatelliteManager.SatelliteException error) Sets the result ofSatelliteManager.requestIsSupported(Executor, OutcomeReceiver)calls.voidsetRegistrationSatelliteResult(int result) Sets the result ofSatelliteManager.registerForModemStateChanged(Executor, SatelliteModemStateCallback)calls.voidTest helper: set satellite data optimized apps list.voidsetSatelliteSubscriberProvisionStatus(List<SatelliteSubscriberProvisionStatus> status, SatelliteManager.SatelliteException error) Test helper: set the provision status that will be returned by requests.voidtriggerOnSupportedStateChanged(boolean isSupported) Triggers the callback for satellite supported state changes.voidtriggerSatelliteModemStateChange(int state) Updates the current state of the satellite modem, and notifies all listeners.protected voidunregisterForSupportedStateChanged(Consumer<Boolean> callback) protected void
-
Constructor Details
-
ShadowSatelliteManager
public ShadowSatelliteManager()
-
-
Method Details
-
setSatelliteSubscriberProvisionStatus
public void setSatelliteSubscriberProvisionStatus(List<SatelliteSubscriberProvisionStatus> status, SatelliteManager.SatelliteException error) Test helper: set the provision status that will be returned by requests. -
setAttachRestrictionReasonsForCarrier
-
setSatelliteDataOptimizedApps
-
triggerSatelliteModemStateChange
Updates the current state of the satellite modem, and notifies all listeners.- Throws:
RemoteException
-
setRegistrationSatelliteResult
public void setRegistrationSatelliteResult(int result) Sets the result ofSatelliteManager.registerForModemStateChanged(Executor, SatelliteModemStateCallback)calls. -
setIsSupportedResponse
Sets the result ofSatelliteManager.requestIsSupported(Executor, OutcomeReceiver)calls.Accepts both the boolean result indicating whether satellite is supported or not, and an optional error which will be returned instead, when non-null.
-
requestIsSupported
@Implementation(minSdk=35) protected void requestIsSupported(Executor executor, OutcomeReceiver<Boolean, SatelliteManager.SatelliteException> callback) -
setIsCommunicationAllowedForCurrentLocation
public void setIsCommunicationAllowedForCurrentLocation(boolean newValue, SatelliteManager.SatelliteException error) Sets the result ofSatelliteManager.requestIsCommunicationAllowedForCurrentLocation(Executor, OutcomeReceiver)calls.Accepts both the boolean result indicating whether satellite is allowed or not, and an optional error which will be returned instead, when non-null.
-
requestIsCommunicationAllowedForCurrentLocation
@Implementation(minSdk=35) protected void requestIsCommunicationAllowedForCurrentLocation(Executor executor, OutcomeReceiver<Boolean, SatelliteManager.SatelliteException> callback) -
getITelephony
-
registerForSupportedStateChanged
@Implementation(minSdk=36) @CanIgnoreReturnValue protected int registerForSupportedStateChanged(Executor executor, Consumer<Boolean> callback) -
unregisterForSupportedStateChanged
@Implementation(minSdk=36) protected void unregisterForSupportedStateChanged(Consumer<Boolean> callback) -
triggerOnSupportedStateChanged
public void triggerOnSupportedStateChanged(boolean isSupported) Triggers the callback for satellite supported state changes. -
registerStateChangeListener
@Implementation(minSdk=36) protected void registerStateChangeListener(Executor executor, SatelliteStateChangeListener listener) Registers aSatelliteStateChangeListenerto be notified of satellite state changes.Tests can mutate state via
setEnabledState(boolean). If state has already been set at least once, this function also immediately dispatches a callback with that sticky value. -
unregisterStateChangeListener
@Implementation(minSdk=36) protected void unregisterStateChangeListener(SatelliteStateChangeListener listener) -
setEnabledState
public void setEnabledState(boolean isEnabled) Changes the current satellite state and triggers registered listeners (registerStateChangeListener(Executor, SatelliteStateChangeListener)), and caches the state to immediately notify any subsequently registered listeners. -
getStateChangeListeners
Returns an immutable set of all currently registeredSatelliteStateChangeListeners. -
requestSatelliteSubscriberProvisionStatus
@Implementation(minSdk=36) protected void requestSatelliteSubscriberProvisionStatus(Executor executor, OutcomeReceiver<List<SatelliteSubscriberProvisionStatus>, SatelliteManager.SatelliteException> callback) -
getAttachRestrictionReasonsForCarrier
@Implementation(minSdk=36) protected Set<Integer> getAttachRestrictionReasonsForCarrier(int carrierId) -
getSatelliteDataOptimizedApps
-
reset
-