summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar V <sravankumar@codeaurora.org>2016-02-25 17:31:08 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2016-03-10 04:57:06 -0800
commita4c180849729959965086923fd4d30956a7ea6bc (patch)
tree02dc6e66264e78f0dfcbc060b3c061a71467ca8d
parent3e4ad7ca18c240486e473de1386b719202b28d13 (diff)
downloadandroid_packages_apps_Bluetooth-a4c180849729959965086923fd4d30956a7ea6bc.tar.gz
android_packages_apps_Bluetooth-a4c180849729959965086923fd4d30956a7ea6bc.tar.bz2
android_packages_apps_Bluetooth-a4c180849729959965086923fd4d30956a7ea6bc.zip
Bluetooth-OPP: Use long instead of int
This patch fixes issue of problems in sending/receiving files which cannot be accomodated in int type of Java. Instead of using int, long data type is used. Change-Id: I58c9b49f59d47f6f162156eb6594e66731732580
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppHandoverReceiver.java2
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppObexServerSession.java2
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppReceiver.java1
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppService.java14
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppShareInfo.java10
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppTransfer.java1
6 files changed, 18 insertions, 12 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppHandoverReceiver.java b/src/com/android/bluetooth/opp/BluetoothOppHandoverReceiver.java
index e1f24c253..8eb073906 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppHandoverReceiver.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppHandoverReceiver.java
@@ -34,6 +34,8 @@ public class BluetoothOppHandoverReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
+ if(D) Log.d(TAG, "Action :" + action);
+
if (action.equals(Constants.ACTION_HANDOVER_SEND) ||
action.equals(Constants.ACTION_HANDOVER_SEND_MULTIPLE)) {
if (V) Log.v(TAG, "Transfer initiated from HANDOVER");
diff --git a/src/com/android/bluetooth/opp/BluetoothOppObexServerSession.java b/src/com/android/bluetooth/opp/BluetoothOppObexServerSession.java
index 2113fe4d5..0056450ab 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppObexServerSession.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppObexServerSession.java
@@ -109,7 +109,7 @@ public class BluetoothOppObexServerSession extends ServerRequestHandler implemen
boolean mTransferInProgress = false;
- private int position;
+ private long position;
public BluetoothOppObexServerSession(Context context, ObexTransport transport) {
mContext = context;
diff --git a/src/com/android/bluetooth/opp/BluetoothOppReceiver.java b/src/com/android/bluetooth/opp/BluetoothOppReceiver.java
index 1479646eb..ff56d29b8 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppReceiver.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppReceiver.java
@@ -62,6 +62,7 @@ public class BluetoothOppReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
+ if (D) Log.d(TAG, "Action :" + action);
/* Ignore if Broadcast action is not transfer complete and Invalid user */
if (!Utils.checkCaller() && !action.equals(BluetoothShare.TRANSFER_COMPLETED_ACTION)) {
diff --git a/src/com/android/bluetooth/opp/BluetoothOppService.java b/src/com/android/bluetooth/opp/BluetoothOppService.java
index 27519cc5b..c7c867051 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppService.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppService.java
@@ -158,7 +158,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();
@@ -658,9 +658,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 +808,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) {
diff --git a/src/com/android/bluetooth/opp/BluetoothOppShareInfo.java b/src/com/android/bluetooth/opp/BluetoothOppShareInfo.java
index 32f6b3cb3..cb35f6da0 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppShareInfo.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppShareInfo.java
@@ -60,17 +60,18 @@ public class BluetoothOppShareInfo {
public int mStatus;
- public int mTotalBytes;
+ public long mTotalBytes;
- public int mCurrentBytes;
+ public long mCurrentBytes;
public long mTimestamp;
public boolean mMediaScanned;
public BluetoothOppShareInfo(int id, Uri uri, String hint, String filename, String mimetype,
- int direction, String destination, int visibility, int confirm, int status,
- int totalBytes, int currentBytes, int timestamp, boolean mediaScanned) {
+ int direction, String destination, int visibility, int confirm, int status,
+ long totalBytes, long currentBytes, long timestamp, boolean mediaScanned) {
+
mId = id;
mUri = uri;
mHint = hint;
@@ -96,6 +97,7 @@ public class BluetoothOppShareInfo {
if (mStatus == BluetoothShare.STATUS_PENDING && mUri != null) {
return true;
}
+
} else if (mDirection == BluetoothShare.DIRECTION_INBOUND) {
if (mStatus == BluetoothShare.STATUS_PENDING) {
//&& mConfirm != BluetoothShare.USER_CONFIRMATION_PENDING) {
diff --git a/src/com/android/bluetooth/opp/BluetoothOppTransfer.java b/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
index 3943ea164..e1b720c5a 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
@@ -535,6 +535,7 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch
if (mBluetoothReceiver != null){
mContext.unregisterReceiver(mBluetoothReceiver);
mBluetoothReceiver = null;
+ if (V) Log.v(TAG, "Un Registered mBluetoothReceiver");
}
} catch (Exception e) {
Log.e(TAG, "Exception:unregisterReceiver");