Package org.robolectric.shadows
Class ShadowTimeManager
java.lang.Object
org.robolectric.shadows.ShadowTimeManager
@Implements(value=android.app.time.TimeManager.class,
minSdk=31,
isInAndroidSdk=false)
public class ShadowTimeManager
extends Object
Shadow for internal Android
TimeManager class introduced in S.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddTimeZoneDetectorListener(Executor executor, TimeManager.TimeZoneDetectorListener listener) protected booleanconfirmTime(Object unixEpochTime) protected booleanconfirmTimeZone(String timeZoneId) protected TimeZoneReturns the last time passed toconfirmTime(java.lang.Object).Returns the last time zone ID passed toconfirmTimeZone(java.lang.String).Returns the last time suggestion passed tosuggestExternalTime(android.app.time.ExternalTimeSuggestion).Returns the last time passed tosetManualTime(java.lang.Object).Returns the last time zone ID passed tosetManualTimeZone(java.lang.String).protected ObjectReturns the lastTimeConfigurationset viaupdateTimeConfiguration(android.app.time.TimeConfiguration).protected Objectprotected TimeZoneCapabilitiesAndConfigprotected Objectprotected voidstatic voidreset()final voidsetCapabilityState(String capability, int value) Deprecated.voidsetHomeTimeZone(TimeZone timeZone) protected booleansetManualTime(Object unixEpochTime) protected booleansetManualTimeZone(String timeZoneId) voidsetTimeCapabilityState(String capability, int value) Sets the state of a specific Time capability.voidsetTimeState(Object state) Sets thereturned byinvalid reference
TimeStategetTimeState().voidsetTimeZoneCapabilityState(String capability, int value) Sets the state of a specific Time Zone capability.voidsetTimeZoneState(Object state) Sets thereturned byinvalid reference
TimeZoneStategetTimeZoneState().protected voidsuggestExternalTime(ExternalTimeSuggestion timeSuggestion) voidSimulates triggering all registeredTimeManager.TimeZoneDetectorListeners.protected booleanupdateTimeConfiguration(TimeConfiguration configuration) protected booleanupdateTimeZoneConfiguration(TimeZoneConfiguration configuration)
-
Field Details
-
CONFIGURE_AUTO_DETECTION_ENABLED_CAPABILITY
- See Also:
-
CONFIGURE_GEO_DETECTION_CAPABILITY
- See Also:
-
SET_MANUAL_TIME_ZONE_CAPABILITY
- See Also:
-
SUGGEST_MANUAL_TIME_ZONE_CAPABILITY
- See Also:
-
CONFIGURE_NOTIFICATIONS_ENABLED_CAPABILITY
- See Also:
-
CONFIGURE_TIME_ZONE_OFFSET_CHANGE_NOTIFICATIONS_ENABLED_CAPABILITY
- See Also:
-
CONFIGURE_TIME_AUTO_DETECTION_ENABLED_CAPABILITY
- See Also:
-
SET_MANUAL_TIME_CAPABILITY
- See Also:
-
-
Constructor Details
-
ShadowTimeManager
public ShadowTimeManager()
-
-
Method Details
-
getTimeConfiguration
Returns the lastTimeConfigurationset viaupdateTimeConfiguration(android.app.time.TimeConfiguration). -
setTimeState
Sets thereturned byinvalid reference
TimeStategetTimeState(). -
setTimeZoneState
Sets thereturned byinvalid reference
TimeZoneStategetTimeZoneState(). -
setTimeZoneCapabilityState
Sets the state of a specific Time Zone capability.Capabilities are predefined and not controlled by the user via TimeManager API, so this method allows tests to simulate different capability states.
-
setCapabilityState
@Deprecated @InlineMe(replacement="this.setTimeZoneCapabilityState(capability, value)") public final void setCapabilityState(String capability, int value) Deprecated. -
setTimeCapabilityState
Sets the state of a specific Time capability.Capabilities are predefined and not controlled by the user via TimeManager API, so this method allows tests to simulate different capability states.
-
getTimeZoneCapabilitiesAndConfig
@Implementation protected TimeZoneCapabilitiesAndConfig getTimeZoneCapabilitiesAndConfig() throws ClassNotFoundException- Throws:
ClassNotFoundException
-
getTimeCapabilitiesAndConfig
- Throws:
ClassNotFoundException
-
updateTimeConfiguration
-
updateTimeZoneConfiguration
-
addTimeZoneDetectorListener
@Implementation protected void addTimeZoneDetectorListener(Executor executor, TimeManager.TimeZoneDetectorListener listener) -
removeTimeZoneDetectorListener
@Implementation protected void removeTimeZoneDetectorListener(TimeManager.TimeZoneDetectorListener listener) -
suggestExternalTime
-
getTimeState
-
confirmTime
-
setManualTime
-
getTimeZoneState
-
confirmTimeZone
-
getHomeTimeZone
-
setHomeTimeZone
-
setManualTimeZone
-
getLastExternalTimeSuggestion
Returns the last time suggestion passed tosuggestExternalTime(android.app.time.ExternalTimeSuggestion). -
getLastConfirmedTime
Returns the last time passed toconfirmTime(java.lang.Object). -
getLastManualTime
Returns the last time passed tosetManualTime(java.lang.Object). -
getLastConfirmedTimeZone
Returns the last time zone ID passed toconfirmTimeZone(java.lang.String). -
getLastManualTimeZone
Returns the last time zone ID passed tosetManualTimeZone(java.lang.String). -
triggerTimeZoneDetectorListeners
public void triggerTimeZoneDetectorListeners()Simulates triggering all registeredTimeManager.TimeZoneDetectorListeners. -
reset
-
setTimeZoneCapabilityState(String, int).