Java Code Examples for android.os.BatteryManager#BATTERY_HEALTH_COLD
The following examples show how to use
android.os.BatteryManager#BATTERY_HEALTH_COLD .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TypeTranslators.java From under-the-hood with Apache License 2.0 | 6 votes |
public static String translateBatteryHealth(int batteryHealth) { switch (batteryHealth) { case BatteryManager.BATTERY_HEALTH_UNKNOWN: return "UNKNOWN HEALTH"; case BatteryManager.BATTERY_HEALTH_GOOD: return "GOOD"; case BatteryManager.BATTERY_HEALTH_OVERHEAT: return "OVERHEAT"; case BatteryManager.BATTERY_HEALTH_DEAD: return "DEAD"; case BatteryManager.BATTERY_HEALTH_OVER_VOLTAGE: return "OVER VOLTAGE"; case BatteryManager.BATTERY_HEALTH_UNSPECIFIED_FAILURE: return "UNSPECIFIED FAILURE"; case BatteryManager.BATTERY_HEALTH_COLD: return "COLD"; default: return "UNKNOWN (" + batteryHealth + ")"; } }
Example 2
Source File: DeviceState.java From product-emm with Apache License 2.0 | 6 votes |
/** * Conversion from health condition int to String can be done through this method. * * @param health integer representing the health condition. * @return String representing the health condition. */ private String getHealth(int health) { String healthString = UNKNOWN; switch (health) { case BatteryManager.BATTERY_HEALTH_COLD: healthString = COLD; break; case BatteryManager.BATTERY_HEALTH_DEAD: healthString = DEAD; break; case BatteryManager.BATTERY_HEALTH_GOOD: healthString = GOOD_CONDITION; break; case BatteryManager.BATTERY_HEALTH_OVER_VOLTAGE: healthString = OVER_VOLTAGE; break; case BatteryManager.BATTERY_HEALTH_OVERHEAT: healthString = OVER_HEAT; break; case BatteryManager.BATTERY_HEALTH_UNSPECIFIED_FAILURE: healthString = FAILURE; break; } return healthString; }
Example 3
Source File: BatteryInfo.java From MobileInfo with Apache License 2.0 | 5 votes |
private static String batteryHealth(int health) { String healthBat = BaseData.UNKNOWN_PARAM; switch (health) { case BatteryManager.BATTERY_HEALTH_COLD: healthBat = "cold"; break; case BatteryManager.BATTERY_HEALTH_DEAD: healthBat = "dead"; break; case BatteryManager.BATTERY_HEALTH_GOOD: healthBat = "good"; break; case BatteryManager.BATTERY_HEALTH_OVER_VOLTAGE: healthBat = "overVoltage"; break; case BatteryManager.BATTERY_HEALTH_OVERHEAT: healthBat = "overheat"; break; case BatteryManager.BATTERY_HEALTH_UNKNOWN: healthBat = "unknown"; break; case BatteryManager.BATTERY_HEALTH_UNSPECIFIED_FAILURE: healthBat = "unspecified"; break; default: break; } return healthBat; }
Example 4
Source File: SKBatteryData.java From SensingKit-Android with GNU Lesser General Public License v3.0 | 5 votes |
private String getBatteryHealthString(int health) { switch (health) { case BatteryManager.BATTERY_HEALTH_COLD: return "cold"; case BatteryManager.BATTERY_HEALTH_DEAD: return "dead"; case BatteryManager.BATTERY_HEALTH_GOOD: return "good"; case BatteryManager.BATTERY_HEALTH_OVERHEAT: return "over heat"; case BatteryManager.BATTERY_HEALTH_OVER_VOLTAGE: return "over voltage"; case BatteryManager.BATTERY_HEALTH_UNKNOWN: return "unknown"; case BatteryManager.BATTERY_HEALTH_UNSPECIFIED_FAILURE: return "failure"; default: return "unsupported"; } }
Example 5
Source File: BatteryInformation.java From Saiy-PS with GNU Affero General Public License v3.0 | 4 votes |
/** * Method to resolve the battery health */ private void getHealth() { if (DEBUG) { MyLog.i(CLS_NAME, "getHealth"); } if (batteryIntent != null) { final SaiyResources sr = new SaiyResources(mContext, sl); final int health = batteryIntent.getIntExtra(BatteryManager.EXTRA_HEALTH, BatteryManager.BATTERY_HEALTH_UNKNOWN); switch (health) { case BatteryManager.BATTERY_HEALTH_COLD: setHealthResponse(sr.getString(ai.saiy.android.R.string.cold)); break; case BatteryManager.BATTERY_HEALTH_DEAD: setHealthResponse(sr.getString(ai.saiy.android.R.string.dead)); break; case BatteryManager.BATTERY_HEALTH_GOOD: setHealthResponse(sr.getString(ai.saiy.android.R.string.good)); break; case BatteryManager.BATTERY_HEALTH_OVERHEAT: setHealthResponse(sr.getString(ai.saiy.android.R.string.over_heating)); break; case BatteryManager.BATTERY_HEALTH_OVER_VOLTAGE: setHealthResponse(sr.getString(ai.saiy.android.R.string.over_voltage)); break; case BatteryManager.BATTERY_HEALTH_UNKNOWN: setHealthResponse(sr.getString(ai.saiy.android.R.string.currently_indeterminable)); break; case BatteryManager.BATTERY_HEALTH_UNSPECIFIED_FAILURE: setHealthResponse(sr.getString(ai.saiy.android.R.string.currently_indeterminable)); break; default: setHealthResponse(sr.getString(ai.saiy.android.R.string.currently_indeterminable)); break; } sr.reset(); } else { if (DEBUG) { MyLog.w(CLS_NAME, "batteryIntent: null"); } setAccessFailure(); } }