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: glasses. |
static String |
Device profile: a virtual device capable of rendering content from an Android host to a nearby device. |
static String |
Device profile: watch. |
Inherited constants | |
---|---|
Public methods | |
---|---|
Int | |
Boolean |
Indicates whether some other object is "equal to" this one. |
String? | |
CharSequence? |
The Display name of the device to be shown in the CDM confirmation UI. |
Int |
hashCode() |
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() |
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_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_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"
Public methods
describeContents
fun describeContents(): Int
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
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
x
andy
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any non-null reference values
x
,y
, andz
, ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
. - It is consistent: for any non-null reference values
x
andy
, multiple invocations ofx.equals(y)
consistently returntrue
or consistently returnfalse
, provided no information used inequals
comparisons 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. |
getDeviceProfile
fun getDeviceProfile(): String?
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.
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
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 android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |