Class ShadowCompanionDeviceManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addAssociation
(String newAssociation) protected void
associate
(AssociationRequest request, CompanionDeviceManager.Callback callback, Handler handler) protected void
associate
(AssociationRequest request, Executor executor, CompanionDeviceManager.Callback callback) protected void
associate
(String packageName, MacAddress macAddress, byte[] certificate) protected void
disassociate
(int associationId) protected void
disassociate
(String deviceMacAddress) This method will return the lastCompanionDeviceManager.Callback
passed toCompanionDeviceManager#associate(AssociationRequest, CompanionDeviceManager.Callback, Handler)
orCompanionDeviceManager#associate(AssociationRequest, Executor, CompanionDeviceManager.Callback, Handler)
.This method will return the lastAssociationRequest
passed 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 lastComponentName
passed toCompanionDeviceManager#requestNotificationAccess(ComponentName)
.Returns the lastMacAddress
passed to systemApiassociate
.protected List<AssociationInfo>
protected boolean
hasNotificationAccess
(ComponentName component) protected void
requestNotificationAccess
(ComponentName component) void
setNotificationAccess
(ComponentName component, boolean hasAccess) protected void
startObservingDevicePresence
(String deviceAddress)
-
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 lastAssociationRequest
passed toCompanionDeviceManager#associate(AssociationRequest, CompanionDeviceManager.Callback, Handler)
orCompanionDeviceManager#associate(AssociationRequest, Executor, CompanionDeviceManager.Callback, Handler)
.Note that the value returned is only changed when calling
associate
and 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.Callback
passed toCompanionDeviceManager#associate(AssociationRequest, CompanionDeviceManager.Callback, Handler)
orCompanionDeviceManager#associate(AssociationRequest, Executor, CompanionDeviceManager.Callback, Handler)
.Note that the value returned is only changed when calling
associate
and 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 lastComponentName
passed toCompanionDeviceManager#requestNotificationAccess(ComponentName)
. -
getLastSystemApiAssociationMacAddress
Returns the lastMacAddress
passed to systemApiassociate
.Note that the value returned is only changed when calling
associate
and 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
-