RK3288[android 7.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);
        }
    }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章