virtual

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2026 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Overview

Package virtual provides Go bindings for android.companion.virtual.

Index

Constants

View Source
const (
	Creator = consts.Creator
)

Variables

This section is empty.

Functions

func Init

func Init(env *jni.Env) error

Init resolves all JNI class and method references for this package. It is safe to call multiple times (uses sync.Once internally). Exported for E2E testing on Android.

Types

type Device

type Device struct {
	VM  *jni.VM
	Obj *jni.GlobalRef
}

Device wraps android.companion.virtual.VirtualDevice.

func (*Device) DescribeContents

func (m *Device) DescribeContents() (int32, error)

DescribeContents calls android.companion.virtual.VirtualDevice.describeContents.

func (*Device) GetDeviceId

func (m *Device) GetDeviceId() (int32, error)

GetDeviceId calls android.companion.virtual.VirtualDevice.getDeviceId.

func (*Device) GetDisplayIds

func (m *Device) GetDisplayIds() (*jni.Object, error)

GetDisplayIds calls android.companion.virtual.VirtualDevice.getDisplayIds.

func (*Device) GetDisplayName

func (m *Device) GetDisplayName() (*jni.Object, error)

GetDisplayName calls android.companion.virtual.VirtualDevice.getDisplayName.

func (*Device) GetName

func (m *Device) GetName() (string, error)

GetName calls android.companion.virtual.VirtualDevice.getName.

func (*Device) GetPersistentDeviceId

func (m *Device) GetPersistentDeviceId() (string, error)

GetPersistentDeviceId calls android.companion.virtual.VirtualDevice.getPersistentDeviceId.

func (*Device) HasCustomSensorSupport

func (m *Device) HasCustomSensorSupport() (bool, error)

HasCustomSensorSupport calls android.companion.virtual.VirtualDevice.hasCustomSensorSupport.

func (*Device) ToString

func (m *Device) ToString() (string, error)

ToString calls android.companion.virtual.VirtualDevice.toString.

func (*Device) WriteToParcel

func (m *Device) WriteToParcel(arg0 *jni.Object, arg1 int32) error

WriteToParcel calls android.companion.virtual.VirtualDevice.writeToParcel.

type DeviceManager

type DeviceManager struct {
	VM  *jni.VM
	Ctx *app.Context
	Obj *jni.GlobalRef
}

DeviceManager wraps android.companion.virtual.VirtualDeviceManager.

func NewDeviceManager

func NewDeviceManager(ctx *app.Context) (*DeviceManager, error)

NewDeviceManager obtains android.companion.virtual.VirtualDeviceManager from the Android system service manager.

func (*DeviceManager) Close

func (m *DeviceManager) Close()

Close releases the global reference to the underlying Java object. After Close, the DeviceManager must not be used.

func (*DeviceManager) GetVirtualDevice

func (m *DeviceManager) GetVirtualDevice(arg0 int32) (*jni.Object, error)

GetVirtualDevice calls android.companion.virtual.VirtualDeviceManager.getVirtualDevice.

func (*DeviceManager) RegisterVirtualDeviceListener

func (m *DeviceManager) RegisterVirtualDeviceListener(arg0 *jni.Object, arg1 *jni.Object) error

RegisterVirtualDeviceListener calls android.companion.virtual.VirtualDeviceManager.registerVirtualDeviceListener.

func (*DeviceManager) UnregisterVirtualDeviceListener

func (m *DeviceManager) UnregisterVirtualDeviceListener(arg0 *jni.Object) error

UnregisterVirtualDeviceListener calls android.companion.virtual.VirtualDeviceManager.unregisterVirtualDeviceListener.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL