Always add the bt profile to profile list on the arrive of a connect event

Always add the bt profile to profile list on the arrive of a connect event. Previously,
the connect event is ignored if it is a profile that's not known ahead of time.
This commit is contained in:
Michael Chan
2009-05-06 18:08:58 -07:00
parent e94a4e2747
commit 6c97742c88
4 changed files with 59 additions and 42 deletions

View File

@@ -21,6 +21,7 @@ import android.util.Log;
import com.android.settings.R;
import com.android.settings.bluetooth.LocalBluetoothManager.Callback;
import com.android.settings.bluetooth.LocalBluetoothProfileManager.Profile;
import java.util.ArrayList;
import java.util.List;
@@ -199,13 +200,12 @@ public class LocalBluetoothDeviceManager {
mLocalManager.showError(address, R.string.bluetooth_error_title, errorMsg);
}
public synchronized void onProfileStateChanged(String address, boolean transientState) {
public synchronized void onProfileStateChanged(String address, Profile profile,
int newProfileState) {
LocalBluetoothDevice device = findDevice(address);
if (device == null) return;
if (!transientState) {
device.onProfileStateChanged();
}
device.onProfileStateChanged(profile, newProfileState);
device.refresh();
}