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

Commit 8f68075e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Check for Wifi's power stats capabilities before asking for it."

parents 2b002d08 a8c34e14
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@
 */
package com.android.server.am;

import static android.net.wifi.WifiManager.WIFI_FEATURE_LINK_LAYER_STATS;

import android.annotation.Nullable;
import android.bluetooth.BluetoothActivityEnergyInfo;
import android.bluetooth.BluetoothAdapter;
@@ -410,8 +412,11 @@ class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStatsSync {

            if (mWifiManager != null) {
                try {
                    // Only fetch WiFi power data if it is supported.
                    if ((mWifiManager.getSupportedFeatures() & WIFI_FEATURE_LINK_LAYER_STATS) != 0) {
                        wifiReceiver = new SynchronousResultReceiver("wifi");
                        mWifiManager.requestActivityInfo(wifiReceiver);
                    }
                } catch (RemoteException e) {
                    // Oh well.
                }