Loading services/java/com/android/server/WifiService.java +18 −11 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static android.net.wifi.WifiManager.WIFI_STATE_UNKNOWN; import android.app.AlarmManager; import android.app.PendingIntent; import android.bluetooth.BluetoothA2dp; import android.bluetooth.BluetoothDevice; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; Loading Loading @@ -62,6 +63,7 @@ import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.regex.Pattern; import java.io.FileDescriptor; import java.io.PrintWriter; Loading Loading @@ -1380,11 +1382,16 @@ public class WifiService extends IWifiManager.Stub { } mPluggedType = pluggedType; } else if (action.equals(BluetoothA2dp.ACTION_SINK_STATE_CHANGED)) { boolean isBluetoothPlaying = intent.getIntExtra( BluetoothA2dp.EXTRA_SINK_STATE, BluetoothA2dp.STATE_DISCONNECTED) == BluetoothA2dp.STATE_PLAYING; BluetoothA2dp a2dp = new BluetoothA2dp(mContext); Set<BluetoothDevice> sinks = a2dp.getConnectedSinks(); boolean isBluetoothPlaying = false; for (BluetoothDevice sink : sinks) { if (a2dp.getSinkState(sink) == BluetoothA2dp.STATE_PLAYING) { isBluetoothPlaying = true; } } mWifiStateTracker.setBluetoothScanMode(isBluetoothPlaying); } else { return; } Loading services/java/com/android/server/status/StatusBarPolicy.java +11 −10 Original line number Diff line number Diff line Loading @@ -283,7 +283,7 @@ public class StatusBarPolicy { private IBinder mBluetoothIcon; private IconData mBluetoothData; private int mBluetoothHeadsetState; private int mBluetoothA2dpState; private boolean mBluetoothA2dpConnected; private int mBluetoothPbapState; private boolean mBluetoothEnabled; Loading Loading @@ -455,7 +455,7 @@ public class StatusBarPolicy { } else { mBluetoothEnabled = false; } mBluetoothA2dpState = BluetoothA2dp.STATE_DISCONNECTED; mBluetoothA2dpConnected = false; mBluetoothHeadsetState = BluetoothHeadset.STATE_DISCONNECTED; mBluetoothPbapState = BluetoothPbap.STATE_DISCONNECTED; mService.setIconVisibility(mBluetoothIcon, mBluetoothEnabled); Loading Loading @@ -1083,7 +1083,6 @@ public class StatusBarPolicy { private final void updateBluetooth(Intent intent) { int iconId = com.android.internal.R.drawable.stat_sys_data_bluetooth; String action = intent.getAction(); if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) { int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR); Loading @@ -1092,8 +1091,12 @@ public class StatusBarPolicy { mBluetoothHeadsetState = intent.getIntExtra(BluetoothHeadset.EXTRA_STATE, BluetoothHeadset.STATE_ERROR); } else if (action.equals(BluetoothA2dp.ACTION_SINK_STATE_CHANGED)) { mBluetoothA2dpState = intent.getIntExtra(BluetoothA2dp.EXTRA_SINK_STATE, BluetoothA2dp.STATE_DISCONNECTED); BluetoothA2dp a2dp = new BluetoothA2dp(mContext); if (a2dp.getConnectedSinks().size() != 0) { mBluetoothA2dpConnected = true; } else { mBluetoothA2dpConnected = false; } } else if (action.equals(BluetoothPbap.PBAP_STATE_CHANGED_ACTION)) { mBluetoothPbapState = intent.getIntExtra(BluetoothPbap.PBAP_STATE, BluetoothPbap.STATE_DISCONNECTED); Loading @@ -1101,9 +1104,7 @@ public class StatusBarPolicy { return; } if (mBluetoothHeadsetState == BluetoothHeadset.STATE_CONNECTED || mBluetoothA2dpState == BluetoothA2dp.STATE_CONNECTED || mBluetoothA2dpState == BluetoothA2dp.STATE_PLAYING || if (mBluetoothHeadsetState == BluetoothHeadset.STATE_CONNECTED || mBluetoothA2dpConnected || mBluetoothPbapState == BluetoothPbap.STATE_CONNECTED) { iconId = com.android.internal.R.drawable.stat_sys_data_bluetooth_connected; } Loading Loading
services/java/com/android/server/WifiService.java +18 −11 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static android.net.wifi.WifiManager.WIFI_STATE_UNKNOWN; import android.app.AlarmManager; import android.app.PendingIntent; import android.bluetooth.BluetoothA2dp; import android.bluetooth.BluetoothDevice; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; Loading Loading @@ -62,6 +63,7 @@ import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.regex.Pattern; import java.io.FileDescriptor; import java.io.PrintWriter; Loading Loading @@ -1380,11 +1382,16 @@ public class WifiService extends IWifiManager.Stub { } mPluggedType = pluggedType; } else if (action.equals(BluetoothA2dp.ACTION_SINK_STATE_CHANGED)) { boolean isBluetoothPlaying = intent.getIntExtra( BluetoothA2dp.EXTRA_SINK_STATE, BluetoothA2dp.STATE_DISCONNECTED) == BluetoothA2dp.STATE_PLAYING; BluetoothA2dp a2dp = new BluetoothA2dp(mContext); Set<BluetoothDevice> sinks = a2dp.getConnectedSinks(); boolean isBluetoothPlaying = false; for (BluetoothDevice sink : sinks) { if (a2dp.getSinkState(sink) == BluetoothA2dp.STATE_PLAYING) { isBluetoothPlaying = true; } } mWifiStateTracker.setBluetoothScanMode(isBluetoothPlaying); } else { return; } Loading
services/java/com/android/server/status/StatusBarPolicy.java +11 −10 Original line number Diff line number Diff line Loading @@ -283,7 +283,7 @@ public class StatusBarPolicy { private IBinder mBluetoothIcon; private IconData mBluetoothData; private int mBluetoothHeadsetState; private int mBluetoothA2dpState; private boolean mBluetoothA2dpConnected; private int mBluetoothPbapState; private boolean mBluetoothEnabled; Loading Loading @@ -455,7 +455,7 @@ public class StatusBarPolicy { } else { mBluetoothEnabled = false; } mBluetoothA2dpState = BluetoothA2dp.STATE_DISCONNECTED; mBluetoothA2dpConnected = false; mBluetoothHeadsetState = BluetoothHeadset.STATE_DISCONNECTED; mBluetoothPbapState = BluetoothPbap.STATE_DISCONNECTED; mService.setIconVisibility(mBluetoothIcon, mBluetoothEnabled); Loading Loading @@ -1083,7 +1083,6 @@ public class StatusBarPolicy { private final void updateBluetooth(Intent intent) { int iconId = com.android.internal.R.drawable.stat_sys_data_bluetooth; String action = intent.getAction(); if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) { int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR); Loading @@ -1092,8 +1091,12 @@ public class StatusBarPolicy { mBluetoothHeadsetState = intent.getIntExtra(BluetoothHeadset.EXTRA_STATE, BluetoothHeadset.STATE_ERROR); } else if (action.equals(BluetoothA2dp.ACTION_SINK_STATE_CHANGED)) { mBluetoothA2dpState = intent.getIntExtra(BluetoothA2dp.EXTRA_SINK_STATE, BluetoothA2dp.STATE_DISCONNECTED); BluetoothA2dp a2dp = new BluetoothA2dp(mContext); if (a2dp.getConnectedSinks().size() != 0) { mBluetoothA2dpConnected = true; } else { mBluetoothA2dpConnected = false; } } else if (action.equals(BluetoothPbap.PBAP_STATE_CHANGED_ACTION)) { mBluetoothPbapState = intent.getIntExtra(BluetoothPbap.PBAP_STATE, BluetoothPbap.STATE_DISCONNECTED); Loading @@ -1101,9 +1104,7 @@ public class StatusBarPolicy { return; } if (mBluetoothHeadsetState == BluetoothHeadset.STATE_CONNECTED || mBluetoothA2dpState == BluetoothA2dp.STATE_CONNECTED || mBluetoothA2dpState == BluetoothA2dp.STATE_PLAYING || if (mBluetoothHeadsetState == BluetoothHeadset.STATE_CONNECTED || mBluetoothA2dpConnected || mBluetoothPbapState == BluetoothPbap.STATE_CONNECTED) { iconId = com.android.internal.R.drawable.stat_sys_data_bluetooth_connected; } Loading