java.lang.Object | |
↳ | com.samsung.android.knox.deviceinfo.DeviceInventory |
This class provides APIs to retrieve information on the device inventory.
API level 2 |
MDM 2.0 |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ACTION_SIM_CARD_CHANGED | Deprecated in API level 37 | |||||||||
String | EXTRA_SIM_CHANGE_INFO | The lookup key for a SimChangeInfo object. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
API to retrieve the number of dropped calls.
| |||||||||||
API to get Knox Service ID.
| |||||||||||
Deprecated
in API level 35
| |||||||||||
API to retrieve the number of missed calls.
| |||||||||||
API to get the Samsung CSC Code.
| |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since Android 11. | |||||||||||
API to retrieve the number of calls completed successfully.
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 30
| |||||||||||
Deprecated
in API level 30
| |||||||||||
API to reset the counters that tally call counts.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Deprecated in API level 37
Broadcast Action: The sim card has changed. The intent will have the following extra values:
The parcelable extraEXTRA_SIM_CHANGE_INFO
is
also contained in this intent which identifies the type of sim change
operation, the time of change and old and new sim card data.API level 2 |
MDM 2.0 |
The lookup key for a SimChangeInfo
object.
API level 2 |
MDM 2.0 |
Deprecated in API level 35
API to retrieve the available capacity in bytes of the external SD card.
An administrator can use this API to get the available capacity of the external SD card.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DeviceInventory deviceInventoryPolicy = edm.getDeviceInventory(); long bytes = deviceInventoryPolicy.getAvailableCapacityExternal(); |
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 35
API to retrieve the available capacity in bytes of the internal SD card and phone memory.
An administrator can use this API to get the available capacity of the internal SD card
and phone memory.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DeviceInventory deviceInventoryPolicy = edm.getDeviceInventory(); long bytes = deviceInventoryPolicy.getAvailableCapacityInternal(); |
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 35
API to retrieve the operating system.
null
.An administrator can use this API to determine the operating system.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DeviceInventory deviceInventoryPolicy = edm.getDeviceInventory(); String deviceOS = deviceInventoryPolicy.getDeviceOS(); if(null != deviceOS) { //if device operating system is set it is returned else null. } // Sample Output // Linux |
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 35
API to retrieve the operating system version of the device.
null
.An administrator can use this API to get the operating system version of the device.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DeviceInventory deviceInventoryPolicy = edm.getDeviceInventory(); String deviceOSVersion = deviceInventoryPolicy.getDeviceOSVersion(); if(null != deviceOSVersion) { //if device operating system version is set it is returned //else null. } // Sample Output // 2.6.35.7 |
API level 2 |
MDM 2.0 |
Global Scope |
API to retrieve the number of dropped calls.
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to get the number of dropped calls.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DeviceInventory deviceInventoryPolicy = edm.getDeviceInventory(); int droppedCallsCount = deviceInventoryPolicy.getDroppedCallsCount(); if(0 <= droppedCallsCount) { //print dropped call count } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_INVENTORY" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
API to get Knox Service ID.
null
or an empty String
An app can use this API to get Knox service ID defined by Knox Cloud Services.
To use this API, the app must be registered in allowed list by the Knox Cloud Services.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DeviceInventory deviceInventoryPolicy = edm.getDeviceInventory(); String id = deviceInventoryPolicy.getKnoxServiceId(); if (!TextUtils.isEmpty(id)) { // Knox Service ID is set } |
API level 33 |
Global Scope |
Deprecated in API level 35
API to get SIM card information regarding the last time that the card was changed.
null
.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to detect SIM card-related changes including removal and insertion
and take appropriate action based on enterprise policy.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DeviceInventory devInv = edm.getDeviceInventory(); try { SimChangeInfo sci = devInv.getLastSimChangeInfo(); //print SIM change Info Log.d(TAG,"changeTime : " + sci.changeTime); Log.d(TAG,"previousSimInfo.countryIso : " +sci.previousSimInfo.countryIso); Log.d(TAG,"previousSimInfo.operator : " + sci.previousSimInfo.operator); Log.d(TAG,"previousSimInfo.operatorName : " + sci.previousSimInfo.operatorName); Log.d(TAG,"previousSimInfo.phoneNumber : " + sci.previousSimInfo.phoneNumber); Log.d(TAG,"previousSimInfo.serialNumber :" + sci.previousSimInfo.serialNumber); Log.d(TAG,"currentSimInfo.countryIso : " + sci.currentSimInfo.countryIso); Log.d(TAG,"currentSimInfo.operator : " + sci.currentSimInfo.operator); Log.d(TAG,"currentSimInfo.operatorName : " + sci.currentSimInfo.operatorName); Log.d(TAG,"currentSimInfo.phoneNumber : " + sci.currentSimInfo.phoneNumber); Log.d(TAG,"currentSimInfo.serialNumber :" + sci.currentSimInfo.serialNumber); } catch(SecurityException e) { Log.w(TAG,"SecurityException: "+e); } // Sample Output: // changeTime :1322738274410 // previousSimInfo.countryIso :in // previousSimInfo.operator :40471 // previousSimInfo.operatorName :BSNL MOBILE // previousSimInfo.serialNumber :89917110359178254573 // currentSimInfo.countryIso :in // currentSimInfo.operator :40471 // previousSimInfo.operatorName :BSNL MOBILE // currentSimInfo.phoneNumbe :8088548602 // currentSimInfo.serialNumber :89917110349178255375 |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_INVENTORY" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
API to retrieve the number of missed calls.
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to get the number of missed calls.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DeviceInventory deviceInventoryPolicy = edm.getDeviceInventory(); int missedCallsCount = deviceInventoryPolicy.getMissedCallsCount(); if(0 <= missedCallsCount) { //print missed call count } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_INVENTORY" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
API to get the Samsung CSC Code.
An administrator can use this API to get the Samsung CSC(Consumer Software Customization) code
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DeviceInventory devInv = edm.getDeviceInventory(); String result = devInv.getSalesCode(); if(result != null && result.equals("SKT"){ // SKT device }else if(result != null && result.equals("SPR"){ // Sprint device } |
API level 20 |
MDM 5.7 |
Global Scope |
Deprecated
in API level 30
NOTE: This API is not available since Android 11.
API to retrieve the device serial number.
null
.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to get the device serial number, which is embedded in the hardware.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DeviceInventory deviceInventoryPolicy = edm.getDeviceInventory(); String serialNumber = deviceInventoryPolicy.getSerialNumber(); if(null != serialNumber) { //if serial number is set it is returned. } // Sample Output // 1234567890 |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_INVENTORY" permission which has a protection level of signature. (Since Knox API level 26) |
API level 2 |
MDM 2.0 |
User Scope |
API to retrieve the number of calls completed successfully.
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to get the number of calls completed successfully.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DeviceInventory deviceInventoryPolicy = edm.getDeviceInventory(); int successCallsCount = deviceInventoryPolicy.getSuccessCallsCount(); if(0 <= successCallsCount) { //print successful call count } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_INVENTORY" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 35
API to retrieve the total capacity in bytes of the external SD card.
An administrator can use this API to get the total capacity of the external SD card.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DeviceInventory deviceInventoryPolicy = edm.getDeviceInventory(); long bytes = deviceInventoryPolicy.getTotalCapacityExternal(); |
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 35
API to retrieve the total capacity in bytes of the internal SD card and phone memory.
An administrator can use this API to get the total capacity of the internal SD card
and phone memory.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DeviceInventory deviceInventoryPolicy = edm.getDeviceInventory(); long bytes = deviceInventoryPolicy.getTotalCapacityInternal(); |
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 30
API to check whether device is currently locked.
true
if device is locked, false
if device is unlockedAn administrator can use this API to check whether the device is currently locked.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DeviceInventory deviceInventoryPolicy = edm.getDeviceInventory(); boolean result = deviceInventoryPolicy.isDeviceLocked(); if(true == result) { //device is locked } |
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 30
API to check whether a device is secured by a password, PIN, or pattern.
true
if device is protected, false
if device is not
protectedSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to check whether the device is secure. To
secure the device, the administrator can silently set the password, PIN, or pattern.
EnterpriseDeviceManager edm = (EnterpriseDeviceManager)getSystemService( EnterpriseDeviceManager.ENTERPRISE_POLICY_SERVICE); DeviceInventory deviceInventoryPolicy = edm.getDeviceInventory(); boolean result = deviceInventoryPolicy.isDeviceSecure(); if(true == result) { //device is secure } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_INVENTORY" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
API to reset the counters that tally call counts.
true
if call count reset successfully, else false
.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to reset the counters that tally calls count.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DeviceInventory deviceInventoryPolicy = edm.getDeviceInventory(); boolean result = deviceInventoryPolicy.resetCallsCount(); if(true == result) { //call log reset } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_INVENTORY" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |