25.3.2231.6R ENABLE.system

Members

static,constant ENABLE.system.APP_PAUSE String

This is an indicator that the user no longer actively interacts with the activity, but it is still visible on screen.
This event is mostly used for saving any persistent state the activity is editing.

static,constant ENABLE.system.APP_RESUME String

This is an indicator that the activity of browser application became active and ready to receive input.

static,constant ENABLE.system.APP_STOP String

This is an indicator that application is no longer visible to the user.
This is a good place to stop refreshing UI, running animations and other visual things.

static,constant ENABLE.system.PWR_MODE_S0_STBY String

Parameter returned from ENABLE.system.getStandbyStatus .
Standby Mode S0, CPU keeps running, processes are running. Outputs are off, TV will show no signal.

static,constant ENABLE.system.PWR_MODE_S2_STBY String

Parameter returned from ENABLE.system.getStandbyStatus .
Standby Mode S2, CPU is stopped, processes are suspended. Network interface on but only able to handle magic packet to wake up STB.

Methods

static ENABLE.system.factoryReset () {Object}

Erase all data on internal storage, including application data and settings, and installed apps.
STB will then be rebooted.

Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS

static ENABLE.system.getConfigSource () {Object}

Returns the INI config source that STB boots through and related info.

Returns {source: "dhcp", dhcp_source: "http://10.0.6.230/angus/H200_new.ini", status_code: "ENTONE.status.SUCCESS"} or
        {source: "tr69", engage_last_connection: "1656390482", engage_next_session: "1656476854", status_code: "ENTONE.status.SUCCESS"} or
        {source: "usb_provision", status_code: "ENTONE.status.SUCCESS"}
Returns:
Name Type Description
object Object
Name Type Description
source Object STB boots through which ini config source
[dhcp_source] Object Optional. Dhcp source file if stb boots with dhcp source
[engage_last_connection] Object Optional. Engage last connection time if stb boots with tr69 source
[engage_next_session] Object Optional. Engage next session time if stb boots with tr69 source
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR

static ENABLE.system.getFullSerialNumber () {Object}

Gets full serial number of STB.

Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR
result String Full serial number in format [Product Number]-[Serial Number], e.g. 104-7260001

static ENABLE.system.getINIValue (key) {Object}

Gets the INI value indicated by the specified key.

Name Type Description
key String

INI key

Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR or
ENABLE.status.INVALID_ARGUMENT
result String value

static ENABLE.system.getMute () {Object}

Gets current mute status of STB.

Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR
result Boolean mute status

static ENABLE.system.getPrimaryMacAddress () {Object}

Retrieves Primary MAC address of STB in the format "00:03:E6:01:02:03".

Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY
result String MAC address

static ENABLE.system.getProcessStatus () {Object}

Returns list of process with name pss (memory usage).
PSS: Proportion Set Size, the actual physical memory used, shared libraries, etc. are allocated proportionally.
PSS is similar to RSS, except the memory usage of shared libraries in PSS are calculated proportionally.
Sample output:

ENABLE.system.getProcessStatus();
{
    process_list: [
        {name: "com.aminocom.browser", total_pss: 80045056},
        {name: "system", total_pss: 95162368},
        {name: "com.aminocom.otaupdater", total_pss: 8085504}
        {name: "com.aminocom.terminal", total_pss: 44306432},
        {name: "com.android.systemui", total_pss: 27515904}
    ],
    status_code: "ENTONE.status.SUCCESS"
}
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR
process_list Array.<Object> List of currently running processes
Name Type Description
name String Name of the process
total_pps Number Total PSS in bytes of the process

static ENABLE.system.getProductName () {Object}

Gets product name of STB.

Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR
result String Product name, e.g. Amigo7x

static ENABLE.system.getProductNumber () {Object}

Gets product number of STB.

Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR
result String Product number, e.g. 104 for Amigo7x

static ENABLE.system.getResourceStatus () {Object}

Returns device resource(CPU/storage) status.
Sample output:

ENABLE.system.getResourceStatus();
{
    cpu_load_avg: 0.0599494179889278,
    mem_total: 2086662144,
    mem_available: 1242132480,
    space_total: 4363599872,
    space_available: 4209508352
    status_code: "ENTONE.status.SUCCESS"
}
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR
cpu_load_avg Number CPU Load Average ranging from 0 to 1, where 0 means totally idle and 1 means CPU is busy all the time
mem_total Number Total RAM in bytes
mem_available Number Available RAM in bytes
space_total Number Total space for user data in bytes
space_available Number Available space for user data in bytes

static ENABLE.system.getSerialNumber () {Object}

Gets serial number of STB.

Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR
result String Serial number, e.g. 7260001

static ENABLE.system.getSoftwareVersion () {Object}

Returns software version of STB as a string.

Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR
result String Software version

static ENABLE.system.getStandbyStatus () {Object}

Returns true if the device is in an interactive state.

Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR
current_status String active - the device is awake and ready to interact with the user or,
standby - the device is dozing or asleep and must be awoken before it will become ready to interact with the user again.
selected_mode String ENABLE.system.PWR_MODE_S0_STBY or
ENABLE.system.PWR_MODE_S2_STBY

static ENABLE.system.getVolume () {Object}

Gets current system volume of STB

Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR
result Number volume index (0 to 15)

static ENABLE.system.reboot () {Object}

Reboot the STB. Will not return if the reboot is successful.

Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.ERROR

static ENABLE.system.setEventCallback (callback) {Object}

Register system callback function for JavaScript application.
Only one callback function can be registered. Pass null to unregister.
Example:

var callback = function(obj) {
    if (obj.event === ENABLE.system.APP_RESUME){
        console.log("User came back from android system");
    }
};
ENABLE.system.setEventCallback(callback);
Name Type Description
callback ENABLE.system#Callback

Callback function will be involved when events arrived.

Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.system.setMute ( isMute ) {Object}

Sets mute status of STB.

Name Type Default Description
isMute Boolean true optional

mute status

Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.system.setVolume (volume) {Object}

Sets current system volume of STB

Name Type Description
volume Number

volume index (0 to 15)

Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.system.standby (config) {Object}

Forces the device to go to sleep.
This is what happens when the power key is pressed to turn off the screen.
Sample code calling ENABLE.system.standby :

var config = { "keep_playback_status": true };
ENABLE.system.standby(config);
Name Type Description
config Object

Configuration.

Name Type Description
keep_playback_status boolean

Default true. Will re-open the last stream and seek to last position for non live stream. false to do nothing.

Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS

static ENABLE.system.wakeUp () {Object}

Forces the device to wake up from sleep.
If the device is currently asleep, wakes it up, otherwise does nothing.
This is what happens when the power key is pressed to turn on the screen.

Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS

Type Definitions

Callback (object)

Callback function for ENABLE.system.setEventCallback

Name Type Description
object Object
Name Type Description
event Object

Possible values of event:
ENABLE.system.APP_RESUME
ENABLE.system.APP_PAUSE
ENABLE.system.APP_STOP