Commit ef697b0b authored by jhtop.kim's avatar jhtop.kim Committed by Jaikumar Ganesh
Browse files

Bluetooth : fix for the OPP service bug while BT on/off

Update patch set for removing BOOT_COMPLETED.

BluetoothOppService.java : use sendMSG instead of sendMSGdelayed
BluetoothOppReceiver.java : delete boot-complete line
AndroidManifest : delete boot-complete line

Change-Id: Icf9a2f48a70ba519cb3caf93a0b33e13472d1f54
Author: jhtop.kim <jhtop.kim@samsung.com>
parent 66cbd62c
......@@ -40,7 +40,7 @@
android:name=".opp.BluetoothOppReceiver">
<intent-filter>
<action android:name="android.bluetooth.adapter.action.STATE_CHANGED" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<!--action android:name="android.intent.action.BOOT_COMPLETED" /-->
<action android:name="android.btopp.intent.action.OPEN_RECEIVED_FILES" />
</intent-filter>
</receiver>
......
......@@ -60,10 +60,8 @@ public class BluetoothOppReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_BOOT_COMPLETED)) {
context.startService(new Intent(context, BluetoothOppService.class));
} else if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
if (BluetoothAdapter.STATE_ON == intent.getIntExtra(
BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR)) {
if (V) Log.v(TAG, "Received BLUETOOTH_STATE_CHANGED_ACTION, BLUETOOTH_STATE_ON");
......
......@@ -172,7 +172,7 @@ public class BluetoothOppService extends Service {
if (mAdapter == null) {
Log.w(TAG, "Local BT device is not enabled");
} else {
startListenerDelayed();
startListener();
}
}
if (V) BluetoothOppPreference.getInstance(this).dump();
......@@ -187,18 +187,18 @@ public class BluetoothOppService extends Service {
if (mAdapter == null) {
Log.w(TAG, "Local BT device is not enabled");
} else {
startListenerDelayed();
startListener();
}
updateFromProvider();
}
return retCode;
}
private void startListenerDelayed() {
private void startListener() {
if (!mListenStarted) {
if (mAdapter.isEnabled()) {
if (V) Log.v(TAG, "Starting RfcommListener in 9 seconds");
mHandler.sendMessageDelayed(mHandler.obtainMessage(START_LISTENER), 9000);
if (V) Log.v(TAG, "Starting RfcommListener");
mHandler.sendMessage(mHandler.obtainMessage(START_LISTENER));
mListenStarted = true;
}
}
......
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