public interface ISystemDevice extends IAdvanceDevice
| Modifier and Type | Method and Description |
|---|---|
boolean |
addToLockTaskAllowlist(String packageName)
Adds a single package to the LockTask (Kiosk) allowlist.
|
boolean |
cleanLockTaskAllowedPackages()
Removes the specified packages from the LockTask (Kiosk) allowlist.
|
void |
disableNavigationBarButton(int btnId,
boolean disable)
disable navigation bar button
|
IAdminDevice |
getAdminManager()
Get the Admin manager
|
IBatteryDevice |
getBatteryManager()
Get the Battery manager
|
IBluetoothDevice |
getBluetoothManager()
Get the Bluetooth manager
|
byte[] |
getEth0Mac()
Get the device's ethernet mac address
|
IHomeDevice |
getHomeManager()
Get the home manager
|
ILocationDevice |
getLocationManager()
Get the location manager object to retrieve latitude and longitude information and to set the location level and location SDK.
|
int |
getLockScreenShowNotification()
Retrieves the current lock screen notification visibility policy.
|
ILoginDevice |
getLoginManager()
Get the login manager.
|
boolean |
getMtpStatus()
Get MTP Status
|
INetworkDevice |
getNetworkManager()
Get the manager for network devices
(including Ethernet management, WiFi management, and APN management).
|
String |
getRebootTimeByEveryDay()
return"HH:MM:SS" or "Default"。
|
byte[] |
getScreenshotInPNG()
Captures the current screen content and returns it as a PNG-compressed byte array.
|
boolean |
getShowTouchesState()
get ‘show touches’ state for enable or disable.
|
boolean |
getStatusbarSettingsButtonVisibility()
get statusbar settings button status.
|
String |
getTextOnLockScreen()
Retrieves the current custom text displayed on the lock screen.
|
String |
getTouchScreenWakeupValue() |
IUpdateAppDevice |
getUpdateAppManager()
Get the UpdateApp manager
|
IUserCredentials |
getUserCredentialsManager()
Get the user credentials manager
|
boolean |
isAccessibilityDisplayInversion()
Get the setting that indicates whether display color inversion is enabled.
|
boolean |
isButtonWakeup() |
boolean |
isEnableAutoTime()
get status for enable/disable auto time item.
|
boolean |
isEnableAutoTimeGUI()
get status for enable/disable auto time item GUI.
|
boolean |
isEnableAutoTimezone()
get status for enable/disable auto timezone item.
|
boolean |
isEnableAutoTimezoneGUI()
get status for enable/disable auto timezone item GUI.
|
boolean |
isEnableBluetooth()
Get the current Bluetooth status (enabled or disabled).
|
boolean |
isEnableCamera()
Get the current Camera status (enabled or disabled).
|
boolean |
isEnabledShowBatteryPercent()
Is the battery percentage already displayed
|
boolean |
isEnableUsb()
Get the current Camera status (enabled or disabled).
|
boolean |
isEnableWifi()
Get the current Wi-Fi status (enabled or disabled).
|
boolean |
isPowerKeyBlocked()
check PowerKey Button 's block status.
|
boolean |
isTerminalRooted()
Is the current terminal rooted.
|
boolean |
isWifiStaticIp(String ssid)
Is the current Wi-Fi using a static IP
|
void |
lockNow()
lock now
|
boolean |
reboot()
reboot terminal
return true: success; false: failed。
|
boolean |
removeFromLockTaskAllowlist(String packageName)
Removes a single package from the LockTask (Kiosk) allowlist.
|
Bitmap |
screenshot()
Captures the current screen content and returns it as a
android.graphics.Bitmap. |
void |
setAccessibilityDisplayInversion(boolean enable)
Setting that specifies whether display color inversion is enabled.
|
void |
setAirplaneMode(boolean enable)
enable/disable Airplane Mode
|
void |
setAutoTime(boolean enable)
enable/disable auto time item.
|
void |
setAutoTimeGUI(boolean enable)
enable/disable show auto time item GUI.
|
void |
setAutoTimezone(boolean enable)
enable/disable auto timezone item.
|
void |
setAutoTimezoneGUI(boolean enable)
enable/disable show auto timezone item GUI.
|
boolean |
setBluetooth(boolean enable)
Enable or Disable the bluetooth device
|
boolean |
setButtonWakeup(boolean enable) |
boolean |
setCamera(boolean enable)
Enable or Disable the Camera device
|
boolean |
setCustomAttribute(String key,
String value)
Set "persist.wp.usr.${key}"'s property , max count = 10.
|
boolean |
setDeviceOwner(String pkg,
String deviceCls) |
boolean |
setLanguage(String language,
String country,
String variant)
set Language
|
void |
setLockScreenShowNotification(int flag)
Sets the lock screen notification visibility policy.
|
boolean |
setLockTaskAllowedPackages(String[] packageNames)
Sets the list of packages that are allowed to launch activities
while the device is running in LockTask (Kiosk) mode.
|
void |
setMtp(boolean enable)
Enable/Disable MTP
|
void |
setPasswordLock(boolean enable,
String password)
Sets a password to unlock the device.
|
void |
setPatternLock(boolean enable,
String pattern)
Sets a pattern to unlock the device.
|
void |
setPinLock(boolean enable,
String pin)
Sets a numeric PIN to unlock the device.
|
void |
setPowerKeyBlocked(boolean enable)
Block or Release The Power Key
|
boolean |
setRebootTimeByEveryDay(int hour,
int minute,
int second) |
boolean |
setRestrictBackground(boolean enable)
enable/disable Data Saver Mode。
|
boolean |
setScreenOffTimeout(int milliseconds)
Added by Stone for task #22834 to add a interface to set screen off timeout.
|
void |
setShowBatteryPercent(boolean enable)
Set whether to display the battery percentage
|
void |
setShowTouches(boolean enable)
Enabling ‘show touches’ in Android screen recordings for user research.
|
void |
setStatusBarLocked(boolean lock)
Set the status bar locked as true will make the status bar can not be pull down.
|
void |
setStatusbarSettingsButtonVisibility(boolean visibility)
visibility/hide statusbar settings button
|
boolean |
setSystemOrientation(int rotationType)
set orientation
|
void |
setTextOnLockScreen(String text)
Sets a custom text message to be displayed on the lock screen.
|
boolean |
setTouchScreenWakeupValue(String touch) |
boolean |
setUnknownSources(String packageName,
boolean enable)
Enable packageName the permission to install apps from unknown sources.
|
boolean |
setUsb(boolean enable)
Enable or Disable the USB device
|
boolean |
setWifi(boolean enable)
Enable or Disable the Wi-Fi device
|
boolean |
setWifiDHCP(String ssid)
set the Wi-Fi DHCP IP.
|
boolean |
setWifiStaticIp(String ssid,
IpBean ipBean)
set the Wi-Fi static IP.
|
boolean |
shutdown(boolean confirm,
String reason,
boolean wait)
Turn off the device.
|
boolean |
stopApp(String pkgName)
Force-stops a payment application.
|
close, isOpened, openboolean addToLockTaskAllowlist(String packageName) throws DeviceException
The specified package will be permitted to temporarily launch activities or present UI while the device is operating in LockTask mode. This method performs an incremental update and does not replace the existing allowlist.
If the package is already present in the allowlist, no changes will be made.
packageName - the package name to be added to the LockTask
allowlist
Applications must request permission :
<uses-permission android:name="android.permission.CLOUDPOS_MANAGE_APP" />
true if the allowlist was modified as a result of
this call, or false if the package was already
present or the operation failedDeviceExceptionboolean cleanLockTaskAllowedPackages()
throws DeviceException
This method performs an incremental removal: only the package names
provided in packageNames will be removed from the current allowlist,
while all other entries remain unaffected.
If packageNames is null or empty, this method takes no action.
Removing a package that is not currently in the allowlist has no effect.
Applications must request permission:
<uses-permission android:name="android.permission.CLOUDPOS_MANAGE_APP" />
true if the allowlist was modified as a result of this call,
or false if none of the specified packages were present,
the input was null/empty, or the operation failedDeviceExceptionvoid disableNavigationBarButton(int btnId,
boolean disable)
throws DeviceException
btnId - BTN_ID_HOME = 0 , BTN_ID_BACK = 1, BTN_ID_RESENT =2;disable - true or false
Applications must request permission :
<uses-permission android:name="android.permission.CLOUDPOS_NAVIGATION_BUTTON" />
DeviceException - if set errorIAdminDevice getAdminManager()
IAdminDeviceIBatteryDevice getBatteryManager()
IBatteryDeviceIBluetoothDevice getBluetoothManager()
IBluetoothDevicebyte[] getEth0Mac()
throws DeviceException
Applications must request permission :
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
DeviceException - if get errorIHomeDevice getHomeManager()
IHomeDeviceILocationDevice getLocationManager()
ILocationDeviceint getLockScreenShowNotification()
throws DeviceException
DeviceExceptionILoginDevice getLoginManager()
ILoginDeviceboolean getMtpStatus()
throws DeviceException
DeviceExceptionINetworkDevice getNetworkManager()
INetworkDeviceString getRebootTimeByEveryDay() throws DeviceException
Applications must request permission :
<uses-permission android:name="android.permission.CLOUDPOS_REBOOT" />
DeviceExceptionbyte[] getScreenshotInPNG()
throws DeviceException
This method is typically used by system-level services or privileged applications to retrieve the current visual content displayed on the device screen in a compressed format. The returned byte array contains the raw PNG image data, which can be directly written to a file or transmitted over a network.
Note:
byte[] may be null if the screenshot operation fails.android.os.TransactionTooLargeException or significant memory pressure.
Consider further compression, scaling, or using alternative IPC mechanisms for large payloads.android.permission.READ_FRAME_BUFFER). Regular apps may not
have access.byte[] containing the PNG-encoded screen capture,
or null if the screenshot could not be captured or encoded.
Applications must request permission :
<uses-permission android:name="android.permission.READ_FRAME_BUFFER" />
DeviceException - if the call failsboolean getShowTouchesState()
throws DeviceException
DeviceExceptionboolean getStatusbarSettingsButtonVisibility()
throws DeviceException
DeviceExceptionString getTextOnLockScreen() throws DeviceException
DeviceExceptionString getTouchScreenWakeupValue() throws DeviceException
Applications must request permission :
<uses-permission android:name="android.permission.CLOSEPOS_SET_SCREEN_WAKEUP" />
<uses-permission android:name="android.permission.CLOUDPOS_SET_SCREEN_WAKEUP" />
DeviceExceptionIUpdateAppDevice getUpdateAppManager()
IUpdateAppDeviceIUserCredentials getUserCredentialsManager()
IUserCredentialsboolean isAccessibilityDisplayInversion()
throws DeviceException
Applications must request permission :
<uses-permission android:name="android.permission.READ_POS_SETTINGS" />
DeviceException - if set errorboolean isButtonWakeup()
throws DeviceException
Applications must request permission :
<uses-permission android:name="android.permission.WRITE_POS_SETTINGS" />
DeviceException - if the call failsboolean isEnableAutoTime()
throws DeviceException
DeviceExceptionboolean isEnableAutoTimeGUI()
throws DeviceException
DeviceExceptionboolean isEnableAutoTimezone()
throws DeviceException
DeviceExceptionboolean isEnableAutoTimezoneGUI()
throws DeviceException
DeviceExceptionboolean isEnableBluetooth()
throws DeviceException
DeviceExceptionboolean isEnableCamera()
throws DeviceException
Applications must request permission :
<uses-permission android:name="android.permission.CAMERA" />
DeviceExceptionboolean isEnabledShowBatteryPercent()
throws DeviceException
Applications must request permission :
<uses-permission android:name="android.permission.READ_POS_SETTINGS" />
DeviceException - if the call failsboolean isEnableUsb()
throws DeviceException
Applications must request permission :
<uses-permission android:name="android.permission.USB" />
DeviceExceptionboolean isEnableWifi()
throws DeviceException
DeviceExceptionboolean isPowerKeyBlocked()
throws DeviceException
Applications must request permission :
<uses-permission android:name="android.permission.CLOUDPOS_DISABLE_POWER_KEY" />
DeviceExceptionboolean isTerminalRooted()
throws DeviceException
DeviceExceptionboolean isWifiStaticIp(String ssid) throws DeviceException
ssid - the Wi-Fi ssidDeviceException - if the call fails
Applications must request permission :
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
void lockNow()
throws DeviceException
DeviceExceptionboolean reboot()
throws DeviceException
Applications must request permission :
<uses-permission android:name="android.permission.CLOUDPOS_REBOOT" />
DeviceExceptionboolean removeFromLockTaskAllowlist(String packageName) throws DeviceException
After removal, the specified package will no longer be permitted to launch activities or present UI while the device is operating in LockTask mode.
If the package is not currently present in the allowlist, this method performs no action.
packageName - the package name to be removed from the LockTask
allowlist
Applications must request permission :
<uses-permission android:name="android.permission.CLOUDPOS_MANAGE_APP" />
true if the allowlist was modified as a result of
this call, or false if the package was not present
or the operation failedDeviceExceptionBitmap screenshot()
throws DeviceException
android.graphics.Bitmap.
This method is typically used by system-level services or privileged applications to retrieve the current visual content displayed on the device screen.
Note:
Bitmap may be null if the screenshot operation fails.Bitmap is transferred across Binder, large images may cause
android.os.TransactionTooLargeException or high memory usage.
For performance and reliability, consider scaling or compressing the bitmap.android.permission.READ_FRAME_BUFFER). Regular apps may not
have access.Bitmap object representing the current screen content,
or null if the screenshot could not be captured.
Applications must request permission :
<uses-permission android:name="android.permission.READ_FRAME_BUFFER" />
DeviceException - if the call failsvoid setAccessibilityDisplayInversion(boolean enable)
throws DeviceException
Applications must request permission :
<uses-permission android:name="android.permission.WRITE_POS_SETTINGS" />
DeviceException - if set errorvoid setAirplaneMode(boolean enable)
throws DeviceException
enable - : true: alirplane mode on ; false: alirplane mode off.DeviceExceptionvoid setAutoTime(boolean enable)
throws DeviceException
enable - true: enable; false: disableDeviceExceptionvoid setAutoTimeGUI(boolean enable)
throws DeviceException
enable - true: enable; false: disableDeviceExceptionvoid setAutoTimezone(boolean enable)
throws DeviceException
enable - true: enable; false: disableDeviceExceptionvoid setAutoTimezoneGUI(boolean enable)
throws DeviceException
enable - true: enable; false: disableDeviceExceptionboolean setBluetooth(boolean enable)
throws DeviceException
enable - a boolean indicating whether to enable or disable the bluetooth device.Applications must request permission :
<uses-permission android:name="android.permission.BLUETOOTH" />
DeviceExceptionboolean setButtonWakeup(boolean enable)
throws DeviceException
enable - Enable/disable waking up terminal by function key .Applications must request permission :
<uses-permission android:name="android.permission.WRITE_POS_SETTINGS" />
DeviceException - if the call failsboolean setCamera(boolean enable)
throws DeviceException
enable - a boolean indicating whether to enable or disable the Camera device.Applications must request permission :
<uses-permission android:name="android.permission.CAMERA" />
DeviceExceptionboolean setCustomAttribute(String key, String value) throws DeviceException
key: - property's key, length less than 16. for example: persist.wp.usr.${key} ${value}.value: - property's value, length less than 32.Applications must request permission :
<uses-permission android:name="android.permission.CLOUDPOS_SET_USR_PROP" />
DeviceExceptionboolean setDeviceOwner(String pkg, String deviceCls) throws DeviceException
pkg: - package name.deviceCls: - policyReceiver's class name.DeviceExceptionboolean setLanguage(String language, String country, String variant) throws DeviceException
language: - (Null is not allowed)An ISO 639 alpha-2 or alpha-3 language code, or a language subtag up to 8 characters in length. See the Locale class description about valid language values.country - : (Null is allowed)An ISO 3166 alpha-2 country code or a UN M.49 numeric-3 area code. See the Locale class description about valid country values.variant - : (Null is allowed)Any arbitrary value used to indicate a variation of a Locale. See the Locale class description for the details.
for example: Locale(String language, String country, String variant) or Locale(String language, String country) or Locale(String language)
DeviceExceptionvoid setLockScreenShowNotification(int flag)
throws DeviceException
flag - Visibility mode. Valid values:
int ALL = 1; // Show all notifications
int NONE = 2; // Hide all notifications
int SENSITIVE_ONLY = 3; // Show non-sensitive notifications only (default)DeviceException - if flag is not 1 or 2 or 3boolean setLockTaskAllowedPackages(String[] packageNames) throws DeviceException
The provided package list defines the complete allowlist of privileged applications that are permitted to temporarily break out of the kiosk foreground and present UI (for example, system dialogs or auxiliary activities).
If packageNames is null or empty, the current
LockTask allowlist will be cleared and no additional applications
will be granted privileged access.
This method replaces any previously configured allowlist.
packageNames - an array of package names to be allowed in
LockTask mode, or null to clear the
privileged application list
Applications must request permission :
<uses-permission android:name="android.permission.CLOUDPOS_MANAGE_APP" />
true successfully
false Terminal system version not supportedDeviceExceptionvoid setMtp(boolean enable)
throws DeviceException
enable: - true:Enable MTP ; false:Disable MTP;DeviceExceptionvoid setPasswordLock(boolean enable,
String password)
throws DeviceException
password - the password to set, must be at least 4 characters and may contain letters and numbers.DeviceException - Applications must request permission :
<uses-permission android:name="android.permission.CREATE_USERS" />
void setPatternLock(boolean enable,
String pattern)
throws DeviceException
1 2 3 4 5 6 7 8 9
Each point in the pattern must be unique and cannot be repeated.
Example: To set an L-shaped pattern, use the array: {1, 4, 7, 8, 9}.
pattern - an array of integers representing the pattern, with each element being a number between 1 and 9.DeviceException - Applications must request permission :
<uses-permission android:name="android.permission.CREATE_USERS" />
void setPinLock(boolean enable,
String pin)
throws DeviceException
pin - the PIN to set, must be at least 4 digits (numeric only).DeviceException - Applications must request permission :
<uses-permission android:name="android.permission.CREATE_USERS" />
void setPowerKeyBlocked(boolean enable)
throws DeviceException
enable: - true:Block The Power Key ; false:Release The Power Key ;
Applications must request permission :
<uses-permission android:name="android.permission.CLOUDPOS_DISABLE_POWER_KEY" />
DeviceExceptionboolean setRebootTimeByEveryDay(int hour,
int minute,
int second)
throws DeviceException
hour - [0,23], minute [0,59], second [0,59]
return true: success; false: failed。
Applications must request permission :
<uses-permission android:name="android.permission.CLOUDPOS_REBOOT" />
DeviceExceptionboolean setRestrictBackground(boolean enable)
throws DeviceException
enable: - true: enable Data Saver Mode,false: diable Data Saver Mode.DeviceExceptionboolean setScreenOffTimeout(int milliseconds)
throws DeviceException
milliseconds - the time you want to set, can be one of following:
15000 - 15s
30000 - 30s
60000 - 1 minute
120000 - 2 minutes
300000 - 5 minutes
600000 - 10 minutes
1800000 - 30 minutes
2147483647(Integer.MAX_VALUE) - neverApplications must request permission :
<uses-permission android:name="android.permission.CLOUDPOS_SET_SCREEN_OFF_TIMEOUT" />
DeviceExceptionvoid setShowBatteryPercent(boolean enable)
throws DeviceException
enable - a boolean value to set whether to display the battery percentage
Applications must request permission :
<uses-permission android:name="android.permission.WRITE_POS_SETTINGS" />
DeviceException - if set errorvoid setShowTouches(boolean enable)
throws DeviceException
enable: - true, false;DeviceExceptionvoid setStatusBarLocked(boolean lock)
throws DeviceException
Applications must request permission :
<uses-permission android:name="android.permission.CLOUDPOS_LOCK_STATUS_BAR" />
lock, - true for lock, false for disable lock.DeviceExceptionvoid setStatusbarSettingsButtonVisibility(boolean visibility)
throws DeviceException
visibility - : true: statusbar settings button show ; false: statusbar settings button hide.DeviceExceptionboolean setSystemOrientation(int rotationType)
throws DeviceException
rotationType - int ROTATION_0 = 0; Rotation constant: 0 degree rotation (natural orientation)
int ROTATION_90 = 1; Rotation constant: 90 degree rotation.
int ROTATION_180 = 2;Rotation constant: 180 degree rotation.
int ROTATION_270 = 3;Rotation constant: 270 degree rotation.DeviceExceptionvoid setTextOnLockScreen(String text) throws DeviceException
text - The message to display. Cannot be null. Use empty string to clear the lock screen text.DeviceException - if text is nullboolean setTouchScreenWakeupValue(String touch) throws DeviceException
touch:Add - wake on touch;
double:Add wake on double touch
none: Only the power button wakes upApplications must request permission :
<uses-permission android:name="android.permission.CLOSEPOS_SET_SCREEN_WAKEUP" />
<uses-permission android:name="android.permission.CLOUDPOS_SET_SCREEN_WAKEUP" />
DeviceExceptionboolean setUnknownSources(String packageName, boolean enable) throws DeviceException
Applications must request permission :
<uses-permission android:name="android.permission.CLOUDPOS_SET_UNKOWN_SOURCE" />
DeviceExceptionboolean setUsb(boolean enable)
throws DeviceException
enable - a boolean indicating whether to enable or disable the USB device.Applications must request permission :
<uses-permission android:name="android.permission.USB" />
DeviceExceptionboolean setWifi(boolean enable)
throws DeviceException
enable - a boolean indicating whether to enable or disable the Wi-Fi device.Applications must request permission :
<uses-permission android:name="android.permission.WIFI" />
DeviceExceptionboolean setWifiDHCP(String ssid) throws DeviceException
ssid - the Wi-Fi ssidDeviceException - if the call fails
Applications must request permission :
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
boolean setWifiStaticIp(String ssid, IpBean ipBean) throws DeviceException
ssid - the Wi-Fi ssidipBean - the Wi-Fi ipBean , set ipAddress,prefixLength,gateway,dnsServerDeviceException - if the call fails
Applications must request permission :
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
boolean shutdown(boolean confirm,
String reason,
boolean wait)
throws DeviceException
confirm - If true, shows a shutdown confirmation dialog.reason - code to pass to android_reboot() (e.g. "userrequested"), or null.wait - If true, this call waits for the shutdown to complete and does not return.
return true: success; false: failed。
Applications must request permission :
<uses-permission android:name="android.permission.CLOUDPOS_REBOOT" />
DeviceExceptionboolean stopApp(String pkgName) throws DeviceException
This API terminates the target process immediately and clears its running state.
Only built-in/system special payment applications are allowed to be terminated by this method.
Calling this on non-built-in apps will return false without performing any action.
pkgName - the package name of the payment applicationtrue if the app process was successfully terminated;
false otherwise
Applications must request permission :
<uses-permission android:name="android.permission.CLOUDPOS_MANAGE_APP" />
DeviceException