Lines Matching refs:profile

94      * Last time a bt profile auto-connect was attempted.
109 * Describes the current device and profile for logging.
111 * @param profile Profile to describe
112 * @return Description of the device and profile
114 private String describe(LocalBluetoothProfile profile) {
117 if (profile != null) {
118 sb.append(" Profile:").append(profile);
124 void onProfileStateChanged(LocalBluetoothProfile profile, int newProfileState) {
126 Log.d(TAG, "onProfileStateChanged: profile " + profile +
134 mProfileConnectionState.put(profile, newProfileState);
136 if (profile instanceof MapProfile) {
137 profile.setPreferred(mDevice, true);
138 } else if (!mProfiles.contains(profile)) {
139 mRemovedProfiles.remove(profile);
140 mProfiles.add(profile);
141 if (profile instanceof PanProfile &&
142 ((PanProfile) profile).isLocalRoleNap(mDevice)) {
147 } else if (profile instanceof MapProfile &&
149 profile.setPreferred(mDevice, false);
150 } else if (mLocalNapRoleConnected && profile instanceof PanProfile &&
151 ((PanProfile) profile).isLocalRoleNap(mDevice) &&
154 mProfiles.remove(profile);
155 mRemovedProfiles.add(profile);
173 for (LocalBluetoothProfile profile : mProfiles) {
174 disconnect(profile);
186 public void disconnect(LocalBluetoothProfile profile) {
187 if (profile.disconnect(mDevice)) {
189 Log.d(TAG, "Command sent successfully:DISCONNECT " + describe(profile));
227 for (LocalBluetoothProfile profile : mProfiles) {
228 if (connectAllProfiles ? profile.isConnectable() : profile.isAutoConnectable()) {
229 if (profile.isPreferred(mDevice)) {
231 connectInt(profile);
249 for (LocalBluetoothProfile profile : mProfiles) {
250 if (profile.isAutoConnectable()) {
251 profile.setPreferred(mDevice, true);
252 connectInt(profile);
258 * Connect this device to the specified profile.
260 * @param profile the profile to use with the remote device
262 public void connectProfile(LocalBluetoothProfile profile) {
266 connectInt(profile);
267 // Refresh the UI based on profile.connect() call
271 synchronized void connectInt(LocalBluetoothProfile profile) {
275 if (profile.connect(mDevice)) {
277 Log.d(TAG, "Command sent successfully:CONNECT " + describe(profile));
281 Log.i(TAG, "Failed to connect " + profile.toString() + " to " + mName);
338 public int getProfileConnectionState(LocalBluetoothProfile profile) {
340 mProfileConnectionState.get(profile) == null) {
342 int state = profile.getConnectionStatus(mDevice);
343 mProfileConnectionState.put(profile, state);
345 return mProfileConnectionState.get(profile);
353 for (LocalBluetoothProfile profile :getProfiles()) {
354 mProfileConnectionState.put(profile, BluetoothProfile.STATE_DISCONNECTED);
444 * Checks whether we are connected to this device (any profile counts).
449 for (LocalBluetoothProfile profile : mProfiles) {
450 int status = getProfileConnectionState(profile);
459 public boolean isConnectedProfile(LocalBluetoothProfile profile) {
460 int status = getProfileConnectionState(profile);
466 for (LocalBluetoothProfile profile : mProfiles) {
467 int status = getProfileConnectionState(profile);
590 for (LocalBluetoothProfile profile : mProfiles) {
591 if (profile.isConnectable()) {
592 connectableProfiles.add(profile);
823 for (LocalBluetoothProfile profile : getProfiles()) {
824 int connectionStatus = getProfileConnectionState(profile);
836 boolean profileConnected = false; // at least one profile is connected
840 for (LocalBluetoothProfile profile : getProfiles()) {
841 int connectionStatus = getProfileConnectionState(profile);
853 if (profile.isProfileReady()) {
854 if ((profile instanceof A2dpProfile) ||
855 (profile instanceof A2dpSinkProfile)){
857 } else if ((profile instanceof HeadsetProfile) ||
858 (profile instanceof HfpClientProfile)) {