am 4ab2c777: Merge change I14fb81af into eclair

Merge commit '4ab2c7770c8e55072ee7a083fa84e318e07c8c3e' into eclair-mr2

* commit '4ab2c7770c8e55072ee7a083fa84e318e07c8c3e':
  Fix for 2221718: Hang in BatteryStatsService.noteBluetoothOn
This commit is contained in:
Amith Yamasani
2009-11-05 13:55:33 -08:00
committed by Android Git Automerger

View File

@@ -16,6 +16,7 @@
package com.android.server.am;
import android.bluetooth.BluetoothHeadset;
import android.content.Context;
import android.os.Binder;
import android.os.IBinder;
@@ -23,7 +24,6 @@ import android.os.Parcel;
import android.os.Process;
import android.os.ServiceManager;
import android.telephony.SignalStrength;
import android.telephony.TelephonyManager;
import android.util.Log;
import com.android.internal.app.IBatteryStats;
@@ -263,9 +263,10 @@ public final class BatteryStatsService extends IBatteryStats.Stub {
public void noteBluetoothOn() {
enforceCallingPermission();
BluetoothHeadset headset = new BluetoothHeadset(mContext, null);
synchronized (mStats) {
mStats.noteBluetoothOnLocked();
mStats.setBtHeadset(new android.bluetooth.BluetoothHeadset(mContext, null));
mStats.setBtHeadset(headset);
}
}