FileDocCategorySizeDatePackage
LocalBluetoothProfileManager.javaAPI DocAndroid 1.5 API10407Wed May 06 22:42:48 BST 2009com.android.settings.bluetooth

LocalBluetoothProfileManager

public abstract class LocalBluetoothProfileManager extends Object
LocalBluetoothProfileManager is an abstract class defining the basic functionality related to a profile.

Fields Summary
private static Map
sProfileMap
protected LocalBluetoothManager
mLocalManager
Constructors Summary
protected LocalBluetoothProfileManager(LocalBluetoothManager localManager)

        mLocalManager = localManager;
    
Methods Summary
public abstract intconnect(java.lang.String address)

public abstract intdisconnect(java.lang.String address)

public static voidfill(int btClass, java.util.List profiles)
Temporary method to fill profiles based on a device's class. NOTE: This list happens to define the connection order. We should put this logic in a more well known place when this method is no longer temporary.

param
btClass The class
param
profiles The list of profiles to fill

        profiles.clear();

        if (BluetoothHeadset.doesClassMatch(btClass)) {
            profiles.add(Profile.HEADSET);
        }
        
        if (BluetoothA2dp.doesClassMatchSink(btClass)) {
            profiles.add(Profile.A2DP);
        }
    
public abstract intgetConnectionStatus(java.lang.String address)

public static com.android.settings.bluetooth.LocalBluetoothProfileManagergetProfileManager(LocalBluetoothManager localManager, com.android.settings.bluetooth.LocalBluetoothProfileManager$Profile profile)

    
        
              
        
        LocalBluetoothProfileManager profileManager;
        
        synchronized (sProfileMap) {
            profileManager = sProfileMap.get(profile);
            
            if (profileManager == null) {
                switch (profile) {
                case A2DP:
                    profileManager = new A2dpProfileManager(localManager);
                    break;
                    
                case HEADSET:
                    profileManager = new HeadsetProfileManager(localManager);
                    break;
                }
                
                sProfileMap.put(profile, profileManager);    
            }
        }
        
        return profileManager;
    
public abstract intgetSummary(java.lang.String address)

public booleanisConnected(java.lang.String address)

        return SettingsBtStatus.isConnectionStatusConnected(getConnectionStatus(address));
    
public abstract booleanisPreferred(java.lang.String address)

public abstract voidsetPreferred(java.lang.String address, boolean preferred)