Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bda98d0a authored by Hemant Gupta's avatar Hemant Gupta Committed by Andre Eisenbach
Browse files

OPP: Use long instead of int

Use long instead of int data type in OPP Java code to prevent
overflow of timestamp and filesize during transfer of large files
which caused transfer failures.

Change-Id: I58c9b49f59d47f6f162156eb6594e66731732580
parent ec9eafb8
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -578,9 +578,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) {
@@ -730,10 +730,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) {
+3 −3
Original line number Diff line number Diff line
@@ -60,9 +60,9 @@ public class BluetoothOppShareInfo {

    public int mStatus;

    public int mTotalBytes;
    public long mTotalBytes;

    public int mCurrentBytes;
    public long mCurrentBytes;

    public long mTimestamp;

@@ -70,7 +70,7 @@ public class BluetoothOppShareInfo {

    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) {
            long totalBytes, long currentBytes, long timestamp, boolean mediaScanned) {
        mId = id;
        mUri = uri;
        mHint = hint;