AssociationRequest
class AssociationRequest : Parcelable
| kotlin.Any | |
| ↳ | android.companion.AssociationRequest |
A request for the user to select a companion device to associate with. You can optionally set filters for which devices to show to the user to select from. The exact type and fields of the filter you can set depend on the medium type. See Builder's static factory methods for specific protocols that are supported. You can also set single device to request a popup with single device to be shown instead of a list to choose from
Summary
| Nested classes | |
|---|---|
|
A builder for |
|
| Constants | |
|---|---|
| static String |
Device profile: a virtual display capable of rendering Android applications, and sending back input events. |
| static String |
Device profile: Android Automotive Projection Only applications that have been granted |
| static String |
Device profile: Allows the companion app to access notification, recent photos and media for computer cross-device features. |
| static String |
Device profile: fitness tracker. |
| static String |
Device profile: glasses. |
| static String |
Device profile: A medical device, e. |
| static String |
Device profile: a virtual device capable of rendering content from an Android host to a nearby device. |
| static String |
Device profile: watch. |
| static String |
Permission group to access nearby devices. |
| Inherited constants | |
|---|---|
| Public methods | |
|---|---|
| Int |
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| Boolean |
Indicates whether some other object is "equal to" this one. |
| Icon? |
Get the device icon of the self-managed association request. |
| String? | |
| CharSequence? |
The Display name of the device to be shown in the CDM confirmation UI. |
| MutableSet<String!> |
Gets the extra permissions to request/grant for non-profile device. |
| Boolean |
Indicates whether the application requires the |
| Boolean |
Whether the association is to be managed by the companion application. |
| Boolean |
Whether only a single device should match the provided filter. |
| String |
toString()Returns a string representation of the object. |
| Unit |
writeToParcel(dest: Parcel, flags: Int)Flatten this object in to a Parcel. |
| Properties | |
|---|---|
| static Parcelable.Creator<AssociationRequest!> | |
Constants
DEVICE_PROFILE_APP_STREAMING
static val DEVICE_PROFILE_APP_STREAMING: String
Device profile: a virtual display capable of rendering Android applications, and sending back input events.
Only applications that have been granted android.Manifest.permission#REQUEST_COMPANION_PROFILE_APP_STREAMING are allowed to request to be associated with such devices.
Requires android.Manifest.permission#REQUEST_COMPANION_PROFILE_APP_STREAMING
Value: "android.app.role.COMPANION_DEVICE_APP_STREAMING"DEVICE_PROFILE_AUTOMOTIVE_PROJECTION
static val DEVICE_PROFILE_AUTOMOTIVE_PROJECTION: String
Device profile: Android Automotive Projection Only applications that have been granted android.Manifest.permission#REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION are allowed to request to be associated with such devices.
Requires android.Manifest.permission#REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION
Value: "android.app.role.SYSTEM_AUTOMOTIVE_PROJECTION"DEVICE_PROFILE_COMPUTER
static val DEVICE_PROFILE_COMPUTER: String
Device profile: Allows the companion app to access notification, recent photos and media for computer cross-device features. Only applications that have been granted android.Manifest.permission#REQUEST_COMPANION_PROFILE_COMPUTER are allowed to request to be associated with such devices.
Requires android.Manifest.permission#REQUEST_COMPANION_PROFILE_COMPUTER
Value: "android.app.role.COMPANION_DEVICE_COMPUTER"DEVICE_PROFILE_FITNESS_TRACKER
static val DEVICE_PROFILE_FITNESS_TRACKER: String
Device profile: fitness tracker. If specified, the current request may have a modified UI to highlight that the device being set up is a specific kind of device, and some extra permissions may be granted to the app as a result. Using it requires declaring uses-permission android.Manifest.permission#REQUEST_COMPANION_PROFILE_WATCH in the manifest. Learn more about device profiles.
Requires android.Manifest.permission#REQUEST_COMPANION_PROFILE_WATCH
Value: "android.app.role.COMPANION_DEVICE_FITNESS_TRACKER"DEVICE_PROFILE_GLASSES
static val DEVICE_PROFILE_GLASSES: String
Device profile: glasses. If specified, the current request may have a modified UI to highlight that the device being set up is a glasses device, and some extra permissions may be granted to the app as a result. Using it requires declaring uses-permission android.Manifest.permission#REQUEST_COMPANION_PROFILE_GLASSES in the manifest.
Requires android.Manifest.permission#REQUEST_COMPANION_PROFILE_GLASSES
Value: "android.app.role.COMPANION_DEVICE_GLASSES"DEVICE_PROFILE_MEDICAL
static val DEVICE_PROFILE_MEDICAL: String
Device profile: A medical device, e.g. blood sugar level monitor, heart rate monitor, etc. If specified, the current request may have a modified UI to highlight that the device being set up is a medical device, and some extra permissions may be granted to the app as a result. Using it requires declaring uses-permission android.Manifest.permission#REQUEST_COMPANION_PROFILE_MEDICAL in the manifest.
Requires android.Manifest.permission#REQUEST_COMPANION_PROFILE_MEDICAL
Value: "android.app.role.COMPANION_DEVICE_MEDICAL"DEVICE_PROFILE_NEARBY_DEVICE_STREAMING
static val DEVICE_PROFILE_NEARBY_DEVICE_STREAMING: String
Device profile: a virtual device capable of rendering content from an Android host to a nearby device.
Only applications that have been granted android.Manifest.permission#REQUEST_COMPANION_PROFILE_NEARBY_DEVICE_STREAMING are allowed to request to be associated with such devices.
Requires android.Manifest.permission#REQUEST_COMPANION_PROFILE_NEARBY_DEVICE_STREAMING
Value: "android.app.role.COMPANION_DEVICE_NEARBY_DEVICE_STREAMING"DEVICE_PROFILE_WATCH
static val DEVICE_PROFILE_WATCH: String
Device profile: watch. If specified, the current request may have a modified UI to highlight that the device being set up is a specific kind of device, and some extra permissions may be granted to the app as a result. Using it requires declaring uses-permission android.Manifest.permission#REQUEST_COMPANION_PROFILE_WATCH in the manifest. Learn more about device profiles.
Value: "android.app.role.COMPANION_DEVICE_WATCH"PERMISSION_GROUP_NEARBY
static val PERMISSION_GROUP_NEARBY: String
Permission group to access nearby devices.
Value: "NEARBY_DEVICES"Public methods
describeContents
fun describeContents(): Int
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or
|
equals
fun equals(other: Any?): Boolean
Indicates whether some other object is "equal to" this one.
The equals method implements an equivalence relation on non-null object references:
- It is reflexive: for any non-null reference value
x,x.equals(x)should returntrue. - It is symmetric: for any non-null reference values
xandy,x.equals(y)should returntrueif and only ify.equals(x)returnstrue. - It is transitive: for any non-null reference values
x,y, andz, ifx.equals(y)returnstrueandy.equals(z)returnstrue, thenx.equals(z)should returntrue. - It is consistent: for any non-null reference values
xandy, multiple invocations ofx.equals(y)consistently returntrueor consistently returnfalse, provided no information used inequalscomparisons on the objects is modified. - For any non-null reference value
x,x.equals(null)should returnfalse.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| Parameters | |
|---|---|
obj |
the reference object with which to compare. |
o |
This value may be null. |
| Return | |
|---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getDeviceIcon
fun getDeviceIcon(): Icon?
Get the device icon of the self-managed association request.
| Return | |
|---|---|
Icon? |
the device icon, or null if no device icon has been set. |
getDeviceProfile
fun getDeviceProfile(): String?
| Return | |
|---|---|
String? |
profile of the companion device. This value may be null. Value is one of the following: |
getDisplayName
fun getDisplayName(): CharSequence?
The Display name of the device to be shown in the CDM confirmation UI. Must be non-null for "self-managed" association.
getExtraPermissions
fun getExtraPermissions(): MutableSet<String!>
Gets the extra permissions to request/grant for non-profile device.
| Return | |
|---|---|
MutableSet<String!> |
A set of permission strings. This value cannot be null. |
isForceConfirmation
fun isForceConfirmation(): Boolean
Indicates whether the application requires the CompanionDeviceManager service to collect an explicit confirmation from the user before creating an association, even if such confirmation is not required from the service's perspective.
isSelfManaged
fun isSelfManaged(): Boolean
Whether the association is to be managed by the companion application.
isSingleDevice
fun isSingleDevice(): Boolean
Whether only a single device should match the provided filter. When scanning for a single device with a specific BluetoothDeviceFilter mac address, bonded devices are also searched among. This allows to obtain the necessary app privileges even if the device is already paired.
toString
fun toString(): String
Returns a string representation of the object.
| Return | |
|---|---|
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
dest |
Parcel: This value cannot be null. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of the following:
|