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

Commit 6697d59b authored by Pradeep Panigrahi's avatar Pradeep Panigrahi Committed by Android Git Automerger
Browse files

am aba39f23: am 1de18457: am a4f678e5: Use long as file size instead of int while using OPP.

* commit 'aba39f23':
  Use long as file size instead of int while using OPP.
parents 39507165 aba39f23
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -111,9 +111,9 @@ class BluetoothOppNotification {

        int direction; // to indicate sending or receiving

        int totalCurrent = 0; // current transfer bytes
        long totalCurrent = 0; // current transfer bytes

        int totalTotal = 0; // total bytes for current transfer
        long totalTotal = 0; // total bytes for current transfer

        long timeStamp = 0; // Database time stamp. Used for sorting ongoing transfers.

@@ -241,8 +241,8 @@ class BluetoothOppNotification {
            long timeStamp = cursor.getLong(timestampIndex);
            int dir = cursor.getInt(directionIndex);
            int id = cursor.getInt(idIndex);
            int total = cursor.getInt(totalBytesIndex);
            int current = cursor.getInt(currentBytesIndex);
            long total = cursor.getLong(totalBytesIndex);
            long current = cursor.getLong(currentBytesIndex);
            int confirmation = cursor.getInt(confirmIndex);

            String destination = cursor.getString(destinationIndex);
@@ -319,7 +319,15 @@ class BluetoothOppNotification {
            b.setContentTitle(item.description);
            b.setContentInfo(
                BluetoothOppUtility.formatProgressText(item.totalTotal, item.totalCurrent));
            b.setProgress(item.totalTotal, item.totalCurrent, item.totalTotal == -1);
            if (item.totalTotal != 0) {
                if (V) Log.v(TAG, "mCurrentBytes: " + item.totalCurrent +
                    " mTotalBytes: " + item.totalTotal + " (" +
                    (int)((item.totalCurrent * 100) / item.totalTotal) + " %)");
                b.setProgress(100, (int)((item.totalCurrent * 100) / item.totalTotal),
                    item.totalTotal == -1);
            } else {
                b.setProgress(100, 100, item.totalTotal == -1);
            }
            b.setWhen(item.timeStamp);
            if (item.direction == BluetoothShare.DIRECTION_OUTBOUND) {
                b.setSmallIcon(android.R.drawable.stat_sys_upload);
+3 −1
Original line number Diff line number Diff line
@@ -268,7 +268,9 @@ public class BluetoothOppObexServerSession extends ServerRequestHandler implemen
        ContentValues values = new ContentValues();

        values.put(BluetoothShare.FILENAME_HINT, name);
        values.put(BluetoothShare.TOTAL_BYTES, length.intValue());

        values.put(BluetoothShare.TOTAL_BYTES, length);

        values.put(BluetoothShare.MIMETYPE, mimeType);

        values.put(BluetoothShare.DESTINATION, destination);
+8 −2
Original line number Diff line number Diff line
@@ -215,6 +215,13 @@ public final class BluetoothOppProvider extends ContentProvider {
        }
    }

    private static final void copyLong(String key, ContentValues from, ContentValues to) {
        Long i = from.getAsLong(key);
        if (i != null) {
            to.put(key, i);
        }
    }

    @Override
    public Uri insert(Uri uri, ContentValues values) {
        SQLiteDatabase db = mOpenHelper.getWritableDatabase();
@@ -232,8 +239,7 @@ public final class BluetoothOppProvider extends ContentProvider {
        copyString(BluetoothShare.DESTINATION, values, filteredValues);

        copyInteger(BluetoothShare.VISIBILITY, values, filteredValues);
        copyInteger(BluetoothShare.TOTAL_BYTES, values, filteredValues);

        copyLong(BluetoothShare.TOTAL_BYTES, values, filteredValues);
        if (values.getAsInteger(BluetoothShare.VISIBILITY) == null) {
            filteredValues.put(BluetoothShare.VISIBILITY, BluetoothShare.VISIBILITY_VISIBLE);
        }
+1 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ public class BluetoothOppReceiveFileInfo {
            try {
                if (metadataCursor.moveToFirst()) {
                    hint = metadataCursor.getString(0);
                    length = metadataCursor.getInt(1);
                    length = metadataCursor.getLong(1);
                    mimeType = metadataCursor.getString(2);
                }
            } finally {
+1 −1
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ public class BluetoothOppSendFileInfo {
                try {
                    if (metadataCursor.moveToFirst()) {
                        fileName = metadataCursor.getString(0);
                        length = metadataCursor.getInt(1);
                        length = metadataCursor.getLong(1);
                        if (D) Log.d(TAG, "fileName = " + fileName + " length = " + length);
                    }
                } finally {
Loading