Class ShadowCompanionDeviceManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Set<org.robolectric.shadows.ShadowCompanionDeviceManager.RoboAssociationInfo>protected final Set<ComponentName>protected CompanionDeviceManager.Callbackprotected AssociationRequestprotected Stringprotected ComponentNameprotected MacAddress -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddAssociation(String newAssociation) protected voidassociate(AssociationRequest request, CompanionDeviceManager.Callback callback, Handler handler) protected voidassociate(AssociationRequest request, Executor executor, CompanionDeviceManager.Callback callback) protected voidassociate(String packageName, MacAddress macAddress, byte[] certificate) protected voiddisassociate(int associationId) protected voiddisassociate(String deviceMacAddress) This method will return the lastCompanionDeviceManager.Callbackpassed toCompanionDeviceManager#associate(AssociationRequest, CompanionDeviceManager.Callback, Handler)orCompanionDeviceManager#associate(AssociationRequest, Executor, CompanionDeviceManager.Callback, Handler).This method will return the lastAssociationRequestpassed toCompanionDeviceManager#associate(AssociationRequest, CompanionDeviceManager.Callback, Handler)orCompanionDeviceManager#associate(AssociationRequest, Executor, CompanionDeviceManager.Callback, Handler).Returns the last device address passed toCompanionDeviceManager.startObservingDevicePresence(String).If an association is set, this method will return the lastComponentNamepassed toCompanionDeviceManager#requestNotificationAccess(ComponentName).Returns the lastMacAddresspassed to systemApiassociate.protected List<AssociationInfo>protected booleanhasNotificationAccess(ComponentName component) protected voidrequestNotificationAccess(ComponentName component) voidsetNotificationAccess(ComponentName component, boolean hasAccess) protected voidstartObservingDevicePresence(String deviceAddress)
-
Field Details
-
associations
protected final Set<org.robolectric.shadows.ShadowCompanionDeviceManager.RoboAssociationInfo> associations -
hasNotificationAccess
-
lastRequestedNotificationAccess
-
lastAssociationRequest
-
lastSystemApiAssociationMacAddress
-
lastAssociationCallback
-
lastObservingDevicePresenceDeviceAddress
-
-
Constructor Details
-
ShadowCompanionDeviceManager
public ShadowCompanionDeviceManager()
-
-
Method Details
-
getAssociations
-
addAssociation
-
addAssociation
-
disassociate
-
disassociate
-
hasNotificationAccess
-
setNotificationAccess
-
requestNotificationAccess
-
associate
@Implementation protected void associate(AssociationRequest request, CompanionDeviceManager.Callback callback, Handler handler) -
associate
@Implementation(minSdk=33) protected void associate(AssociationRequest request, Executor executor, CompanionDeviceManager.Callback callback) -
associate
@Implementation(minSdk=33) protected void associate(String packageName, MacAddress macAddress, byte[] certificate) -
startObservingDevicePresence
-
getLastAssociationRequest
This method will return the lastAssociationRequestpassed toCompanionDeviceManager#associate(AssociationRequest, CompanionDeviceManager.Callback, Handler)orCompanionDeviceManager#associate(AssociationRequest, Executor, CompanionDeviceManager.Callback, Handler).Note that the value returned is only changed when calling
associateand will be set if that method throws an exception. Moreover, this value will unchanged if disassociate is called. -
getLastAssociationCallback
This method will return the lastCompanionDeviceManager.Callbackpassed toCompanionDeviceManager#associate(AssociationRequest, CompanionDeviceManager.Callback, Handler)orCompanionDeviceManager#associate(AssociationRequest, Executor, CompanionDeviceManager.Callback, Handler).Note that the value returned is only changed when calling
associateand will be set if that method throws an exception. Moreover, this value will unchanged if disassociate is called. -
getLastRequestedNotificationAccess
If an association is set, this method will return the lastComponentNamepassed toCompanionDeviceManager#requestNotificationAccess(ComponentName). -
getLastSystemApiAssociationMacAddress
Returns the lastMacAddresspassed to systemApiassociate.Note that the value returned is only changed when calling
associateand will be set if that method throws an exception. Moreover, this value will unchanged if disassociate is called. -
getLastObservingDevicePresenceDeviceAddress
Returns the last device address passed toCompanionDeviceManager.startObservingDevicePresence(String).Note that the value returned is only changed when calling
CompanionDeviceManager.startObservingDevicePresence(String)and will still be set in the event that this method throws an exception. Moreover, this value will unchanged if disassociate is called. -
getMyAssociations
-