Package com.unitech.api.power
Class PowerCtrl
- java.lang.Object
-
- com.unitech.api.power.PowerCtrl
-
public class PowerCtrl extends java.lang.ObjectThe type Power ctrl.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBUNDLE_ERROR_CODEstatic java.lang.StringBUNDLE_ERROR_MSGstatic intRESULT_CODE_ERRORstatic intRESULT_CODE_SUCCESS
-
Constructor Summary
Constructors Constructor Description PowerCtrl(android.content.Context context)Instantiates a new Power ctrl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description android.os.BundleacquireWakeLock(long timeout)Acquires the wake lock.android.os.BundleColdBoot()Factory Resetandroid.os.BundlereleaseWakeLock()Releases the wake lock.
This method releases your claim to the CPU or screen being on.
The screen may turn off shortly after you release the wake lock, or it may not if there are other wake locks still held.android.os.BundleWarmBoot()Warm boot
-
-
-
Field Detail
-
BUNDLE_ERROR_CODE
public static final java.lang.String BUNDLE_ERROR_CODE
- See Also:
- Constant Field Values
-
BUNDLE_ERROR_MSG
public static final java.lang.String BUNDLE_ERROR_MSG
- See Also:
- Constant Field Values
-
RESULT_CODE_ERROR
public static final int RESULT_CODE_ERROR
- See Also:
- Constant Field Values
-
RESULT_CODE_SUCCESS
public static final int RESULT_CODE_SUCCESS
- See Also:
- Constant Field Values
-
-
Method Detail
-
ColdBoot
public android.os.Bundle ColdBoot()
Factory Reset- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
boolean Result = bundle.getBoolean("Result");
-
WarmBoot
public android.os.Bundle WarmBoot()
Warm boot- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
boolean Result = bundle.getBoolean("Result");
-
acquireWakeLock
public android.os.Bundle acquireWakeLock(long timeout)
Acquires the wake lock.
Ensures that the device is on at the PARTIAL_WAKE_LOCK level that the CPU is running; the screen and keyboard backlight will be allowed to go off.
The lock will be released after the given timeout expires if timeout is greater than 0.
The application which called this method with a 0 timeout must call releaseWakeLock() itself to avoid running down the device's battery excessively.- Parameters:
timeout- The timeout after which to release the wake lock, in milliseconds.
Set 0 then the power manager won't release this wake lock automatically.- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
boolean Result = bundle.getBoolean("Result");
-
releaseWakeLock
public android.os.Bundle releaseWakeLock()
Releases the wake lock.
This method releases your claim to the CPU or screen being on.
The screen may turn off shortly after you release the wake lock, or it may not if there are other wake locks still held.- Returns:
- A bundle contains the error code and message
int erroeCode = bundle.getInt("errorCode"), (error:1, success=0)
String errorMsg=bundle.getString("errorMsg");
boolean Result = bundle.getBoolean("Result");
-
-