Lines Matching refs:profile

100      * Last time a bt profile auto-connect was attempted.
114 * Describes the current device and profile for logging.
116 * @param profile Profile to describe
117 * @return Description of the device and profile
119 private String describe(LocalBluetoothProfile profile) {
122 if (profile != null) {
123 sb.append(" Profile:").append(profile);
129 void onProfileStateChanged(LocalBluetoothProfile profile, int newProfileState) {
131 Log.d(TAG, "onProfileStateChanged: profile " + profile +
139 mProfileConnectionState.put(profile, newProfileState);
141 if (!mProfiles.contains(profile)) {
142 mRemovedProfiles.remove(profile);
143 mProfiles.add(profile);
144 if (profile instanceof PanProfile &&
145 ((PanProfile) profile).isLocalRoleNap(mDevice)) {
150 if (profile instanceof MapProfile) {
151 profile.setPreferred(mDevice, true);
154 } else if (profile instanceof MapProfile &&
156 if (mProfiles.contains(profile)) {
157 mRemovedProfiles.add(profile);
158 mProfiles.remove(profile);
160 profile.setPreferred(mDevice, false);
162 } else if (mLocalNapRoleConnected && profile instanceof PanProfile &&
163 ((PanProfile) profile).isLocalRoleNap(mDevice) &&
166 mProfiles.remove(profile);
167 mRemovedProfiles.add(profile);
185 for (LocalBluetoothProfile profile : mProfiles) {
186 disconnect(profile);
198 void disconnect(LocalBluetoothProfile profile) {
199 if (profile.disconnect(mDevice)) {
201 Log.d(TAG, "Command sent successfully:DISCONNECT " + describe(profile));
239 for (LocalBluetoothProfile profile : mProfiles) {
240 if (connectAllProfiles ? profile.isConnectable() : profile.isAutoConnectable()) {
241 if (profile.isPreferred(mDevice)) {
243 connectInt(profile);
261 for (LocalBluetoothProfile profile : mProfiles) {
262 if (profile.isAutoConnectable()) {
263 profile.setPreferred(mDevice, true);
264 connectInt(profile);
270 * Connect this device to the specified profile.
272 * @param profile the profile to use with the remote device
274 void connectProfile(LocalBluetoothProfile profile) {
278 connectInt(profile);
279 // Refresh the UI based on profile.connect() call
283 synchronized void connectInt(LocalBluetoothProfile profile) {
287 if (profile.connect(mDevice)) {
289 Log.d(TAG, "Command sent successfully:CONNECT " + describe(profile));
293 Log.i(TAG, "Failed to connect " + profile.toString() + " to " + mName);
350 int getProfileConnectionState(LocalBluetoothProfile profile) {
352 mProfileConnectionState.get(profile) == null) {
354 int state = profile.getConnectionStatus(mDevice);
355 mProfileConnectionState.put(profile, state);
357 return mProfileConnectionState.get(profile);
365 for (LocalBluetoothProfile profile :getProfiles()) {
366 mProfileConnectionState.put(profile, BluetoothProfile.STATE_DISCONNECTED);
446 * Checks whether we are connected to this device (any profile counts).
451 for (LocalBluetoothProfile profile : mProfiles) {
452 int status = getProfileConnectionState(profile);
461 boolean isConnectedProfile(LocalBluetoothProfile profile) {
462 int status = getProfileConnectionState(profile);
468 for (LocalBluetoothProfile profile : mProfiles) {
469 int status = getProfileConnectionState(profile);
581 for (LocalBluetoothProfile profile : mProfiles) {
582 if (profile.isConnectable()) {
583 connectableProfiles.add(profile);