1.1.0 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.

Since:
  • 1.0.0

static,constant ENABLE.system.APP_RESUME String

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

Since:
  • 1.0.0

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.

Since:
  • 1.0.0

static,constant ENABLE.system.INI_UPDATE String

This is an indicator that the INI configuration has been updated.
Application may read the configuration and apply it.

Since:
  • 1.0.0

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.

Since:
  • 1.0.0

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.

Since:
  • 1.0.0

static,constant ENABLE.system.REASON_COLD_BOOT String

Parameter returned from ENABLE.system.getLastBootReason .
Cold boot, generally indicates a full reset of all devices, including memory.

Since:
  • 1.0.0

static,constant ENABLE.system.REASON_FACTORY_RESET String

Parameter returned from ENABLE.system.getLastBootReason .
Factory reset, reboot to reset the device to factory settings.

Since:
  • 1.0.0

static,constant ENABLE.system.REASON_UPGRADE String

Parameter returned from ENABLE.system.getLastBootReason .
Upgrade, reboot to upgrade ota package for the device.

Since:
  • 1.0.0

static,constant ENABLE.system.REASON_WARM_BOOT String

Parameter returned from ENABLE.system.getLastBootReason .
Warm boot, generally indicates the memory and the devices retain some state, and the ramoops backing store contains persistent content.

Since:
  • 1.0.0

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.

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

static ENABLE.system.getAllINIs () {Object}

Returns all ini values
The data type of INI value will be returned as String

Returns
{adb.mode: "1", tvapp.package_id: "com.aminocom.browser", browser.js.compatibility.enable: "true", status_code: "ENTONE.status.SUCCESS"}
Able to get specific ini value by e.g. ENABLE.system.getAllINIs()["tvapp.package_id"]
Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
key String Key of the ini
value String Value of the ini
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR

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: Wed Sep 28 2022 10:07:23 GMT+0000 (Greenwich Mean Time),
          engage_next_session: Wed Sep 29 2022 10:07:23 GMT+0000 (Greenwich Mean Time),
          status_code: "ENTONE.status.SUCCESS" }
or
        { source: "usb_provision",
          usb_last_modified: Wed Sep 28 2022 10:07:23 GMT+0000 (Greenwich Mean Time),
          status_code: "ENTONE.status.SUCCESS" }
or
        { source: "none",
          status_code: "ENTONE.status.SUCCESS" }

Type of engage_last_connection, engage_next_session and usb_last_modified is Js Date object. Able to get year, month, etc. by methods like getFullYear(), getMonth().
Since:
  • 1.0.0
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] Date Optional. Js Date object to show engage last connection time if stb boots with tr69 source
[engage_next_session] Date Optional. Js Date object to show engage next session time if stb boots with tr69 source
[usb_last_modified] Date Optional. Js Date object to show usb ini last modified time if stb boots with usb provision ini source
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR

static ENABLE.system.getFullSerialNumber () {Object}

Gets full serial number of STB.

Since:
  • 1.0.0
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.getGlobalSettingValue (key) {String}

Returns global setting value

ENABLE.system.getGlobalSettingValue("adb_enabled")
Returns {status_code: "ENTONE.status.SUCCESS", result: "1"}
Name Type Description
key String

Global setting key, can be refered to
https://developer.android.com/reference/android/provider/Settings.Global#constants_1

Since:
  • 1.0.0
Returns:
Name Type Description
object.result String Global setting value
object.status_code String ENABLE.status.SUCCESS or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.system.getHardwareInfo () {Object}

Returns system hardware information.

ENABLE.system.getHardwareInfo()
{
    board_version: "A2-200",
    model: "107",
    revision: "0",
    status_code: "ENTONE.status.SUCCESS"
}
Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
board_version String Hardware board version
model String Hardware model
revision String Hardware boot revision
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR

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

Gets the INI value indicated by the specified key.

Name Type Description
key String

INI key

Since:
  • 1.0.0
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.getLastBootReason () {Object}

Returns system last boot reason.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
result String System last boot reason, can be one of the following:
ENABLE.system.REASON_WARM_BOOT or
ENABLE.system.REASON_COLD_BOOT or
ENABLE.system.REASON_UPGRADE or
ENABLE.system.REASON_FACTORY_RESET
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR

static ENABLE.system.getMute () {Object}

Gets current mute status of STB.

Since:
  • 1.0.0
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".

Since:
  • 1.0.0
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"
}
Since:
  • 1.0.0
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.

Since:
  • 1.0.0
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.

Since:
  • 1.0.0
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"
}
Since:
  • 1.0.0
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.

Since:
  • 1.0.0
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.

Since:
  • 1.0.0
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.

Since:
  • 1.0.0
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

Since:
  • 1.0.0
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.

Since:
  • 1.0.0
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.

Since:
  • 1.0.0
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

Since:
  • 1.0.0
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)

Since:
  • 1.0.0
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.

Since:
  • 1.0.0
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.

Since:
  • 1.0.0
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