junit
diff --git a/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/TransferObserver.java b/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/TransferObserver.java
index 33887eab3b3..26845d882a3 100644
--- a/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/TransferObserver.java
+++ b/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/TransferObserver.java
@@ -104,7 +104,6 @@ public class TransferObserver {
*
* @param id The transfer id of the transfer to be observed.
* @param dbUtil an instance of database utility
- * @param c a cursor to read the state of the transfer from
*/
TransferObserver(int id, TransferDBUtil dbUtil) {
this.id = id;
diff --git a/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/package-info.java b/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/package-info.java
index c0dbcf5b6f5..cbe1c628edf 100644
--- a/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/package-info.java
+++ b/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/package-info.java
@@ -1,6 +1,6 @@
/**
* This package contains helper classes for managing upload and download tasks and a public
- * class {@link com.amazonaws.mobileconnectors.s3.transferservice.transferUtility}
+ * class {@link com.amazonaws.mobileconnectors.s3.transferutility.TransferUtility}
* which is a high level client that provides methods to control users' upload and download tasks.
*
* For starting transfer tasks, here is a sample usage.
@@ -8,6 +8,7 @@
*
* // Initializes TransferUtility
* TransferUtility transferUtility = new TransferUtility(s3, getApplicationContext());
+ *
* // Starts a download
* TransferObserver observer = transferUtility.download("bucket_name", "key", file);
* observer.setTransferListener(new TransferListener() {
diff --git a/aws-android-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java b/aws-android-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
index fd1efd0ea7c..185c2729c54 100644
--- a/aws-android-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
+++ b/aws-android-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
@@ -213,6 +213,9 @@ public class AmazonS3Client extends AmazonWebServiceClient implements AmazonS3 {
*/
volatile String clientRegion;
+ // Number of Kbytes that needs to be written before status updates are called
+ private int notificationThreshold = 1024;
+
private static final int BUCKET_REGION_CACHE_SIZE = 300;
private static final Map bucketRegionCache = Collections.synchronizedMap(
@@ -432,6 +435,20 @@ private void init() {
"/com/amazonaws/services/s3/request.handler2s"));
}
+
+ /**
+ * Sets the number of Kbytes that need to be written before updates to the
+ * listener occur.
+ *
+ * @param threshold Number of Kbytes that needs to be written before
+ * write update notification occurs.
+ */
+ public void setNotificationThreshold(final int threshold) {
+ this.notificationThreshold = threshold;
+ }
+
+
+
@Override
public void setEndpoint(String endpoint) {
if (endpoint.endsWith(Constants.S3_ACCELERATE_HOSTNAME)) {
@@ -1393,6 +1410,7 @@ public S3Object getObject(GetObjectRequest getObjectRequest)
ProgressReportingInputStream progressReportingInputStream = new ProgressReportingInputStream(
input, progressListenerCallbackExecutor);
progressReportingInputStream.setFireCompletedEvent(true);
+ progressReportingInputStream.setNotificationThreshold(this.notificationThreshold);
input = progressReportingInputStream;
fireProgressEvent(progressListenerCallbackExecutor,
ProgressEvent.STARTED_EVENT_CODE);
@@ -1684,6 +1702,7 @@ public PutObjectResult putObject(PutObjectRequest putObjectRequest)
if (progressListenerCallbackExecutor != null) {
input = new ProgressReportingInputStream(input, progressListenerCallbackExecutor);
+ ((ProgressReportingInputStream)input).setNotificationThreshold(this.notificationThreshold);
fireProgressEvent(progressListenerCallbackExecutor, ProgressEvent.STARTED_EVENT_CODE);
}
@@ -3631,10 +3650,9 @@ public UploadPartResult uploadPart(UploadPartRequest uploadPartRequest)
.wrapListener(progressListener);
if (progressListenerCallbackExecutor != null) {
- inputStream = new ProgressReportingInputStream(inputStream,
- progressListenerCallbackExecutor);
- fireProgressEvent(progressListenerCallbackExecutor,
- ProgressEvent.PART_STARTED_EVENT_CODE);
+ inputStream = new ProgressReportingInputStream(inputStream, progressListenerCallbackExecutor);
+ ((ProgressReportingInputStream)inputStream).setNotificationThreshold(this.notificationThreshold);
+ fireProgressEvent(progressListenerCallbackExecutor, ProgressEvent.PART_STARTED_EVENT_CODE);
}
try {
diff --git a/aws-android-sdk-sdb/pom.xml b/aws-android-sdk-sdb/pom.xml
index 5ff658e14ae..0b893051a8b 100644
--- a/aws-android-sdk-sdb/pom.xml
+++ b/aws-android-sdk-sdb/pom.xml
@@ -12,7 +12,7 @@
com.amazonaws
aws-android-sdk-pom
- 2.6.5
+ 2.6.6
@@ -20,7 +20,7 @@
com.amazonaws
aws-android-sdk-core
false
- 2.6.5
+ 2.6.6