Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 083e1d9e authored by Mitchell Wills's avatar Mitchell Wills
Browse files

Fix incorrect default wifi power draw values

Bug: 22848679
Change-Id: Ief4e3e05b051b93efbe30fdc8903cce6765d2ed8
parent 845d14db
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -57,6 +57,11 @@ public class WifiPowerCalculator extends PowerCalculator {
                statsType);
        app.wifiTxBytes = u.getNetworkActivityBytes(BatteryStats.NETWORK_WIFI_TX_DATA,
                statsType);

        if (DEBUG && app.wifiPowerMah != 0) {
            Log.d(TAG, "UID " + u.getUid() + ": idle=" + idleTime + "ms rx=" + rxTime + "ms tx=" +
                    txTime + "ms power=" + BatteryStatsHelper.makemAh(app.wifiPowerMah));
        }
    }

    @Override
+7 −0
Original line number Diff line number Diff line
@@ -16,11 +16,14 @@
package com.android.internal.os;

import android.os.BatteryStats;
import android.util.Log;

/**
 * Estimates WiFi power usage based on timers in BatteryStats.
 */
public class WifiPowerEstimator extends PowerCalculator {
    private static final boolean DEBUG = BatteryStatsHelper.DEBUG;
    private static final String TAG = "WifiPowerEstimator";
    private final double mWifiPowerPerPacket;
    private final double mWifiPowerOn;
    private final double mWifiPowerScan;
@@ -75,6 +78,10 @@ public class WifiPowerEstimator extends PowerCalculator {
        }

        app.wifiPowerMah = wifiPacketPower + wifiLockPower + wifiScanPower + wifiBatchScanPower;
        if (DEBUG && app.wifiPowerMah != 0) {
            Log.d(TAG, "UID " + u.getUid() + ": power=" +
                    BatteryStatsHelper.makemAh(app.wifiPowerMah));
        }
    }

    @Override
+4 −4
Original line number Diff line number Diff line
@@ -501,16 +501,16 @@
    <bool translatable="false" name="config_wifi_ssid_white_list_enable">true</bool>

    <!-- Idle Receive current for wifi radio. 0 by default-->
    <integer translatable="false" name="config_wifi_idle_receive_cur_ma">1</integer>
    <integer translatable="false" name="config_wifi_idle_receive_cur_ma">0</integer>

    <!-- Rx current for wifi radio. 0 by default-->
    <integer translatable="false" name="config_wifi_active_rx_cur_ma">2</integer>
    <integer translatable="false" name="config_wifi_active_rx_cur_ma">0</integer>

    <!-- Tx current for wifi radio. 0 by default-->
    <integer translatable="false" name="config_wifi_tx_cur_ma">3</integer>
    <integer translatable="false" name="config_wifi_tx_cur_ma">0</integer>

    <!-- Operating volatage for wifi radio. 0 by default-->
    <integer translatable="false" name="config_wifi_operating_voltage_mv">4</integer>
    <integer translatable="false" name="config_wifi_operating_voltage_mv">0</integer>

    <!-- Flag indicating whether the we should enable the automatic brightness in Settings.
         Software implementation will be used if config_hardware_auto_brightness_available is not set -->