From 2a91e4aabccd260655ecd2e3dc7f00044e8ca250 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 31 Mar 2016 16:33:54 -0700 Subject: [PATCH] power_profile: Move all wifi power values Move over all wifi related power values to power_profile.xml from config.xml. If these parameters are present in both the xml files, we ignore the one in config.xml, else we fall back to config.xml value. Also add wifi tx level battery consumption BUG: 27227497 Change-Id: I331dcdf5694740b951298b61c3105952b884690a --- .../com/android/internal/os/PowerProfile.java | 9 +++++- core/res/res/xml/power_profile.xml | 28 +++++++++++++++---- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/core/java/com/android/internal/os/PowerProfile.java b/core/java/com/android/internal/os/PowerProfile.java index 14ebe227f3b42..79138b7b3fbd8 100644 --- a/core/java/com/android/internal/os/PowerProfile.java +++ b/core/java/com/android/internal/os/PowerProfile.java @@ -85,6 +85,7 @@ public class PowerProfile { public static final String POWER_WIFI_CONTROLLER_IDLE = "wifi.controller.idle"; public static final String POWER_WIFI_CONTROLLER_RX = "wifi.controller.rx"; public static final String POWER_WIFI_CONTROLLER_TX = "wifi.controller.tx"; + public static final String POWER_WIFI_CONTROLLER_TX_LEVELS = "wifi.controller.tx_levels"; public static final String POWER_WIFI_CONTROLLER_OPERATING_VOLTAGE = "wifi.controller.voltage"; public static final String POWER_BLUETOOTH_CONTROLLER_IDLE = "bluetooth.controller.idle"; @@ -287,9 +288,15 @@ public class PowerProfile { }; for (int i = 0; i < configResIds.length; i++) { + String key = configResIdKeys[i]; + // if we already have some of these parameters in power_profile.xml, ignore the + // value in config.xml + if ((sPowerMap.containsKey(key) && (Double) sPowerMap.get(key) > 0)) { + continue; + } int value = resources.getInteger(configResIds[i]); if (value > 0) { - sPowerMap.put(configResIdKeys[i], (double) value); + sPowerMap.put(key, (double) value); } } } diff --git a/core/res/res/xml/power_profile.xml b/core/res/res/xml/power_profile.xml index 76b5fe1e1b55e..2e593a3dc6e85 100644 --- a/core/res/res/xml/power_profile.xml +++ b/core/res/res/xml/power_profile.xml @@ -94,11 +94,27 @@ 1000 - - .0002 - .002 - .02 - .2 - 2 + + + 0 + + 0 + + 0 + + + + 0 + + + .0002 + .002 + .02 + .2 + 2 + +