Package org.robolectric.shadows
Class ShadowAmbientContextManager
java.lang.Object
org.robolectric.shadows.ShadowAmbientContextManager
@Implements(value=android.app.ambientcontext.AmbientContextManager.class,
minSdk=33,
isInAndroidSdk=false)
public class ShadowAmbientContextManager
extends Object
Shadow of
AmbientContextManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionandroid.app.ambientcontext.AmbientContextEventRequest
Returns the lastAmbientContextEventRequest
passed intoAmbientContextManager.registerObserver(AmbientContextEventRequest, PendingIntent, Executor, Consumer)
.Returns the last requested event codes that were passed intostartConsentActivity(Set)
.protected void
queryAmbientContextServiceStatus
(Set<Integer> eventTypes, Executor executor, Consumer<Integer> consumer) protected void
registerObserver
(android.app.ambientcontext.AmbientContextEventRequest request, PendingIntent resultPendingIntent, Executor executor, Consumer<Integer> statusConsumer) void
Sets astatus
that will be consumed by theconsumer
which is passed inqueryAmbientContextServiceStatus(Set, Executor, Consumer)
orregisterObserver(AmbientContextEventRequest, PendingIntent, Executor, Consumer)
.protected void
startConsentActivity
(Set<Integer> eventTypes) protected void
-
Constructor Details
-
ShadowAmbientContextManager
public ShadowAmbientContextManager()
-
-
Method Details
-
registerObserver
@Implementation protected void registerObserver(android.app.ambientcontext.AmbientContextEventRequest request, PendingIntent resultPendingIntent, Executor executor, Consumer<Integer> statusConsumer) -
unregisterObserver
-
getLastRegisterObserverRequest
@Nullable public android.app.ambientcontext.AmbientContextEventRequest getLastRegisterObserverRequest()Returns the lastAmbientContextEventRequest
passed intoAmbientContextManager.registerObserver(AmbientContextEventRequest, PendingIntent, Executor, Consumer)
.Returns null if
AmbientContextManager.unregisterObserver()
is invoked or there is no invocation ofAmbientContextManager.registerObserver(AmbientContextEventRequest, PendingIntent, Executor, Consumer)
. -
queryAmbientContextServiceStatus
-
setAmbientContextServiceStatus
Sets astatus
that will be consumed by theconsumer
which is passed inqueryAmbientContextServiceStatus(Set, Executor, Consumer)
orregisterObserver(AmbientContextEventRequest, PendingIntent, Executor, Consumer)
. -
startConsentActivity
-
getLastRequestedEventCodesForConsentActivity
Returns the last requested event codes that were passed intostartConsentActivity(Set)
.If
startConsentActivity(Set)
is never invoked, returnsnull
.
-