BATTERY_HEALTH_COLD源码实例Demo

android.os.BatteryManager#BATTERY_HEALTH_COLD源码实例Demo

下面列出了android.os.BatteryManager#BATTERY_HEALTH_COLD 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: under-the-hood   文件: TypeTranslators.java
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 + ")";
    }
}
 
源代码2 项目: product-emm   文件: DeviceState.java
/**
 * 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;
}
 
源代码3 项目: MobileInfo   文件: BatteryInfo.java
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;
}
 
源代码4 项目: SensingKit-Android   文件: SKBatteryData.java
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";
        }
    }
 
源代码5 项目: Saiy-PS   文件: BatteryInformation.java
/**
 * 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();
    }
}