How to Block and Capture Power Button Events Using AIDL Interface

From wizarPOS
Revision as of 06:06, 25 June 2023 by Mahong (talk | contribs) (Created page with "The system provides the AIDL interface to block and get the power. When connect the service, the package name is com.wizarpos.wizarviewagentassistant, and the class name is co...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The system provides the AIDL interface to block and get the power. When connect the service, the package name is com.wizarpos.wizarviewagentassistant, and the class name is com.wizarpos.wizarviewagentassistant.SystemExtApiService. When the application uses the interface, it must import wizarviewagentassistant and add permissions to the Android manifest file.

Version of wizarviewagentassistant should equal or larger than 2.10.59. System version, Q2P:S0397, Q2A7:S51099,S0397,Q3V:S1524,Q2:S4957

Permission

The application declares the following permissions in the manifest:

 android.permission.CLOUDPOS_DISABLE_POWER_KEY

API Overview

blockPowerKey

void setPowerKeyBlocked(boolean enable);

Block or release the power button.

Parameters
enbale boolean: true:block The power button; false:release the Power button ;

isPowerKeyBlocked

boolean isPowerKeyBlocked();

Check whether power button has been blocked.

Returns
enbale boolean: true:blocked; false:released ;

Download

AIDL file

Please download the aidl file

Demo

Please download the demo APP