zoukankan      html  css  js  c++  java
  • 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())
    

      

      

  • 相关阅读:
    C# 学习历程——接口
    C# 学习历程——类的封装,继承与多态
    C# 学习历程——C#基础
    C# 学习历程——Hello World
    python(14)---发邮件、写日志、操作redis数据库
    python(13)——内置函数
    python(12)---导入模块
    HTML操作之DOM操作
    HTML基础之CSS
    HTML基础之HTML标签
  • 原文地址:https://www.cnblogs.com/crushgirl/p/14699406.html
Copyright © 2011-2022 走看看