use of com.android.settingslib.bluetooth.LocalBluetoothProfile in project android_packages_apps_Settings by omnirom.
the class BluetoothDetailsProfilesController method getProfiles.
/**
* Helper to get the list of connectable and special profiles.
*/
private List<LocalBluetoothProfile> getProfiles() {
List<LocalBluetoothProfile> result = mCachedDevice.getConnectableProfiles();
final BluetoothDevice device = mCachedDevice.getDevice();
final int pbapPermission = device.getPhonebookAccessPermission();
// Only provide PBAP cabability if the client device has requested PBAP.
if (pbapPermission != BluetoothDevice.ACCESS_UNKNOWN) {
final PbapServerProfile psp = mManager.getProfileManager().getPbapProfile();
result.add(psp);
}
final MapProfile mapProfile = mManager.getProfileManager().getMapProfile();
final int mapPermission = device.getMessageAccessPermission();
if (mapPermission != BluetoothDevice.ACCESS_UNKNOWN) {
result.add(mapProfile);
}
return result;
}
use of com.android.settingslib.bluetooth.LocalBluetoothProfile in project android_packages_apps_Settings by omnirom.
the class BluetoothDetailsProfilesControllerTest method addFakeProfile.
/**
* Creates and adds a mock LocalBluetoothProfile to the list of connectable profiles for the
* device.
* @param profileNameResId the resource id for the name used by this profile
* @param deviceIsPreferred whether this profile should start out as enabled for the device
*/
private LocalBluetoothProfile addFakeProfile(int profileNameResId, boolean deviceIsPreferred) {
LocalBluetoothProfile profile = new FakeBluetoothProfile(mContext, profileNameResId);
profile.setEnabled(mDevice, deviceIsPreferred);
mConnectableProfiles.add(profile);
when(mProfileManager.getProfileByName(eq(profile.toString()))).thenReturn(profile);
return profile;
}
Aggregations