Merge "Removing BatteryStatsImpl lock that causes a deadlock" into rvc-dev

This commit is contained in:
Dmitri Plotnikov
2020-04-21 23:36:39 +00:00
committed by Android (Google) Code Review
2 changed files with 3 additions and 4 deletions

View File

@@ -6093,7 +6093,8 @@ public class BatteryStatsImpl extends BatteryStats {
return array; return array;
} }
public void noteNetworkInterfaceTypeLocked(String iface, int networkType) { /** @hide */
public void noteNetworkInterfaceType(String iface, int networkType) {
if (TextUtils.isEmpty(iface)) return; if (TextUtils.isEmpty(iface)) return;
synchronized (mModemNetworkLock) { synchronized (mModemNetworkLock) {

View File

@@ -1013,9 +1013,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub
@Override @Override
public void noteNetworkInterfaceType(String iface, int networkType) { public void noteNetworkInterfaceType(String iface, int networkType) {
enforceCallingPermission(); enforceCallingPermission();
synchronized (mStats) { mStats.noteNetworkInterfaceType(iface, networkType);
mStats.noteNetworkInterfaceTypeLocked(iface, networkType);
}
} }
@Override @Override