RK3288[android 7.1]调试笔记 Android 7.1 去掉设置里状态信息中的电池状态和电池电量选项

RK3288[android 7.1]调试笔记 Android 7.1 去掉设置里状态信息中的电池状态和电池电量选项

1 在路径为/packages/apps/Settings/res/xml/device_info_status.xml文件中屏蔽电池状态和电池电量选项布局


wangxd@build-server-100:~/work/dsy/rk3288-Android-7.0/packages/apps/Settings((465d84e...))$ git diff

diff --git a/res/xml/device_info_status.xml b/res/xml/device_info_status.xml
old mode 100644
new mode 100755
index a0b7590..ab23690
--- a/res/xml/device_info_status.xml
+++ b/res/xml/device_info_status.xml
@@ -17,18 +17,20 @@
 
 
-    
     
+        android:persistent="false" />-->

     

2 在路径为/packages/apps/Settings/src/com/android/settings/deviceinfo/Status.java 文件中 屏蔽电池状态和电池电量选项布局获取和获取后的相关事件


diff --git a/src/com/android/settings/deviceinfo/Status.java b/src/com/android/settings/deviceinfo/Status
old mode 100644
new mode 100755
index 1ba3978..6dfc671
--- a/src/com/android/settings/deviceinfo/Status.java
+++ b/src/com/android/settings/deviceinfo/Status.java
@@ -56,8 +56,8 @@ import java.lang.ref.WeakReference;
  */
 public class Status extends SettingsPreferenceFragment {
 
-    private static final String KEY_BATTERY_STATUS = "battery_status";
-    private static final String KEY_BATTERY_LEVEL = "battery_level";
+   //  private static final String KEY_BATTERY_STATUS = "battery_status";
+  //  private static final String KEY_BATTERY_LEVEL = "battery_level";
     private static final String KEY_IP_ADDRESS = "wifi_ip_address";
     private static final String KEY_WIFI_MAC_ADDRESS = "wifi_mac_address";
     private static final String KEY_BT_ADDRESS = "bt_address";
@@ -129,8 +129,8 @@ public class Status extends SettingsPreferenceFragment {
         public void onReceive(Context context, Intent intent) {
             String action = intent.getAction();
             if (Intent.ACTION_BATTERY_CHANGED.equals(action)) {
-                mBatteryLevel.setSummary(Utils.getBatteryPercentage(intent));
-                mBatteryStatus.setSummary(Utils.getBatteryStatus(getResources(), intent));
+             //   mBatteryLevel.setSummary(Utils.getBatteryPercentage(intent));
+             //   mBatteryStatus.setSummary(Utils.getBatteryStatus(getResources(), intent));
             }
         }
     };
@@ -164,8 +164,8 @@ public class Status extends SettingsPreferenceFragment {
         mWifiManager = (WifiManager) getSystemService(WIFI_SERVICE);
 
         addPreferencesFromResource(R.xml.device_info_status);
-        mBatteryLevel = findPreference(KEY_BATTERY_LEVEL);
-        mBatteryStatus = findPreference(KEY_BATTERY_STATUS);
+     //   mBatteryLevel = findPreference(KEY_BATTERY_LEVEL);
+      //  mBatteryStatus = findPreference(KEY_BATTERY_STATUS);
         mBtAddress = findPreference(KEY_BT_ADDRESS);
         mWifiMacAddress = findPreference(KEY_WIFI_MAC_ADDRESS);
         mWimaxMacAddress = findPreference(KEY_WIMAX_MAC_ADDRESS);

你可能感兴趣的:(嵌入式,RK32887.0)