|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.device.DeviceManager
public class DeviceManager
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 |
---|
public DeviceManager()
Method Detail |
---|
public java.lang.String getDeviceId()
public java.lang.String getTIDSN()
public boolean setCurrentTime(long when)
when
- in millisecondspublic void enableHomeKey(boolean enable)
enable
- value: false disable the Home KEY function. device reboot the state miss.
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  new DeviceManager().enableHomeKey(false);
}
protected void onDestroy() {
  new DeviceManager().enableHomeKey(true);
}
public void enableStatusBar(boolean enable)
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 rebootpublic 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)
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 nullname
- Entry name. Cannot be nullpassword
- APN password.port
- Proxy port.protocol
- The protocol to use to connect to this APN. value: IP IPv6 or IPv4v6proxy
- 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
public boolean getDockerState()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |