summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/bluetooth/DockAudioStateChangeReceiver.java
diff options
context:
space:
mode:
authorMichael Chan <mchan@android.com>2009-12-07 20:50:54 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-07 20:50:54 -0800
commit4e1e2d2bf674e5edf5a09e6788690851ae9a53f3 (patch)
treef9518d40da8ebd6da6f25de644cca6125f30f327 /src/com/android/settings/bluetooth/DockAudioStateChangeReceiver.java
parentb659c9e4102304b9c41558a2b8eaccc03c96a9e2 (diff)
parent0c75b2d2dc35b88d5cb9db96afc72ed074ca5350 (diff)
downloadpackages_apps_settings-4e1e2d2bf674e5edf5a09e6788690851ae9a53f3.zip
packages_apps_settings-4e1e2d2bf674e5edf5a09e6788690851ae9a53f3.tar.gz
packages_apps_settings-4e1e2d2bf674e5edf5a09e6788690851ae9a53f3.tar.bz2
am 0c75b2d2: Merge change I80790bdb into eclair
Merge commit '0c75b2d2dc35b88d5cb9db96afc72ed074ca5350' into eclair-plus-aosp * commit '0c75b2d2dc35b88d5cb9db96afc72ed074ca5350': b/2296110 Dialog for setting up dock audio.
Diffstat (limited to 'src/com/android/settings/bluetooth/DockAudioStateChangeReceiver.java')
-rw-r--r--src/com/android/settings/bluetooth/DockAudioStateChangeReceiver.java76
1 files changed, 0 insertions, 76 deletions
diff --git a/src/com/android/settings/bluetooth/DockAudioStateChangeReceiver.java b/src/com/android/settings/bluetooth/DockAudioStateChangeReceiver.java
deleted file mode 100644
index d320742..0000000
--- a/src/com/android/settings/bluetooth/DockAudioStateChangeReceiver.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.bluetooth;
-
-import android.bluetooth.BluetoothDevice;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.util.Log;
-
-public class DockAudioStateChangeReceiver extends BroadcastReceiver {
-
- private static final boolean DBG = true;
- private static final String TAG = "DockAudioStateChangeReceiver";
-
- @Override
- public void onReceive(Context context, Intent intent) {
- if (intent == null)
- return;
-
- if (DBG) {
- Log.e(TAG, "Action:" + intent.getAction()
- + " State:" + intent.getIntExtra(Intent.EXTRA_DOCK_STATE,
- Intent.EXTRA_DOCK_STATE_UNDOCKED));
- }
-
- if (Intent.ACTION_DOCK_EVENT.equals(intent.getAction())) {
- BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
- if (device == null) {
- if (DBG) Log.e(TAG, "Device is missing");
- return;
- }
-
- LocalBluetoothManager localManager = LocalBluetoothManager.getInstance(context);
-
- int state = intent.getIntExtra(Intent.EXTRA_DOCK_STATE,
- Intent.EXTRA_DOCK_STATE_UNDOCKED);
-
- switch (state) {
- case Intent.EXTRA_DOCK_STATE_UNDOCKED:
- DockSettingsActivity.handleUndocked(context, localManager, device);
- break;
- case Intent.EXTRA_DOCK_STATE_CAR:
- case Intent.EXTRA_DOCK_STATE_DESK:
- if (DockSettingsActivity.getAutoConnectSetting(localManager)) {
- // Auto connect
- DockSettingsActivity.handleDocked(context, localManager, device, state);
- } else {
- // Don't auto connect. Show dialog.
- Intent i = new Intent(intent);
- i.setClass(context, DockSettingsActivity.class);
- i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- context.startActivity(i);
- }
- break;
- default:
- Log.e(TAG, "Unknown state");
- break;
- }
- }
- }
-}