Rename method isConnectable()

LocalBluetoothProfile.isConnectable() checks whether the user can initiate a connection
for a specific profile, not really whether the profile is connectable.

Change-Id: If6c6cd1554acf35db2460ea6ddb65148a7e86e45
Bug: 79982487
Test: build
This commit is contained in:
Leon Liao
2018-09-18 12:45:45 +08:00
parent 6e9ce1a296
commit 3b5e6bd4e1
16 changed files with 18 additions and 18 deletions

View File

@@ -105,7 +105,7 @@ public class A2dpProfile implements LocalBluetoothProfile {
BluetoothProfile.A2DP);
}
public boolean isConnectable() {
public boolean accessProfileEnabled() {
return true;
}

View File

@@ -99,7 +99,7 @@ final class A2dpSinkProfile implements LocalBluetoothProfile {
BluetoothProfile.A2DP_SINK);
}
public boolean isConnectable() {
public boolean accessProfileEnabled() {
return true;
}

View File

@@ -250,7 +250,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
int preferredProfiles = 0;
for (LocalBluetoothProfile profile : mProfiles) {
if (connectAllProfiles ? profile.isConnectable() : profile.isAutoConnectable()) {
if (connectAllProfiles ? profile.accessProfileEnabled() : profile.isAutoConnectable()) {
if (profile.isPreferred(mDevice)) {
++preferredProfiles;
connectInt(profile);
@@ -736,7 +736,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
List<LocalBluetoothProfile> connectableProfiles =
new ArrayList<LocalBluetoothProfile>();
for (LocalBluetoothProfile profile : mProfiles) {
if (profile.isConnectable()) {
if (profile.accessProfileEnabled()) {
connectableProfiles.add(profile);
}
}

View File

@@ -106,7 +106,7 @@ public class HeadsetProfile implements LocalBluetoothProfile {
BluetoothProfile.HEADSET);
}
public boolean isConnectable() {
public boolean accessProfileEnabled() {
return true;
}

View File

@@ -103,7 +103,7 @@ public class HearingAidProfile implements LocalBluetoothProfile {
BluetoothProfile.HEARING_AID);
}
public boolean isConnectable() {
public boolean accessProfileEnabled() {
return false;
}

View File

@@ -107,7 +107,7 @@ final class HfpClientProfile implements LocalBluetoothProfile {
}
@Override
public boolean isConnectable() {
public boolean accessProfileEnabled() {
return true;
}

View File

@@ -102,7 +102,7 @@ public class HidDeviceProfile implements LocalBluetoothProfile {
}
@Override
public boolean isConnectable() {
public boolean accessProfileEnabled() {
return true;
}

View File

@@ -95,7 +95,7 @@ public class HidProfile implements LocalBluetoothProfile {
BluetoothProfile.HID_HOST);
}
public boolean isConnectable() {
public boolean accessProfileEnabled() {
return true;
}

View File

@@ -26,9 +26,9 @@ import android.bluetooth.BluetoothDevice;
public interface LocalBluetoothProfile {
/**
* Returns true if the user can initiate a connection, false otherwise.
* Return {@code true} if the user can initiate a connection for this profile in UI.
*/
boolean isConnectable();
boolean accessProfileEnabled();
/**
* Returns true if the user can enable auto connection for this profile.

View File

@@ -109,7 +109,7 @@ public final class MapClientProfile implements LocalBluetoothProfile {
BluetoothProfile.MAP_CLIENT);
}
public boolean isConnectable() {
public boolean accessProfileEnabled() {
return true;
}

View File

@@ -107,7 +107,7 @@ public class MapProfile implements LocalBluetoothProfile {
BluetoothProfile.MAP);
}
public boolean isConnectable() {
public boolean accessProfileEnabled() {
return true;
}

View File

@@ -32,7 +32,7 @@ final class OppProfile implements LocalBluetoothProfile {
// Order of this profile in device profiles list
private static final int ORDINAL = 2;
public boolean isConnectable() {
public boolean accessProfileEnabled() {
return false;
}

View File

@@ -80,7 +80,7 @@ public class PanProfile implements LocalBluetoothProfile {
BluetoothProfile.PAN);
}
public boolean isConnectable() {
public boolean accessProfileEnabled() {
return true;
}

View File

@@ -115,7 +115,7 @@ public final class PbapClientProfile implements LocalBluetoothProfile {
BluetoothProfile.PBAP_CLIENT);
}
public boolean isConnectable() {
public boolean accessProfileEnabled() {
return true;
}

View File

@@ -80,7 +80,7 @@ public class PbapServerProfile implements LocalBluetoothProfile {
BluetoothPbap pbap = new BluetoothPbap(context, new PbapServiceListener());
}
public boolean isConnectable() {
public boolean accessProfileEnabled() {
return true;
}

View File

@@ -106,7 +106,7 @@ final class SapProfile implements LocalBluetoothProfile {
BluetoothProfile.SAP);
}
public boolean isConnectable() {
public boolean accessProfileEnabled() {
return true;
}