summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJaikumar Ganesh <jaikumar@google.com>2009-12-03 12:01:17 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-03 12:01:17 -0800
commit2e1ff896cc024a558b5b38a694b341af3301c8c3 (patch)
tree8d5aacc078dc5c52b52c21fb88b4b2c075855e97 /services
parent0fed723ba41b14254aa508c7b317799c7eaf3c7b (diff)
parent8c411fb13923d1fa28fcd98452bf3d17b8b1a338 (diff)
downloadframeworks_base-2e1ff896cc024a558b5b38a694b341af3301c8c3.zip
frameworks_base-2e1ff896cc024a558b5b38a694b341af3301c8c3.tar.gz
frameworks_base-2e1ff896cc024a558b5b38a694b341af3301c8c3.tar.bz2
am 8c411fb1: Merge change I79420b02 into eclair
Merge commit '8c411fb13923d1fa28fcd98452bf3d17b8b1a338' into eclair-plus-aosp * commit '8c411fb13923d1fa28fcd98452bf3d17b8b1a338': Add support for Car Dock.
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/DockObserver.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/services/java/com/android/server/DockObserver.java b/services/java/com/android/server/DockObserver.java
index c2b1b96..2fff54c0 100644
--- a/services/java/com/android/server/DockObserver.java
+++ b/services/java/com/android/server/DockObserver.java
@@ -18,6 +18,8 @@ package com.android.server;
import android.app.Activity;
import android.app.KeyguardManager;
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothDevice;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -27,12 +29,13 @@ import android.os.Message;
import android.os.SystemClock;
import android.os.UEventObserver;
import android.provider.Settings;
+import android.server.BluetoothService;
import android.util.Log;
import com.android.internal.widget.LockPatternUtils;
-import java.io.FileReader;
import java.io.FileNotFoundException;
+import java.io.FileReader;
/**
* <p>DockObserver monitors for a docking station.
@@ -65,7 +68,7 @@ class DockObserver extends UEventObserver {
if (getResultCode() != Activity.RESULT_OK) {
return;
}
-
+
// Launch a dock activity
String category;
switch (mDockState) {
@@ -177,7 +180,13 @@ class DockObserver extends UEventObserver {
// Pack up the values and broadcast them to everyone
Intent intent = new Intent(Intent.ACTION_DOCK_EVENT);
intent.putExtra(Intent.EXTRA_DOCK_STATE, mDockState);
-
+
+ // Check if this is Bluetooth Dock
+ String address = BluetoothService.readDockBluetoothAddress();
+ if (address != null)
+ intent.putExtra(BluetoothDevice.EXTRA_DEVICE,
+ BluetoothAdapter.getDefaultAdapter().getRemoteDevice(address));
+
// Send the ordered broadcast; the result receiver will receive after all
// broadcasts have been sent. If any broadcast receiver changes the result
// code from the initial value of RESULT_OK, then the result receiver will