Address API review comments
Expand javadocs and change return value to NonNull for VirtualDeviceManager.createVirtualDevice. Also removed the redundant @TestApi on the virtual display flag. Bug: 217742182 Test: Existing tests pass Change-Id: I381039e6ebe4f5f5046a35e9a3e266ff7f46c369
This commit is contained in:
@@ -2733,7 +2733,7 @@ package android.companion {
|
||||
package android.companion.virtual {
|
||||
|
||||
public final class VirtualDeviceManager {
|
||||
method @Nullable @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public android.companion.virtual.VirtualDeviceManager.VirtualDevice createVirtualDevice(int, @NonNull android.companion.virtual.VirtualDeviceParams);
|
||||
method @NonNull @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public android.companion.virtual.VirtualDeviceManager.VirtualDevice createVirtualDevice(int, @NonNull android.companion.virtual.VirtualDeviceParams);
|
||||
}
|
||||
|
||||
public static interface VirtualDeviceManager.ActivityListener {
|
||||
|
||||
@@ -1187,7 +1187,6 @@ package android.hardware.display {
|
||||
field public static final int SWITCHING_TYPE_NONE = 0; // 0x0
|
||||
field public static final int SWITCHING_TYPE_WITHIN_GROUPS = 1; // 0x1
|
||||
field public static final int VIRTUAL_DISPLAY_FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS = 512; // 0x200
|
||||
field public static final int VIRTUAL_DISPLAY_FLAG_TRUSTED = 1024; // 0x400
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -82,14 +82,21 @@ public final class VirtualDeviceManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a virtual device.
|
||||
* Creates a virtual device where applications can launch and receive input events injected by
|
||||
* the creator.
|
||||
*
|
||||
* <p>The {@link android.Manifest.permission#CREATE_VIRTUAL_DEVICE} permission is required to
|
||||
* create virtual devices, which is only available to system apps holding specific roles.
|
||||
*
|
||||
* @param associationId The association ID as returned by {@link AssociationInfo#getId()} from
|
||||
* Companion Device Manager. Virtual devices must have a corresponding association with CDM in
|
||||
* order to be created.
|
||||
* @param params The parameters for creating virtual devices. See {@link VirtualDeviceParams}
|
||||
* for the available options.
|
||||
* @return The created virtual device.
|
||||
*/
|
||||
@RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE)
|
||||
@Nullable
|
||||
@NonNull
|
||||
public VirtualDevice createVirtualDevice(
|
||||
int associationId,
|
||||
@NonNull VirtualDeviceParams params) {
|
||||
|
||||
@@ -356,7 +356,6 @@ public final class DisplayManager {
|
||||
* @see #VIRTUAL_DISPLAY_FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
@SystemApi
|
||||
public static final int VIRTUAL_DISPLAY_FLAG_TRUSTED = 1 << 10;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user