RK3288[android 7.1]调试笔记 去掉开始后屏幕下侧显示的“已充满”

21 篇文章 5 订阅
9 篇文章 1 订阅

RK3288[android 7.1]调试笔记 去掉开始后屏幕下侧显示的“已充满”

屏蔽掉路径为/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java此文件的以下几句话

wangxd@build-server-100:~/work/dsy/rk3288-Android-7.0/frameworks/base/packages/SystemUI(m_android_7_0)$ git diff  src/com/android/systemui/statusbar/KeyguardIndicationController.java
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/Sy
old mode 100644
new mode 100755
index 0ef97152..3d3cbb3
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
@@ -170,12 +170,12 @@ public class KeyguardIndicationController {
                 mTextView.setTextColor(mTransientTextColor);
 
             } else if (mPowerPluggedIn) {
-                String indication = computePowerIndication();
-                if (DEBUG_CHARGING_SPEED) {
-                    indication += ",  " + (mChargingWattage / 1000) + " mW";
-                }
-                mTextView.switchIndication(indication);
-                mTextView.setTextColor(Color.WHITE);
+                // String indication = computePowerIndication(); //主要是 把computePowerIndication 这个显示充电时间函数给屏蔽掉
+                // if (DEBUG_CHARGING_SPEED) {
+                //     indication += ",  " + (mChargingWattage / 1000) + " mW";
+                // }
+                // mTextView.switchIndication(indication);
+                // mTextView.setTextColor(Color.WHITE);
 
             } else {
                 mTextView.switchIndication(mRestingIndication);
               mTextView.setTextColor(Color.WHITE);
            }
        }
    }
//这个函数是显示已充满,得到充电时间函数    
private String computePowerIndication() {
        if (mPowerCharged) {
            return mContext.getResources().getString(R.string.keyguard_charged);//这里会获取已充满的字符串资源
        }

        // Try fetching charging time from battery stats.
        long chargingTimeRemaining = 0;
        try {
            chargingTimeRemaining = mBatteryInfo.computeChargeTimeRemaining();

        } catch (RemoteException e) {
            Log.e(TAG, "Error calling IBatteryStats: ", e);
        }
        final boolean hasChargingTime = chargingTimeRemaining > 0;

        int chargingId;
        switch (mChargingSpeed) {
            case KeyguardUpdateMonitor.BatteryStatus.CHARGING_FAST:
                chargingId = hasChargingTime
                        ? R.string.keyguard_indication_charging_time_fast
                        : R.string.keyguard_plugged_in_charging_fast;
                break;
            case KeyguardUpdateMonitor.BatteryStatus.CHARGING_SLOWLY:
                chargingId = hasChargingTime
                        ? R.string.keyguard_indication_charging_time_slowly
                        : R.string.keyguard_plugged_in_charging_slowly;
                break;
            default:
                chargingId = hasChargingTime
                        ? R.string.keyguard_indication_charging_time
                        : R.string.keyguard_plugged_in;
                break;
        }

        if (hasChargingTime) {
            String chargingTimeFormatted = Formatter.formatShortElapsedTimeRoundingUpToMinutes(
                    mContext, chargingTimeRemaining);
            return mContext.getResources().getString(chargingId, chargingTimeFormatted);
        } else {
            return mContext.getResources().getString(chargingId);
        }
    }
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值