Loading android/app/src/com/android/bluetooth/opp/BluetoothOppNotification.java +14 −6 Original line number Original line Diff line number Diff line Loading @@ -111,9 +111,9 @@ class BluetoothOppNotification { int direction; // to indicate sending or receiving 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. long timeStamp = 0; // Database time stamp. Used for sorting ongoing transfers. Loading Loading @@ -241,8 +241,8 @@ class BluetoothOppNotification { long timeStamp = cursor.getLong(timestampIndex); long timeStamp = cursor.getLong(timestampIndex); int dir = cursor.getInt(directionIndex); int dir = cursor.getInt(directionIndex); int id = cursor.getInt(idIndex); int id = cursor.getInt(idIndex); int total = cursor.getInt(totalBytesIndex); long total = cursor.getLong(totalBytesIndex); int current = cursor.getInt(currentBytesIndex); long current = cursor.getLong(currentBytesIndex); int confirmation = cursor.getInt(confirmIndex); int confirmation = cursor.getInt(confirmIndex); String destination = cursor.getString(destinationIndex); String destination = cursor.getString(destinationIndex); Loading Loading @@ -319,7 +319,15 @@ class BluetoothOppNotification { b.setContentTitle(item.description); b.setContentTitle(item.description); b.setContentInfo( b.setContentInfo( BluetoothOppUtility.formatProgressText(item.totalTotal, item.totalCurrent)); 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); b.setWhen(item.timeStamp); if (item.direction == BluetoothShare.DIRECTION_OUTBOUND) { if (item.direction == BluetoothShare.DIRECTION_OUTBOUND) { b.setSmallIcon(android.R.drawable.stat_sys_upload); b.setSmallIcon(android.R.drawable.stat_sys_upload); Loading android/app/src/com/android/bluetooth/opp/BluetoothOppObexServerSession.java +3 −1 Original line number Original line Diff line number Diff line Loading @@ -268,7 +268,9 @@ public class BluetoothOppObexServerSession extends ServerRequestHandler implemen ContentValues values = new ContentValues(); ContentValues values = new ContentValues(); values.put(BluetoothShare.FILENAME_HINT, name); 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.MIMETYPE, mimeType); values.put(BluetoothShare.DESTINATION, destination); values.put(BluetoothShare.DESTINATION, destination); Loading android/app/src/com/android/bluetooth/opp/BluetoothOppProvider.java +8 −2 Original line number Original line Diff line number Diff line Loading @@ -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 @Override public Uri insert(Uri uri, ContentValues values) { public Uri insert(Uri uri, ContentValues values) { SQLiteDatabase db = mOpenHelper.getWritableDatabase(); SQLiteDatabase db = mOpenHelper.getWritableDatabase(); Loading @@ -232,8 +239,7 @@ public final class BluetoothOppProvider extends ContentProvider { copyString(BluetoothShare.DESTINATION, values, filteredValues); copyString(BluetoothShare.DESTINATION, values, filteredValues); copyInteger(BluetoothShare.VISIBILITY, 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) { if (values.getAsInteger(BluetoothShare.VISIBILITY) == null) { filteredValues.put(BluetoothShare.VISIBILITY, BluetoothShare.VISIBILITY_VISIBLE); filteredValues.put(BluetoothShare.VISIBILITY, BluetoothShare.VISIBILITY_VISIBLE); } } Loading android/app/src/com/android/bluetooth/opp/BluetoothOppReceiveFileInfo.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -100,7 +100,7 @@ public class BluetoothOppReceiveFileInfo { try { try { if (metadataCursor.moveToFirst()) { if (metadataCursor.moveToFirst()) { hint = metadataCursor.getString(0); hint = metadataCursor.getString(0); length = metadataCursor.getInt(1); length = metadataCursor.getLong(1); mimeType = metadataCursor.getString(2); mimeType = metadataCursor.getString(2); } } } finally { } finally { Loading android/app/src/com/android/bluetooth/opp/BluetoothOppSendFileInfo.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -122,7 +122,7 @@ public class BluetoothOppSendFileInfo { try { try { if (metadataCursor.moveToFirst()) { if (metadataCursor.moveToFirst()) { fileName = metadataCursor.getString(0); fileName = metadataCursor.getString(0); length = metadataCursor.getInt(1); length = metadataCursor.getLong(1); if (D) Log.d(TAG, "fileName = " + fileName + " length = " + length); if (D) Log.d(TAG, "fileName = " + fileName + " length = " + length); } } } finally { } finally { Loading Loading
android/app/src/com/android/bluetooth/opp/BluetoothOppNotification.java +14 −6 Original line number Original line Diff line number Diff line Loading @@ -111,9 +111,9 @@ class BluetoothOppNotification { int direction; // to indicate sending or receiving 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. long timeStamp = 0; // Database time stamp. Used for sorting ongoing transfers. Loading Loading @@ -241,8 +241,8 @@ class BluetoothOppNotification { long timeStamp = cursor.getLong(timestampIndex); long timeStamp = cursor.getLong(timestampIndex); int dir = cursor.getInt(directionIndex); int dir = cursor.getInt(directionIndex); int id = cursor.getInt(idIndex); int id = cursor.getInt(idIndex); int total = cursor.getInt(totalBytesIndex); long total = cursor.getLong(totalBytesIndex); int current = cursor.getInt(currentBytesIndex); long current = cursor.getLong(currentBytesIndex); int confirmation = cursor.getInt(confirmIndex); int confirmation = cursor.getInt(confirmIndex); String destination = cursor.getString(destinationIndex); String destination = cursor.getString(destinationIndex); Loading Loading @@ -319,7 +319,15 @@ class BluetoothOppNotification { b.setContentTitle(item.description); b.setContentTitle(item.description); b.setContentInfo( b.setContentInfo( BluetoothOppUtility.formatProgressText(item.totalTotal, item.totalCurrent)); 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); b.setWhen(item.timeStamp); if (item.direction == BluetoothShare.DIRECTION_OUTBOUND) { if (item.direction == BluetoothShare.DIRECTION_OUTBOUND) { b.setSmallIcon(android.R.drawable.stat_sys_upload); b.setSmallIcon(android.R.drawable.stat_sys_upload); Loading
android/app/src/com/android/bluetooth/opp/BluetoothOppObexServerSession.java +3 −1 Original line number Original line Diff line number Diff line Loading @@ -268,7 +268,9 @@ public class BluetoothOppObexServerSession extends ServerRequestHandler implemen ContentValues values = new ContentValues(); ContentValues values = new ContentValues(); values.put(BluetoothShare.FILENAME_HINT, name); 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.MIMETYPE, mimeType); values.put(BluetoothShare.DESTINATION, destination); values.put(BluetoothShare.DESTINATION, destination); Loading
android/app/src/com/android/bluetooth/opp/BluetoothOppProvider.java +8 −2 Original line number Original line Diff line number Diff line Loading @@ -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 @Override public Uri insert(Uri uri, ContentValues values) { public Uri insert(Uri uri, ContentValues values) { SQLiteDatabase db = mOpenHelper.getWritableDatabase(); SQLiteDatabase db = mOpenHelper.getWritableDatabase(); Loading @@ -232,8 +239,7 @@ public final class BluetoothOppProvider extends ContentProvider { copyString(BluetoothShare.DESTINATION, values, filteredValues); copyString(BluetoothShare.DESTINATION, values, filteredValues); copyInteger(BluetoothShare.VISIBILITY, 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) { if (values.getAsInteger(BluetoothShare.VISIBILITY) == null) { filteredValues.put(BluetoothShare.VISIBILITY, BluetoothShare.VISIBILITY_VISIBLE); filteredValues.put(BluetoothShare.VISIBILITY, BluetoothShare.VISIBILITY_VISIBLE); } } Loading
android/app/src/com/android/bluetooth/opp/BluetoothOppReceiveFileInfo.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -100,7 +100,7 @@ public class BluetoothOppReceiveFileInfo { try { try { if (metadataCursor.moveToFirst()) { if (metadataCursor.moveToFirst()) { hint = metadataCursor.getString(0); hint = metadataCursor.getString(0); length = metadataCursor.getInt(1); length = metadataCursor.getLong(1); mimeType = metadataCursor.getString(2); mimeType = metadataCursor.getString(2); } } } finally { } finally { Loading
android/app/src/com/android/bluetooth/opp/BluetoothOppSendFileInfo.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -122,7 +122,7 @@ public class BluetoothOppSendFileInfo { try { try { if (metadataCursor.moveToFirst()) { if (metadataCursor.moveToFirst()) { fileName = metadataCursor.getString(0); fileName = metadataCursor.getString(0); length = metadataCursor.getInt(1); length = metadataCursor.getLong(1); if (D) Log.d(TAG, "fileName = " + fileName + " length = " + length); if (D) Log.d(TAG, "fileName = " + fileName + " length = " + length); } } } finally { } finally { Loading