Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## android.device
Class DeviceManager

    java.lang.Object
      android.device.DeviceManager

    public class DeviceManager

extends java.lang.Object

The DeviceManager class provides support to get and set the device configurations.
System interface extension:

Startup the system to check whether the OTA server has any new updates: `try { // Get component info and create ComponentName String packageName = "com.qualcomm.update";` String className = "com.qualcomm.update.NotificationService"; ComponentName component = new ComponentName(packageName, className); // Create a new intent. Use the old one for extras and such reuse Intent explicitIntent = new Intent(); // Set the component to be explicit // Set the Extra to be explicit explicitIntent.putExtra("action", "com.qualcomm.update.BACKGROUND_CHECK"); explicitIntent.setComponent(component); startService(explicitIntent); }catch (Exception e){ }

Update System FW from local OTA zip file: `try { // Create a new intent Intent explicitIntent = new Intent("com.osupdate.upgraderom");` // Set the Extra to be explicit intent.putExtra("fullfilename", "sdcard/ota.zip"); sendBroadcast(intent); }catch (Exception e){ }

Constructor Summary
`DeviceManager()`

Method Summary
`void` | `enableHomeKey(boolean enable)` Enable/Disable device HOME KEY
`void` | `enableStatusBar(boolean enable)` Enable/Disable the device status bar
`java.lang.String` | `getDeviceId()` Get the device product serial number
`boolean` | `getDockerState()` Support i9000S(Android 4.3/Android5.1) only.Return the currently active docking station connected state .
`java.lang.String` | `getTIDSN()`
`boolean` | `setAPN(java.lang.String name, java.lang.String apn, java.lang.String proxy, int port, java.lang.String user, java.lang.String server, java.lang.String password, java.lang.String mmsc, java.lang.String mcc, java.lang.String mnc, java.lang.String mmsproxy, int mmsport, int authtype, java.lang.String type, java.lang.String protocol, int bearer, java.lang.String roamingprotocol, boolean current)` Sets the APN (access point name) configurations for mobile data network
`boolean` | `setCurrentTime(long when)` Sets the current wall time, in milliseconds.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DeviceManager

    public DeviceManager()

Method Detail

### getDeviceId

    public java.lang.String getDeviceId()

  Get the device product serial number

  Returns:
    in the form of 14 alphanumeric characters.

### getTIDSN

    public java.lang.String getTIDSN()

### setCurrentTime

    public boolean setCurrentTime(long when)

  Sets the current wall time, in milliseconds.

  Parameters:
    `when` - in milliseconds

### enableHomeKey

    public void enableHomeKey(boolean enable)

  Enable/Disable device HOME KEY

  Parameters:
    `enable` - value: false disable the Home KEY function. device reboot the state miss.
    Example in your project Activity:
    `protected void onCreate(Bundle savedInstanceState) {`
    `super.onCreate(savedInstanceState);`
    `new DeviceManager().enableHomeKey(false);`
    `}`
    You can revert the home key when exit your application . `protected void onDestroy() {`
    `new DeviceManager().enableHomeKey(true);`
    `}`

### enableStatusBar

    public void enableStatusBar(boolean enable)

  Enable/Disable the device status bar

  Parameters:
    `enable` - Set to true to enable the status bar. Set to false to disable the status bar expand. Note This status is not persistent. It will revert to the default condition (which is the enabled state) at th next reboot

### setAPN

    public boolean setAPN(java.lang.String name,
                          java.lang.String apn,
                          java.lang.String proxy,
                          int port,
                          java.lang.String user,
                          java.lang.String server,
                          java.lang.String password,
                          java.lang.String mmsc,
                          java.lang.String mcc,
                          java.lang.String mnc,
                          java.lang.String mmsproxy,
                          int mmsport,
                          int authtype,
                          java.lang.String type,
                          java.lang.String protocol,
                          int bearer,
                          java.lang.String roamingprotocol,
                          boolean current)

  Sets the APN (access point name) configurations for mobile data network

  Parameters:
    `apn` - APN name. Cannot be null.
    `authtype` - Authentication type. Value:0(none) 1(PAP) 2(CHAP) 3(PAP or CHAP)
    `bearer` - BEARER Radio Access Technology info.value: 0(none) 13(eHRPD) 14(LTE)
    `mcc` - Mobile Country Code (MCC).
    `mmsc` - MMSC URL.
    `mmsproxy` - MMS proxy address.
    `mmsport` - MMS proxy port.
    `mnc` - MNC Mobile Network Code (MNC). Cannot be null
    `name` - Entry name. Cannot be null
    `password` - APN password.
    `port` - Proxy port.
    `protocol` - The protocol to use to connect to this APN. value: IP IPv6 or IPv4v6
    `proxy` - Proxy address.
    `roamingprotocol` - The protocol to use to connect to this APN when roaming.
    `server` - Server address.
    `type` - Comma-delimited list of APN types.
    `user` - APN username.
    `current` - enable current set this APN
  Returns:
    Returns true if successful. Returns false if failed.

### getDockerState

    public boolean getDockerState()

  Support i9000S(Android 4.3/Android5.1) only.Return the currently active docking station connected state . Default return false when runing on other devices.

  Returns:
    true The device is in Ethernet mode or USB Host mode

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD