public class EloSecureUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ELO_GET_DEVICE_INFO
Information about the device such as device name.
|
static int |
OTA_APPLY_FILE_ERROR
The OTA was not applied due to some error.
|
static int |
OTA_APPLY_IN_PROGRESS
The OTA is currently being applied.
|
static int |
OTA_CHECK_STATUS_GENERIC_ERROR
Could not retrieve info about the remote OTA package.
|
static int |
OTA_CHECK_STATUS_NEW
There is a new OTA package available, please update.
|
static int |
OTA_CHECK_STATUS_OLD
The latest available OTA package is older than the current system.
|
static int |
OTA_CHECK_STATUS_SAME
The latest available OTA package is the same as the current system.
|
static int |
OTA_DOWNLOAD_GENERIC_ERROR
There was an unknown error while downloading the OTA package.
|
static int |
OTA_DOWNLOAD_LOCAL_FILE_ERROR
Local OTA package could not be copied due to error.
|
static int |
OTA_DOWNLOAD_LOCAL_FILE_PERCENTAGE
Progress of copying the OTA package from local source.
|
static int |
OTA_DOWNLOAD_LOCAL_FILE_SUCCESS
Local OTA package has been copied successfully.
|
static int |
OTA_DOWNLOAD_REMOTE_FILE_ERROR
There was an error downloading the OTA package.
|
static int |
OTA_DOWNLOAD_REMOTE_FILE_PERCENTAGE
OTA package download percentage completed.
|
static int |
OTA_DOWNLOAD_REMOTE_FILE_SUCCESS
The remote file has downloaded successfully.
|
static int |
OTA_VERIFY_FILE_ERROR
There was an error verifying the OTA package, the file may be corrupt.
|
static int |
OTA_VERIFY_SIGN_ERROR
There OTA package signature is invalid.
|
static int |
OTA_VERIFY_SIGN_PERCENTAGE
Progress of OTA package verification.
|
static int |
OTA_VERIFY_SIGN_SUCCESS
The OTA package signature was verified as valid.
|
static java.lang.String |
RELEASE_VERSION |
Constructor and Description |
---|
EloSecureUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
applyOTA(Context ctx,
Handler handler)
This method is used to trigger underlying Android OS OTA mechanism.
|
static void |
captureScreenShot(Context ctx,
BroadcastReceiver screenshotReceiver)
This method is used to capture the screenshot from the device.
|
static void |
checkOTAStatus(Context ctx,
java.lang.String buildPropUrl,
Handler handler)
This method is used to check whether pointed remote/local OTA is newer or older than current
version.
|
static void |
getAddress(Context ctx,
BroadcastReceiver addressReceiver)
This method is used to get device Address
|
static void |
getAECMOrientation(Context ctx,
BroadcastReceiver orientationReceiver)
This method is used to get orientation of AECM device from EloSecure application.
|
static int |
getBrightness(Context ctx)
This method is used to get device Brightness the device
|
static java.lang.String |
getDeviceInfo(Context ctx)
This method is used to get device information from cloud ( Sync Call )
|
static boolean |
getDeviceInfo(Context ctx,
Handler handler)
This method is used to get device information from cloud ( Async Call )
|
static int |
getDevicePortsStatusJSON(Context ctx,
BroadcastReceiver devicePortStatusReceiver)
This method is use to get device port status in JSON String format.
|
static java.lang.String |
getHeapGrowthLimit(Context ctx)
This method is used to get heap growth limit size in MB.
|
static java.lang.String |
getHeapSize(Context ctx)
This method is used to get heap size.
|
static void |
getLocale(Context ctx,
BroadcastReceiver localeReceiver)
This method is used to get device system locale
|
static int |
getMaxUSBport()
This method is used to get number of max USB port available on devices.
|
static java.lang.String |
getOrientation(Context ctx)
This method is used to get orientation details only for LIDS-2.0/BACKPACK devices.
|
static java.lang.String |
getSDKVersion()
This method is used to get current EloView SDK Version
|
static void |
getSerialNumber(Context ctx,
BroadcastReceiver serialNumberReceiver)
This method is used to get device Serial Number
|
static int |
getVolume(Context ctx)
This method is used to get device Volume the device
|
static boolean |
isEloViewSDKExists(Context ctx)
Check for EloView SDK is available or not
|
static boolean |
registerDeviceInfoReceiver(Context ctx,
BroadcastReceiver deviceInfoReceiver)
This method is used to notify any change in device info
|
static void |
screenTurnOff(Context ctx,
int mode)
This method is used to turn off the screen
|
static void |
screenTurnOn(Context ctx,
int mode)
This method is used to turn on the screen
|
static void |
setBrightness(Context ctx,
int val)
This method is used to set device Brightness the device
|
static int |
setDevicePortsJSON(Context ctx,
java.lang.String json)
This method is used to enable/disable device ports using JSON string.
|
static int |
setHeapGrowthLimit(Context ctx,
int limit)
This method is used to set heap growth limit (Only for V2 devices).
|
static int |
setHeapSize(Context ctx,
int size)
This method is used to set heap size (Only for V2 devices).
|
static void |
setLocale(Context ctx,
java.lang.String localeStr)
This method is used to set device system locale
|
static boolean |
setOrientation(Context ctx,
java.lang.String orientation)
This method is used to set orientation for LIDS 2.0/BACKPACK devices only
|
static void |
setVolume(Context ctx,
int val)
This method is used to set device volume the device
|
static void |
silentPackageInstall(Context ctx,
java.lang.String uri)
This method is used to install new APK silently in background
|
static void |
silentPackageUninstall(Context ctx,
java.lang.String packageName)
This method is used to uninstall new APK silently in background
|
static void |
silentReboot(Context ctx)
This method is used to reboot the device
|
static void |
startDownloadUpgradePackage(Context context,
java.lang.String url,
Handler handler)
This method is used to download OTA file from remote http server or from
local file path.
|
static boolean |
unregisterDeviceInfoReceiver(Context ctx,
BroadcastReceiver deviceInfoReceiver)
This method is used to unregister the device info change listener
|
static void |
unsecurePackageInstall(Context ctx,
java.lang.String uri)
This method is used to install apk using Standard Android package manager
|
static void |
verifyOTA(Context ctx,
Handler handler)
This method is used to verify the system signature of downloaded OTA file.
|
public static final java.lang.String RELEASE_VERSION
public static final int OTA_DOWNLOAD_REMOTE_FILE_SUCCESS
public static final int OTA_DOWNLOAD_REMOTE_FILE_ERROR
public static final int OTA_DOWNLOAD_REMOTE_FILE_PERCENTAGE
public static final int OTA_DOWNLOAD_LOCAL_FILE_SUCCESS
public static final int OTA_DOWNLOAD_LOCAL_FILE_ERROR
public static final int OTA_DOWNLOAD_LOCAL_FILE_PERCENTAGE
public static final int OTA_DOWNLOAD_GENERIC_ERROR
public static final int OTA_VERIFY_SIGN_SUCCESS
public static final int OTA_VERIFY_SIGN_ERROR
public static final int OTA_VERIFY_SIGN_PERCENTAGE
public static final int OTA_VERIFY_FILE_ERROR
public static final int OTA_CHECK_STATUS_OLD
public static final int OTA_CHECK_STATUS_NEW
public static final int OTA_CHECK_STATUS_SAME
public static final int OTA_CHECK_STATUS_GENERIC_ERROR
public static final int OTA_APPLY_FILE_ERROR
public static final int OTA_APPLY_IN_PROGRESS
public static final int ELO_GET_DEVICE_INFO
public static boolean isEloViewSDKExists(Context ctx)
ctx
- A context object of the calling Class (Activity/Service).public static java.lang.String getSDKVersion()
public static void silentPackageInstall(Context ctx, java.lang.String uri)
ctx
- A context object of the calling Class (Activity/Service).uri
- A uri pointing to the apk file which needs to be installed
silentlypublic static void silentPackageUninstall(Context ctx, java.lang.String packageName)
ctx
- A context object of the calling Class (Activity/Service).packageName
- The name of the package that needs to be uninstalledpublic static void silentReboot(Context ctx)
ctx
- A context object of the calling Class (Activity/Service).public static void captureScreenShot(Context ctx, BroadcastReceiver screenshotReceiver)
ctx
- A context object of the calling Class (Activity/Service).screenshotReceiver
- BroadcastReciever object to receive the screenshot location.public static void unsecurePackageInstall(Context ctx, java.lang.String uri)
ctx
- A context object of the calling Class (Activity/Service).uri
- APK file pathpublic static void getAECMOrientation(Context ctx, BroadcastReceiver orientationReceiver)
ctx
- A context object of the calling Class (Activity/Service).orientationReceiver
- A Receiver receives response of orientation JSON object.public static boolean setOrientation(Context ctx, java.lang.String orientation)
ctx
- A context object of the calling Class (Activity/Service).orientation
- value should be "landscape" or "portrait"public static java.lang.String getOrientation(Context ctx)
ctx
- A context object of the calling Class (Activity/Service).public static void setBrightness(Context ctx, int val)
val
- Integer value having range from 0 - 100public static int getBrightness(Context ctx)
ctx
- A context object of the calling Class (Activity/Service).brightnessReceiver
- to receive brightness valuepublic static void setVolume(Context ctx, int val)
ctx
- A context object of the calling Class (Activity/Service).val
- Integer value having range from 0 - 100public static int getVolume(Context ctx)
ctx
- A context object of the calling Class (Activity/Service).public static void getSerialNumber(Context ctx, BroadcastReceiver serialNumberReceiver)
ctx
- it must be Activity or Application contextserialNumberReceiver
- to receive device Serial Numberpublic static void getAddress(Context ctx, BroadcastReceiver addressReceiver)
ctx
- it must be Activity or Application contextaddressReceiver
- to receive device Addresspublic static void setLocale(Context ctx, java.lang.String localeStr)
ctx
- it must be Activity or Application contextlocaleStr
- it must be locale string format like "ja_JP". Currently tested
locale's "en_US" , "de_DE" , "es_ES" , "fr_FR" , "it_IT" ,
"zh_CN" , "ja_JP"public static void getLocale(Context ctx, BroadcastReceiver localeReceiver)
ctx
- it must be Activity or Application contextlocaleReceiver
- return value will be locale string format like "ja_JP". Currently tested
locale's "en_US" , "de_DE" , "es_ES" , "fr_FR" , "it_IT" ,
"zh_CN" , "ja_JP"public static boolean getDeviceInfo(Context ctx, Handler handler)
ctx
- it must be Activity or Application contexthandler
- to receive device information in properties format ( key/value format )public static java.lang.String getDeviceInfo(Context ctx)
ctx
- it must be Activity or Application contextpublic static boolean registerDeviceInfoReceiver(Context ctx, BroadcastReceiver deviceInfoReceiver)
ctx
- it must be Activity or Application contextdeviceInfoReceiver
- it must be BroadcastReceiver and it will return device info
parameters in key/val pair formatpublic static boolean unregisterDeviceInfoReceiver(Context ctx, BroadcastReceiver deviceInfoReceiver)
ctx
- it must be Activity or Application contextdeviceInfoReceiver
- it must be BroadcastReceiver that is registeredpublic static void screenTurnOn(Context ctx, int mode)
ctx
- it must be Activity or Application contextmode
- Integer value of mode defines the source to turn on the display
Default mode value is 0public static int setHeapGrowthLimit(Context ctx, int limit)
ctx
- it must be Activity or Application context.limit
- Integer value of limit defines the heap growth limit.
limit value should be greater than or equal to 192.
On fresh boot default value will be set to 192m.public static java.lang.String getHeapGrowthLimit(Context ctx)
ctx
- it must be Activity or Application contextpublic static int setHeapSize(Context ctx, int size)
ctx
- it must be Activity or Application contextsize
- Integer value of size defines the size of heap in MB.
size value should be between 512 to 1500.
On fresh boot default value will be set to 512m.public static java.lang.String getHeapSize(Context ctx)
ctx
- it must be Activity or Application contextpublic static int getMaxUSBport()
public static int setDevicePortsJSON(Context ctx, java.lang.String json)
ctx
- it must be Activity or Application contextjson
- JSON string should be poplulated with required device port status and should be passed as parameter. Sample JSON format can be found in EloView SDK Test App.public static int getDevicePortsStatusJSON(Context ctx, BroadcastReceiver devicePortStatusReceiver)
ctx
- it must be Activity or Application contextdevicePortStatusReceiver
- it must be BroadcastReceiver and registered broadcast receiver will return device port statuspublic static void startDownloadUpgradePackage(Context context, java.lang.String url, Handler handler)
ctx
- A context object of the calling Class (Activity/Service).url
- must be a string "http://server_url" or
"file://local_file_path"handler
- handler to receive msg's about download success,error or
download percentagepublic static void verifyOTA(Context ctx, Handler handler)
ctx
- A context object of the calling Class (Activity/Service).handler
- handler to receive msg's about verifying the signature of downloaded OTA file,
verification percentage.public static void applyOTA(Context ctx, Handler handler)
ctx
- A context object of the calling Class (Activity/Service).handler
- handler to receive msg's about file errorpublic static void checkOTAStatus(Context ctx, java.lang.String buildPropUrl, Handler handler)
ctx
- A context object of the calling Class (Activity/Service).buildPropUrl
- must be a string "http://build.prop_server_url" or "file://build.prop_local_file_path"
build.prop is mandatory to check OTA version./handler
- handler to receive msg's about OTA version whether it is new , old or same.public static void screenTurnOff(Context ctx, int mode)
ctx
- it must be Activity or Application contextmode
- Integer value of mode defines the source to turn on the display
Default mode value is 0