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

Commit 8a636b95 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Bluetooth: OPP: Use long as file size instead of int"

parents 9e994c7a 701b6cc9
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -112,9 +112,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.

@@ -261,8 +261,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);
@@ -337,7 +337,15 @@ class BluetoothOppNotification {
            b.setContentTitle(item.description);
            b.setContentInfo(
                BluetoothOppUtility.formatProgressText(mContext, 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);
+1 −1
Original line number Diff line number Diff line
@@ -407,7 +407,7 @@ public class BluetoothOppObexClientSession implements BluetoothOppObexSession {
            ContentValues updateValues;
            ContentResolverUpdateThread uiUpdateThread = null;
            HeaderSet reply;
            int position = 0;
            long position = 0;
            reply = new HeaderSet();
            HeaderSet request;
            request = new HeaderSet();
+10 −7
Original line number Diff line number Diff line
@@ -426,16 +426,19 @@ public class BluetoothOppTransferActivity extends AlertActivity implements
            return;
        }

        if (mTransInfo.mTotalBytes == 0) {
            // if Max and progress both equal 0, the progress display 100%.
            // Below is to fix it.
        // Set Transfer Max as 100. Percentage calculation would be done in setProgress API
        mProgressTransfer.setMax(100);

        if (mTransInfo.mTotalBytes != 0) {
            if (V) Log.v(TAG, "mCurrentBytes: " + mTransInfo.mCurrentBytes +
                " mTotalBytes: " + mTransInfo.mTotalBytes + " (" +
                (int)((mTransInfo.mCurrentBytes * 100) / mTransInfo.mTotalBytes) + "%)");
            mProgressTransfer.setProgress((int)((mTransInfo.mCurrentBytes * 100) /
                mTransInfo.mTotalBytes));
        } else {
            mProgressTransfer.setMax(mTransInfo.mTotalBytes);
            mProgressTransfer.setProgress(100);
        }

        mProgressTransfer.setProgress(mTransInfo.mCurrentBytes);

        mPercentView.setText(BluetoothOppUtility.formatProgressText(this, mTransInfo.mTotalBytes,
                mTransInfo.mCurrentBytes));

+2 −2
Original line number Diff line number Diff line
@@ -41,9 +41,9 @@ public class BluetoothOppTransferInfo {

    int mDirection;

    int mTotalBytes;
    long mTotalBytes;

    int mCurrentBytes;
    long mCurrentBytes;

    int mStatus;

+2 −2
Original line number Diff line number Diff line
@@ -83,9 +83,9 @@ public class BluetoothOppUtility {
                info.mStatus = cursor.getInt(cursor.getColumnIndexOrThrow(BluetoothShare.STATUS));
                info.mDirection = cursor.getInt(cursor
                        .getColumnIndexOrThrow(BluetoothShare.DIRECTION));
                info.mTotalBytes = cursor.getInt(cursor
                info.mTotalBytes = cursor.getLong(cursor
                        .getColumnIndexOrThrow(BluetoothShare.TOTAL_BYTES));
                info.mCurrentBytes = cursor.getInt(cursor
                info.mCurrentBytes = cursor.getLong(cursor
                        .getColumnIndexOrThrow(BluetoothShare.CURRENT_BYTES));
                info.mTimeStamp = cursor.getLong(cursor
                        .getColumnIndexOrThrow(BluetoothShare.TIMESTAMP));