summaryrefslogtreecommitdiffstats
path: root/src/com/android/bluetooth/opp/BluetoothOppService.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/bluetooth/opp/BluetoothOppService.java')
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppService.java27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppService.java b/src/com/android/bluetooth/opp/BluetoothOppService.java
index 27519cc5b..c70d0fe17 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppService.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppService.java
@@ -148,8 +148,6 @@ public class BluetoothOppService extends Service {
*/
private BluetoothOppObexServerSession mServerSession;
- BluetoothOppManager mOppManager = null;
-
@Override
public IBinder onBind(Intent arg0) {
throw new UnsupportedOperationException("Cannot bind to Bluetooth OPP Service");
@@ -158,7 +156,7 @@ public class BluetoothOppService extends Service {
@Override
public void onCreate() {
super.onCreate();
- if (V) Log.v(TAG, "onCreate");
+ if (D) Log.d(TAG, "onCreate");
mAdapter = BluetoothAdapter.getDefaultAdapter();
mShares = Lists.newArrayList();
mBatchs = Lists.newArrayList();
@@ -170,11 +168,12 @@ public class BluetoothOppService extends Service {
mNotifier.updateNotification();
final ContentResolver contentResolver = getContentResolver();
- synchronized (BluetoothOppService.this) {
- trimDatabase(contentResolver);
- }
+ new Thread("trimDatabase") {
+ public void run() {
+ trimDatabase(contentResolver);
+ }
+ }.start();
- mOppManager = BluetoothOppManager.getInstance(this);
IntentFilter filter = new IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED);
registerReceiver(mBluetoothReceiver, filter);
@@ -184,7 +183,6 @@ public class BluetoothOppService extends Service {
} else {
startListener();
}
- mOppManager.isOPPServiceUp = true;
}
if (V) BluetoothOppPreference.getInstance(this).dump();
updateFromProvider();
@@ -396,7 +394,6 @@ public class BluetoothOppService extends Service {
public void onDestroy() {
if (V) Log.v(TAG, "onDestroy");
super.onDestroy();
- mOppManager.isOPPServiceUp = false;
getContentResolver().unregisterContentObserver(mObserver);
unregisterReceiver(mBluetoothReceiver);
if(mSocketListener != null) {
@@ -658,9 +655,9 @@ public class BluetoothOppService extends Service {
cursor.getInt(cursor.getColumnIndexOrThrow(BluetoothShare.VISIBILITY)),
cursor.getInt(cursor.getColumnIndexOrThrow(BluetoothShare.USER_CONFIRMATION)),
cursor.getInt(cursor.getColumnIndexOrThrow(BluetoothShare.STATUS)),
- cursor.getInt(cursor.getColumnIndexOrThrow(BluetoothShare.TOTAL_BYTES)),
- cursor.getInt(cursor.getColumnIndexOrThrow(BluetoothShare.CURRENT_BYTES)),
- cursor.getInt(cursor.getColumnIndexOrThrow(BluetoothShare.TIMESTAMP)),
+ cursor.getLong(cursor.getColumnIndexOrThrow(BluetoothShare.TOTAL_BYTES)),
+ cursor.getLong(cursor.getColumnIndexOrThrow(BluetoothShare.CURRENT_BYTES)),
+ cursor.getLong(cursor.getColumnIndexOrThrow(BluetoothShare.TIMESTAMP)),
cursor.getInt(cursor.getColumnIndexOrThrow(Constants.MEDIA_SCANNED)) != Constants.MEDIA_SCANNED_NOT_SCANNED);
if (V) {
@@ -808,10 +805,10 @@ public class BluetoothOppService extends Service {
}
info.mStatus = newStatus;
- info.mTotalBytes = cursor.getInt(cursor.getColumnIndexOrThrow(BluetoothShare.TOTAL_BYTES));
- info.mCurrentBytes = cursor.getInt(cursor
+ info.mTotalBytes = cursor.getLong(cursor.getColumnIndexOrThrow(BluetoothShare.TOTAL_BYTES));
+ info.mCurrentBytes = cursor.getLong(cursor
.getColumnIndexOrThrow(BluetoothShare.CURRENT_BYTES));
- info.mTimestamp = cursor.getInt(cursor.getColumnIndexOrThrow(BluetoothShare.TIMESTAMP));
+ info.mTimestamp = cursor.getLong(cursor.getColumnIndexOrThrow(BluetoothShare.TIMESTAMP));
info.mMediaScanned = (cursor.getInt(cursor.getColumnIndexOrThrow(Constants.MEDIA_SCANNED)) != Constants.MEDIA_SCANNED_NOT_SCANNED);
if (confirmUpdated) {