Package org.robolectric.shadows
Class ShadowContextHubManager
java.lang.Object
org.robolectric.shadows.ShadowContextHubManager
@Implements(value=android.hardware.location.ContextHubManager.class,
minSdk=24,
isInAndroidSdk=false)
public class ShadowContextHubManager
extends Object
Shadow for
ContextHubManager
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addNanoApp
(android.hardware.location.ContextHubInfo info, int nanoAppUid, long nanoAppId, int nanoAppVersion) Adds a nanoApp to the list of nanoApps that are supported by the provided contexthubinfo.void
broadcastClientAuthorizationChanged
(long nanoAppId, int authorization) void
broadcastMessageFromNanoApp
(Object message) void
broadcastNanoAppAborted
(long nanoAppId, int abortCode) void
broadcastNanoAppDisabled
(long nanoAppId) void
broadcastNanoAppEnabled
(long nanoAppId) void
broadcastNanoAppLoaded
(long nanoAppId) void
broadcastNanoAppUnloaded
(long nanoAppId) static void
protected Object
createClient
(Object contextHubInfo, Object callback) protected Object
createClient
(Object contextHubInfo, Object callback, Executor executor) protected Object
createClient
(Object contextHubInfo, PendingIntent pendingIntent, long nanoAppId) protected Object
createClient
(Context context, Object contextHubInfo, Executor executor, Object callback) protected Object
createClient
(Context context, android.hardware.location.ContextHubInfo contextHubInfo, PendingIntent pendingIntent, long nanoAppId) android.hardware.location.NanoAppInstanceInfo
createInstanceInfo
(android.hardware.location.ContextHubInfo info, int nanoAppUid, long nanoAppId, int nanoAppVersion) Creates and returns aNanoAppInstanceInfo
.List<android.hardware.location.ContextHubClient>
getClientsWithAttributionTag
(String attributionTag) List<android.hardware.location.ContextHubClient>
protected int[]
Provides an array of fake handles.protected android.hardware.location.ContextHubInfo
getContextHubInfo
(int hubHandle) protected List<android.hardware.location.ContextHubInfo>
Provides a list with fakeContextHubInfo
s.protected android.hardware.location.NanoAppInstanceInfo
getNanoAppInstanceInfo
(int nanoAppHandle) boolean
nanoAppIsLoaded
(long nanoAppId) Returns true if the nanoapp is loaded.protected Object
queryNanoApps
(android.hardware.location.ContextHubInfo contextHubInfo) void
protected Object
unloadNanoApp
(android.hardware.location.ContextHubInfo contextHubInfo, long nanoAppId)
-
Constructor Details
-
ShadowContextHubManager
public ShadowContextHubManager()
-
-
Method Details
-
addNanoApp
public void addNanoApp(android.hardware.location.ContextHubInfo info, int nanoAppUid, long nanoAppId, int nanoAppVersion) Adds a nanoApp to the list of nanoApps that are supported by the provided contexthubinfo. -
createInstanceInfo
public android.hardware.location.NanoAppInstanceInfo createInstanceInfo(android.hardware.location.ContextHubInfo info, int nanoAppUid, long nanoAppId, int nanoAppVersion) Creates and returns aNanoAppInstanceInfo
. -
getContextHubs
@Implementation(minSdk=28) @HiddenApi protected List<android.hardware.location.ContextHubInfo> getContextHubs()Provides a list with fakeContextHubInfo
s.ContextHubInfo
describes an optional physical chip on the device. This does not exist in test; this implementation allows to avoid possible NPEs. -
createClient
@Implementation(minSdk=28) @HiddenApi protected Object createClient(Object contextHubInfo, Object callback) -
createClient
@Implementation(minSdk=28) @HiddenApi protected Object createClient(Object contextHubInfo, Object callback, Executor executor) -
createClient
@Implementation(minSdk=29) @HiddenApi protected Object createClient(Object contextHubInfo, PendingIntent pendingIntent, long nanoAppId) -
createClient
@Implementation(minSdk=31) @HiddenApi protected Object createClient(Context context, Object contextHubInfo, Executor executor, Object callback) -
createClient
@Implementation(minSdk=31) @HiddenApi protected Object createClient(Context context, android.hardware.location.ContextHubInfo contextHubInfo, PendingIntent pendingIntent, long nanoAppId) -
unloadNanoApp
@Implementation(minSdk=31) @HiddenApi protected Object unloadNanoApp(android.hardware.location.ContextHubInfo contextHubInfo, long nanoAppId) -
getClientsWithAttributionTag
-
getContextHubClientWithPendingIntentList
@Nullable public List<android.hardware.location.ContextHubClient> getContextHubClientWithPendingIntentList() -
resetContextHub
public void resetContextHub() -
broadcastMessageFromNanoApp
-
broadcastNanoAppAborted
public void broadcastNanoAppAborted(long nanoAppId, int abortCode) -
broadcastNanoAppLoaded
public void broadcastNanoAppLoaded(long nanoAppId) -
broadcastNanoAppUnloaded
public void broadcastNanoAppUnloaded(long nanoAppId) -
broadcastNanoAppEnabled
public void broadcastNanoAppEnabled(long nanoAppId) -
broadcastNanoAppDisabled
public void broadcastNanoAppDisabled(long nanoAppId) -
broadcastClientAuthorizationChanged
public void broadcastClientAuthorizationChanged(long nanoAppId, int authorization) -
nanoAppIsLoaded
public boolean nanoAppIsLoaded(long nanoAppId) Returns true if the nanoapp is loaded. -
clearContextHubClientWithPendingIntentList
-
queryNanoApps
@Implementation(minSdk=28) @HiddenApi protected Object queryNanoApps(android.hardware.location.ContextHubInfo contextHubInfo) -
getContextHubHandles
Provides an array of fake handles.These describe an optional physical chip on the device which does not exist during testing. This implementation enables testing of classes that utilize these APIs.
-
getContextHubInfo
@Implementation @HiddenApi protected android.hardware.location.ContextHubInfo getContextHubInfo(int hubHandle) -
getNanoAppInstanceInfo
@Implementation @HiddenApi protected android.hardware.location.NanoAppInstanceInfo getNanoAppInstanceInfo(int nanoAppHandle)
-