本文整理汇总了C++中BluetoothHfpManager::Disconnect方法的典型用法代码示例。如果您正苦于以下问题:C++ BluetoothHfpManager::Disconnect方法的具体用法?C++ BluetoothHfpManager::Disconnect怎么用?C++ BluetoothHfpManager::Disconnect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BluetoothHfpManager
的用法示例。
在下文中一共展示了BluetoothHfpManager::Disconnect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ToggleBtTask
nsresult
BluetoothService::StartStopBluetooth(bool aStart, bool aIsStartup)
{
MOZ_ASSERT(NS_IsMainThread());
if (gInShutdown) {
if (aStart) {
// Don't try to start if we're already shutting down.
MOZ_ASSERT(false, "Start called while in shutdown!");
return NS_ERROR_FAILURE;
}
if (!mBluetoothCommandThread) {
// Don't create a new thread after we've begun shutdown since bluetooth
// can't be running.
return NS_OK;
}
}
nsresult rv;
if (!mBluetoothCommandThread) {
MOZ_ASSERT(!gInShutdown);
rv = NS_NewNamedThread("BluetoothCmd",
getter_AddRefs(mBluetoothCommandThread));
NS_ENSURE_SUCCESS(rv, rv);
}
if (!aStart) {
BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
hfp->Disconnect();
BluetoothOppManager* opp = BluetoothOppManager::Get();
opp->Disconnect();
}
nsCOMPtr<nsIRunnable> runnable = new ToggleBtTask(aStart, aIsStartup);
rv = mBluetoothCommandThread->Dispatch(runnable, NS_DISPATCH_NORMAL);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}