Commit 613bae22 authored by Nick Pelly's avatar Nick Pelly
Browse files

Update application for Bluetooth API change: deprecation of BluetoothError.

parent f4a286ee
......@@ -37,7 +37,6 @@ import com.android.bluetooth.R;
import android.app.NotificationManager;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothError;
import android.bluetooth.BluetoothIntent;
import android.content.BroadcastReceiver;
import android.content.ContentUris;
......@@ -67,7 +66,7 @@ public class BluetoothOppReceiver extends BroadcastReceiver {
context.startService(new Intent(context, BluetoothOppService.class));
} else if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
if (BluetoothAdapter.STATE_ON == intent.getIntExtra(
BluetoothAdapter.EXTRA_STATE, BluetoothError.ERROR)) {
BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR)) {
if (V) Log.v(TAG, "Received BLUETOOTH_STATE_CHANGED_ACTION, BLUETOOTH_STATE_ON");
context.startService(new Intent(context, BluetoothOppService.class));
......
......@@ -38,7 +38,6 @@ import javax.obex.ObexTransport;
import android.app.Service;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothError;
import android.bluetooth.BluetoothIntent;
import android.content.BroadcastReceiver;
import android.content.ContentUris;
......@@ -337,7 +336,7 @@ public class BluetoothOppService extends Service {
String action = intent.getAction();
if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
switch (intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothError.ERROR)) {
switch (intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR)) {
case BluetoothAdapter.STATE_ON:
if (V) Log.v(TAG,
"Receiver BLUETOOTH_STATE_CHANGED_ACTION, BLUETOOTH_STATE_ON");
......
......@@ -33,7 +33,6 @@
package com.android.bluetooth.pbap;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothError;
import android.bluetooth.BluetoothIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
......@@ -57,7 +56,7 @@ public class BluetoothPbapReceiver extends BroadcastReceiver {
in.putExtra("action", action);
boolean startService = true;
if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothError.ERROR);
int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR);
in.putExtra(BluetoothAdapter.EXTRA_STATE, state);
if ((state == BluetoothAdapter.STATE_TURNING_ON)
|| (state == BluetoothAdapter.STATE_TURNING_OFF)) {
......
......@@ -43,7 +43,6 @@ import android.content.Intent;
import android.content.res.Resources;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothError;
import android.bluetooth.BluetoothIntent;
import android.bluetooth.BluetoothPbap;
import android.bluetooth.BluetoothSocket;
......@@ -241,7 +240,7 @@ public class BluetoothPbapService extends Service {
// process the intent from receiver
private void parseIntent(final Intent intent) {
String action = intent.getExtras().getString("action");
int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothError.ERROR);
int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR);
boolean removeTimeoutMsg = true;
if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
removeTimeoutMsg = false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment