目录

IVirtualizationCallback

Interface Info

public interface IVirtualizationCallback

Event listening callback.

Constant Summary

Type

Constant Field

Description

int

DeviceEvent.CONNECT

Connected.

int

DeviceEvent.DISCONNECT

Disconnected.

int

DeviceEvent. REQUEST_CONNECTION

The device requests connection. Call acceptConnection to accept the request or disconnectDevice to reject.

int

DeviceEvent. START_PROJECTION

The projection channel is ready. The app needs to display the surface and call startProjection.

int

DeviceEvent. STOP_PROJECTION

Projection stopped. The app needs to cancel surface display.

Public Method Summary

Class

Method

abstract void

onDeviceChange(String deviceName, intstate)

Called upon communication connection event with the phone. The remote device ID and event type are carried in the event callback.

abstract void

onPinCode(String deviceName, int state)

Notifies the app to display or stop displaying the PIN.

long

getSecureFileSize(String fileName)

Obtains the size of the authentication file, in bytes.

byte[]

readSecureFile(String fileName)

Obtains authentication information.

boolean

writeSecureFile(String fileName, byte[] data)

Stores the authentication information securely. The value true indicates success, and false indicates failure.

Public Methods

[h2]onDeviceChange(String deviceName, intstate)

Method

public abstract void onDeviceChange(String deviceName, intstate)

Called upon communication connection event with the phone. The remote device ID and event type are carried in the event callback.

Parameters

Name

Description

deviceName

Remote device name.

state

For details, see the value of Constant SummaryEVENT_DEVICE.

[h2]onPinCode(String deviceName, int state)

Method

public abstract void onPinCode(String deviceName, int state)

Notifies the app to display or stop displaying the PIN.

Parameters

Name

Description

deviceName

Remote device name.

pinCode

PIN generated for device authentication. If the value is an empty string, the pinCode display can be canceled.

[h2]getSecureFileSize(String fileName)

Method

public abstract long getSecureFileSize(String fileName)

Obtains the size of the authentication file, in bytes.

Parameters

Name

Description

fileName

Name of the file that stores authentication information.

[h2]readSecureFile(String fileName)

Method

public abstract byte[] readSecureFile(String fileName)

Obtains authentication information.

Parameters

Name

Description

fileName

Name of the file that stores authentication information.

[h2]writeSecureFile(String fileName, byte[] data)

Method

public abstract boolean writeSecureFile(String fileName, byte[] data)

Stores the authentication information securely. The value true indicates success, and false indicates failure.

Parameters

Name

Description

fileName

Name of the file that stores authentication information.

data

Information to be stored.