summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Pelly <npelly@google.com>2009-10-08 00:57:45 +0200
committerNick Pelly <npelly@google.com>2009-10-08 00:57:45 +0200
commit3a88b20fcd71e42451e402d27374b19eeb2ff0da (patch)
tree0296f21d291a5fde18b7d8864e854eb1c5d00ad9
parent4787d49803e48d58c78be2debe0631b51002d3fb (diff)
downloadandroid_packages_apps_Bluetooth-3a88b20fcd71e42451e402d27374b19eeb2ff0da.tar.gz
android_packages_apps_Bluetooth-3a88b20fcd71e42451e402d27374b19eeb2ff0da.tar.bz2
android_packages_apps_Bluetooth-3a88b20fcd71e42451e402d27374b19eeb2ff0da.zip
Update application code for BluetoothAdapter.getDefaultAdapter().
Change-Id: I7baafb909b74783da4e51d48f2465e7aacf07eb5 DrNo: eastham Bug: 2158765 Joke: What goes 99-thump, 99-thump? A centipede with a wooden leg.
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppBatch.java3
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppManager.java2
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppService.java2
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppTransfer.java2
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java2
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppUtility.java3
-rw-r--r--src/com/android/bluetooth/pbap/BluetoothPbapService.java2
7 files changed, 7 insertions, 9 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppBatch.java b/src/com/android/bluetooth/opp/BluetoothOppBatch.java
index 045f465b3..5913b4cb3 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppBatch.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppBatch.java
@@ -104,8 +104,7 @@ public class BluetoothOppBatch {
* @param info, BluetoothOppShareInfo
*/
public BluetoothOppBatch(Context context, BluetoothOppShareInfo info) {
- BluetoothAdapter adapter =
- (BluetoothAdapter) context.getSystemService(Context.BLUETOOTH_SERVICE);
+ BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
mContext = context;
mShares = Lists.newArrayList();
mTimestamp = info.mTimestamp;
diff --git a/src/com/android/bluetooth/opp/BluetoothOppManager.java b/src/com/android/bluetooth/opp/BluetoothOppManager.java
index 4937bc695..75e9fd947 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppManager.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppManager.java
@@ -125,7 +125,7 @@ public class BluetoothOppManager {
// This will be around as long as this process is
mContext = context.getApplicationContext();
- mAdapter = (BluetoothAdapter) context.getSystemService(Context.BLUETOOTH_SERVICE);
+ mAdapter = BluetoothAdapter.getDefaultAdapter();
if (mAdapter == null) {
if (V) Log.v(TAG, "BLUETOOTH_SERVICE is not started! ");
}
diff --git a/src/com/android/bluetooth/opp/BluetoothOppService.java b/src/com/android/bluetooth/opp/BluetoothOppService.java
index 10cc3c974..faba6a8e3 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppService.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppService.java
@@ -148,7 +148,7 @@ public class BluetoothOppService extends Service {
public void onCreate() {
super.onCreate();
if (V) Log.v(TAG, "Service onCreate");
- mAdapter = (BluetoothAdapter) getSystemService(Context.BLUETOOTH_SERVICE);
+ mAdapter = BluetoothAdapter.getDefaultAdapter();
mSocketListener = new BluetoothOppRfcommListener(mAdapter);
mShares = Lists.newArrayList();
mBatchs = Lists.newArrayList();
diff --git a/src/com/android/bluetooth/opp/BluetoothOppTransfer.java b/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
index 7ca7857db..d892e70dc 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
@@ -116,7 +116,7 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch
mSession = session;
mBatch.registerListern(this);
- mAdapter = (BluetoothAdapter)mContext.getSystemService(Context.BLUETOOTH_SERVICE);
+ mAdapter = BluetoothAdapter.getDefaultAdapter();
}
diff --git a/src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java b/src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java
index 0bd11933a..e98771f8e 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java
@@ -155,7 +155,7 @@ public class BluetoothOppTransferActivity extends AlertActivity implements
BluetoothOppUtility.updateVisibilityToHidden(this, mUri);
}
- mAdapter = (BluetoothAdapter) getSystemService(Context.BLUETOOTH_SERVICE);
+ mAdapter = BluetoothAdapter.getDefaultAdapter();
// Set up the "dialog"
setUpDialog();
diff --git a/src/com/android/bluetooth/opp/BluetoothOppUtility.java b/src/com/android/bluetooth/opp/BluetoothOppUtility.java
index 50a2181f2..00752272c 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppUtility.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppUtility.java
@@ -61,8 +61,7 @@ public class BluetoothOppUtility {
private static final boolean V = Constants.VERBOSE;
public static BluetoothOppTransferInfo queryRecord(Context context, Uri uri) {
- BluetoothAdapter adapter =
- (BluetoothAdapter) context.getSystemService(Context.BLUETOOTH_SERVICE);
+ BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
BluetoothOppTransferInfo info = new BluetoothOppTransferInfo();
Cursor cursor = context.getContentResolver().query(uri, null, null, null, null);
if (cursor != null) {
diff --git a/src/com/android/bluetooth/pbap/BluetoothPbapService.java b/src/com/android/bluetooth/pbap/BluetoothPbapService.java
index 847299738..3730cf190 100644
--- a/src/com/android/bluetooth/pbap/BluetoothPbapService.java
+++ b/src/com/android/bluetooth/pbap/BluetoothPbapService.java
@@ -204,7 +204,7 @@ public class BluetoothPbapService extends Service {
if (VERBOSE) Log.v(TAG, "Pbap Service onCreate");
mInterrupted = false;
- mAdapter = (BluetoothAdapter)getSystemService(Context.BLUETOOTH_SERVICE);
+ mAdapter = BluetoothAdapter.getDefaultAdapter();
if (!mHasStarted) {
mHasStarted = true;