Namespaces
Members
-
static,constantENABLE.system.APP_PAUSEString
-
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,constantENABLE.system.APP_RESTARTString
-
Involved after APP_STOP when the current activity is being re-displayed to the user (the user has navigated back to it).
It will be followed by APP_RESUME.- Since:
- 1.3.0
-
static,constantENABLE.system.APP_RESUMEString
-
This is an indicator that the activity of browser application became active and ready to receive input.
- Since:
- 1.0.0
-
static,constantENABLE.system.APP_STOPString
-
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,constantENABLE.system.INI_UPDATEString
-
This is an indicator that the INI configuration has been updated.
Application may read the configuration and apply it.- Since:
- 1.0.0
-
static,constantENABLE.system.PWR_MODE_S0_STBYString
-
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,constantENABLE.system.PWR_MODE_S2_STBYString
-
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,constantENABLE.system.REASON_COLD_BOOTString
-
Parameter returned from
.ENABLE.system.getLastBootReason
Cold boot, generally indicates a full reset of all devices, including memory.- Since:
- 1.0.0
-
static,constantENABLE.system.REASON_FACTORY_RESETString
-
Parameter returned from
.ENABLE.system.getLastBootReason
Factory reset, reboot to reset the device to factory settings.- Since:
- 1.0.0
-
static,constantENABLE.system.REASON_UPGRADEString
-
Parameter returned from
.ENABLE.system.getLastBootReason
Upgrade, reboot to upgrade ota package for the device.- Since:
- 1.0.0
-
static,constantENABLE.system.REASON_WARM_BOOTString
-
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
-
staticENABLE.system.factoryReset(){Object}
system.js, line 269 -
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 objectObject Name Type Description status_codeString ENABLE.status.SUCCESS -
staticENABLE.system.getAllINIs(){Object}
system.js, line 200 -
Retrieves all INI configuration values from the system.
- The data type of INI value will be returned as String.
- Accessing specific values can be done by using the key as an index into the returned object, e.g.,
ENABLE.system.getAllINIs()["tvapp.package_id"].
Example return structure:
{ "adb.mode": "1", "tvapp.package_id": "com.aminocom.browser", "browser.js.compatibility.enable": "true", "status_code": ENABLE.status.SUCCESS }- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description keyString Key of the ini valueString Value of the ini status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERROR -
staticENABLE.system.getConfigSource(){Object}
system.js, line 481 -
Returns the INI config source that STB boots through and related info.
Returns an object with the following structure:
-
For DHCP source:
{ source: "dhcp", dhcp_source: "http://10.0.6.230/angus/H200_new.ini", status_code: ENABLE.status.SUCCESS } -
For Orchestrate source:
{ source: "tr69", engage_last_connection: new Date('Wed Sep 28 2022 10:07:23 GMT+0000 (Greenwich Mean Time)'), engage_next_session: new Date('Wed Sep 29 2022 10:07:23 GMT+0000 (Greenwich Mean Time)'), status_code: ENABLE.status.SUCCESS } -
For USB provision source:
{ source: "usb_provision", usb_last_modified: new Date('Wed Sep 28 2022 10:07:23 GMT+0000 (Greenwich Mean Time)'), status_code: ENABLE.status.SUCCESS } -
If no source is detected:
{ source: "none", status_code: ENABLE.status.SUCCESS }
Note:
engage_last_connection,engage_next_session, andusb_last_modifiedare JavaScript Date objects, allowing methods likegetFullYear(),getMonth(), etc., for further manipulation.
- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description sourceObject STB boots through which ini config source dhcp_sourceObject Optional. Dhcp source file if stb boots with dhcp source engage_last_connectionDate Optional. JS Date object to show engage last connection time if stb boots with tr69 source engage_next_sessionDate Optional. JS Date object to show engage next session time if stb boots with tr69 source usb_last_modifiedDate Optional. JS Date object to show usb ini last modified time if stb boots with usb provision ini source status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERROR -
-
staticENABLE.system.getDeviceName(){Object}
system.js, line 621 -
Get the device name.
- Since:
- 1.4.0
Returns:
Name Type Description objectObject Name Type Description resultString The configured device name. status_codeString ENABLE.status.SUCCESS -
staticENABLE.system.getFullSerialNumber(){Object}
system.js, line 47 -
Gets full serial number of STB.
- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORresultString Full serial number in format [Product Number]-[Serial Number], e.g. 104-7260001 -
staticENABLE.system.getGlobalSettingValue(key){String}
system.js, line 560 -
Returns global setting value
ENABLE.system.getGlobalSettingValue("adb_enabled") Returns {status_code: ENABLE.status.SUCCESS, result: "1"}Name Type Description keyString Global setting key, can be referred to
https://developer.android.com/reference/android/provider/Settings.Global#constants_1- Since:
- 1.0.0
Returns:
Name Type Description object.resultString Global setting value object.status_codeString ENABLE.status.SUCCESSor
ENABLE.status.INVALID_ARGUMENT -
staticENABLE.system.getHardwareInfo(){Object}
system.js, line 522 -
Returns system hardware information.
ENABLE.system.getHardwareInfo() { board_version: "A2-200", model: "107", revision: "0", status_code: ENABLE.status.SUCCESS }- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description board_versionString Hardware board version modelString Hardware model revisionString Hardware boot revision status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERROR -
staticENABLE.system.getINIValue(key){Object}
system.js, line 169 -
Gets the INI value indicated by the specified key.
Name Type Description keyString INI key
- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORor
ENABLE.status.INVALID_ARGUMENTresultString value -
staticENABLE.system.getLastBootReason(){Object}
system.js, line 540 -
Returns system last boot reason.
- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description resultString System last boot reason, can be one of the following:
ENABLE.system.REASON_WARM_BOOTor
ENABLE.system.REASON_COLD_BOOTor
ENABLE.system.REASON_UPGRADEor
ENABLE.system.REASON_FACTORY_RESETstatus_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERROR -
staticENABLE.system.getMute(){Object}
system.js, line 103 -
Retrieves the current mute status of STB.
- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORresultBoolean mute status, trueif muted,falseif unmuted -
staticENABLE.system.getPrimaryMacAddress(){Object}
system.js, line 61 -
Retrieves Primary MAC address of STB in the format "00:03:E6:01:02:03".
- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.NOT_READYresultString MAC address -
staticENABLE.system.getProcessStatus(){Object}
system.js, line 423 -
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: ENABLE.status.SUCCESS }- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORprocess_listArray.<Object> List of currently running processes Name Type Description nameString Name of the process total_ppsNumber Total PSS in bytes of the process -
staticENABLE.system.getProductName(){Object}
system.js, line 89 -
Gets product name of STB.
- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORresultString Product name, e.g. H200 -
staticENABLE.system.getProductNumber(){Object}
system.js, line 75 -
Gets product number of STB.
- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORresultString Product number, e.g. 107 for H200 -
staticENABLE.system.getResourceStatus(){Object}
system.js, line 392 -
Returns device resource(CPU/storage) status.
Sample output:ENABLE.system.getResourceStatus(); { "cpu_load_avg": 0.35940287275159805, "mem_total": 2085502976, "mem_available": 835780608, "space_total": 4363599872, "space_available": 4170665984, "storage": [ { "description": "Internal shared storage", "is_emulated": true, "is_removable": false, "space_total": 4363599872, "space_available": 3952485991 }, { "description": "USB drive", "is_emulated": false, "is_removable": true, "space_total": 15836889088, "space_available": 5322588160 } ], "status_code": ENABLE.status.SUCCESS }- Since:
- 1.4.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORcpu_load_avgNumber CPU Load Average ranging from 0 to 1, where 0 means totally idle and 1 means CPU is busy all the time mem_totalNumber Total RAM in bytes mem_availableNumber Available RAM in bytes space_totalNumber Total space for user data (under /data directory) in bytes space_availableNumber Available space for user data (under /data directory) in bytes storageArray.<Object> A list of mounted storage devices Name Type Description descriptionString The description of storage device uuidString | undefined The UUID of storage device is_emulatedboolean trueif it is an Android Emulated Storage (e.g. Internal shared storage)is_removableboolean trueif it is a removable device (e.g. USB)descriptionboolean The description of storage device space_totalNumber The total storage size in bytes space_availableNumber The available storage size in bytes -
staticENABLE.system.getScreenSaverTimeout(){String}
system.js, line 594 -
Retrieves the screen saver timeout.
- Since:
- 1.4.0
Returns:
Name Type Description object.resultString The timeout value in seconds. object.status_codeString ENABLE.status.SUCCESS -
staticENABLE.system.getSerialNumber(){Object}
system.js, line 32 -
Gets serial number of STB.
- Since:
- 1.0.0
- See:
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORresultString Serial number, e.g. 7260001 -
staticENABLE.system.getSoftwareVersion(){Object}
system.js, line 337 -
Returns software version of STB as a string.
- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORresultString Software version -
staticENABLE.system.getStandbyStatus(){Object}
system.js, line 324 -
Returns true if the device is in an interactive state.
- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORcurrent_statusString 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_modeString ENABLE.system.PWR_MODE_S0_STBYor
ENABLE.system.PWR_MODE_S2_STBY -
staticENABLE.system.getTvSystem(){Object}
system.js, line 657 -
Get TV system of this device.
- Since:
- 1.4.0
Returns:
Name Type Description objectObject Name Type Description resultString Broadcast television systems of this device, can be one of the following:
ENABLE.system.tv_system.PALorENABLE.system.tv_system.NTSCstatus_codeString ENABLE.status.SUCCESS -
staticENABLE.system.getVolume(){Object}
system.js, line 136 -
Gets current system volume of STB
- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORresultNumber volume index (0 to 15) -
staticENABLE.system.isScreenSaverActivate(){boolean}
system.js, line 607 -
Checks if the screen saver is activated.
- Since:
- 1.4.0
Returns:
Name Type Description object.resultboolean trueif the screen is activated, otherwisefalseobject.status_codeString ENABLE.status.SUCCESS -
staticENABLE.system.reboot(){Object}
system.js, line 257 -
Reboot the STB. Will not return if the reboot is successful.
- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.ERROR -
staticENABLE.system.setDeviceName(device_name){Object}
system.js, line 638 -
Configure the device with a custom name.
Name Type Description device_nameString The custom name to set for the device. Must not be empty or contain only spaces.
- Since:
- 1.4.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.INVALID_ARGUMENT -
staticENABLE.system.setEventCallback(callback){Object}
system.js, line 233 -
Register system callback function for JavaScript application.
Only one callback function can be registered. Passnullto 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 callbackENABLE.system#Callback Callback function will be involved when events arrived.
- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.INVALID_ARGUMENT -
staticENABLE.system.setMute(is_mute){Object}
system.js, line 118 -
Sets mute status of STB.
Name Type Default Description is_muteBoolean true optional mute status
- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORor
ENABLE.status.INVALID_ARGUMENT -
staticENABLE.system.setScreenSaverTimeout(timeout){String}
system.js, line 577 -
Sets the screen saver timeout.
Name Type Description timeoutnumber The timeout value in seconds.
timeoutwith value 0 to turn off the screen saver. To turn on the screen saver, it accepts value between the range 10 to 2147483.- Since:
- 1.4.0
Returns:
Type Description String object.status_code ENABLE.status.SUCCESSor
ENABLE.status.INVALID_ARGUMENT -
staticENABLE.system.setVolume(volume){Object}
system.js, line 151 -
Sets current system volume of STB
Name Type Description volumeNumber volume index (0 to 15)
- Since:
- 1.0.0
Returns:
Name Type Description objectObject Name Type Description status_codeString ENABLE.status.SUCCESSor
ENABLE.status.ERRORor
ENABLE.status.INVALID_ARGUMENT -
staticENABLE.system.standby(config){Object}
system.js, line 288 -
Forces the device to go to sleep.
This is what happens when the power key is pressed to turn off the screen.
Sample code callingENABLE.system.standby:var config = { "keep_playback_status": true }; ENABLE.system.standby(config);Name Type Description configObject Configuration.
Name Type Description keep_playback_statusboolean 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 objectObject Name Type Description status_codeString ENABLE.status.SUCCESS -
staticENABLE.system.wakeUp(){Object}
system.js, line 308 -
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 objectObject Name Type Description status_codeString ENABLE.status.SUCCESS
Type Definitions
-
Callback(object)
system.js, line 205 -
Callback function for
ENABLE.system.setEventCallbackName Type Description objectObject Name Type Description eventObject Possible values of event:
ENABLE.system.APP_RESUME
ENABLE.system.APP_PAUSE
ENABLE.system.APP_STOP