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
Constructors Constructor Description ShadowAmbientContextManager()
-
Method Summary
Modifier and Type Method Description android.app.ambientcontext.AmbientContextEventRequest
getLastRegisterObserverRequest()
Returns the lastAmbientContextEventRequest
passed intoAmbientContextManager.registerObserver(AmbientContextEventRequest, PendingIntent, Executor, Consumer)
.Set<Integer>
getLastRequestedEventCodesForConsentActivity()
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
setAmbientContextServiceStatus(Integer status)
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
unregisterObserver()
-
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
.
-