• RK Android7.1 电池电量


    一.adb查询电池信息

    adb shell dumpsys battery
    

      

     二.状态栏 电池图标

    2.1.布局

    frameworksasepackagesSystemUI eslayoutsystem_icons.xml

    2.2.SystemUI

    diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
    index 5047b78..c06abca 100755
    --- a/frameworks/base/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
    +++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
    @@ -54,7 +54,7 @@ public class BatteryMeterView extends ImageView implements
     
             mSlotBattery = context.getString(
                     com.android.internal.R.string.status_bar_battery);
    -        //setImageDrawable(mDrawable);  
    +        setImageDrawable(mDrawable); 
         }
    

    2.3.healthd 电池电量强制100

    diff --git a/system/core/healthd/BatteryMonitor.cpp b/system/core/healthd/BatteryMonitor.cpp
    index 2ad37c1..10f81c5 100755
    --- a/system/core/healthd/BatteryMonitor.cpp
    +++ b/system/core/healthd/BatteryMonitor.cpp
    @@ -240,9 +240,11 @@ bool BatteryMonitor::update(void) {
         else
             props.batteryPresent = mBatteryDevicePresent;
     
    -    props.batteryLevel = mBatteryFixedCapacity ?
    -        mBatteryFixedCapacity :
    -        getIntField(mHealthdConfig->batteryCapacityPath);
    +    //props.batteryLevel = mBatteryFixedCapacity ?
    +        //mBatteryFixedCapacity :
    +        //getIntField(mHealthdConfig->batteryCapacityPath);
    +		props.batteryLevel = 100;
    +		
         props.batteryVoltage = getIntField(mHealthdConfig->batteryVoltagePath) / 1000;
     
         if (!mHealthdConfig->batteryCurrentNowPath.isEmpty())
    

      

      

  • 相关阅读:
    数据库设计 一对多 多对多 无限级菜单 设计方法
    线程创建的四种方式
    Linux常用指令---grep(搜索过滤)
    Netty4实战
    linux查找日志技巧
    javascript---关于字符串和数组的方法
    angularJs---route
    JavaScript---详解scroll
    JavaScript--location
    socket中 emit和on的写法
  • 原文地址:https://www.cnblogs.com/crushgirl/p/14699406.html
Copyright © 2020-2023  润新知