Modify settings for 2.1

Add incoming pairing dialog
Add DisplayPasskey handling of pairing keyboards with 2.1 devices.
Modify code path to show errors when bonding request fails.
Misc fixes like string changes.
This commit is contained in:
Jaikumar Ganesh
2009-09-11 09:45:11 -07:00
parent d6375e975e
commit 5f23cb39a1
27 changed files with 126 additions and 83 deletions

View File

@@ -254,9 +254,12 @@ public class LocalBluetoothManager {
public void showError(BluetoothDevice device, int titleResId, int messageResId) {
CachedBluetoothDevice cachedDevice = mCachedDeviceManager.findDevice(device);
if (cachedDevice == null) return;
String name = cachedDevice.getName();
String name = null;
if (cachedDevice == null) {
name = mContext.getString(R.string.bluetooth_remote_device);
} else {
name = cachedDevice.getName();
}
String message = mContext.getString(messageResId, name);
if (mForegroundActivity != null) {
@@ -269,7 +272,7 @@ public class LocalBluetoothManager {
.show();
} else {
// Fallback on a toast
Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
Toast.makeText(mContext, message, Toast.LENGTH_LONG).show();
}
}