Skip to content

Commit

Permalink
AWS SDK for Android 2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AWS committed Mar 21, 2017
1 parent 2254582 commit be47f21
Show file tree
Hide file tree
Showing 390 changed files with 27,428 additions and 4,917 deletions.
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
# Change Log - AWS SDK for Android
## [Release 2.4.0] (https://github.com/aws/aws-sdk-android/releases/tag/release_v2.4.0) (03/21/2017)

### Improvements:
- **Amazon Lex**:`LexVoiceButton` will now show an image of a bot when audio response from lex is being played.

### Bug Fixes:

- **Amazon API Gateway**: Allow marshalling alternative date formats in API Gateway.
- **Amazon Cognito Identity Provider**: Bug fix for missing required attribute Exception
- **Amazon IoT**: fix typo's with variable names in `AWSIoTMQTTManager`. See [issue #220](https://github.com/aws/aws-sdk-android/pull/220).
- **Amazon Lex**: Fix a bug which caused `readyToFulfill` to not file in `InteractionListener`.
- **Amazon Pinpoint**:Fix cursor leakage in Pinpoint.
- **Amazon Pinpoint**:Bug fixes for campaign open rate.
- **Amazon Pinpoint**:`PinpointEndpointClient` to retain instance of endpoint.
- **Amazon Pinpoint**:corrected the implemented for `optout` for profile.
- **Amazon Pinpoint**:Deprecated formatted price in `MonetizationEventBuilder`.
- **Amazon S3**: Bug Fixes with encryption client.
- **Amazon S3**: SigV4 signing is now default for S3. See [issue 234](https://github.com/aws/aws-sdk-android/issues/234) & [issue #108](https://github.com/awslabs/aws-sdk-android-samples/issues/108).
- **Amazon S3**: Added feature to specify listener in `TransferUtility.upload()`. See [issue #210](https://github.com/aws/aws-sdk-android/issues/210).
- **Amazon S3**: Fixed a bug where when using `setAccelerateModeEnabled` caused uploads to fail. See [issue #264](https://github.com/aws/aws-sdk-android/issues/264).
- **General** : Fixed a bug which caused incompatibility between maven releases and releases on [marketing page](https://aws.amazon.com/mobile/sdk).

## [Release 2.3.9] (https://github.com/aws/aws-sdk-android/releases/tag/release_v2.3.9) (02/02/2017)

### Improvements:

- **Amazon Kinesis Firehose & Amazon Kinesis Streams**: Allow setting a static partition key in the KenesisRecorderConfig. See [issue #228](https://github.com/aws/aws-sdk-android/pull/228).
- **Amazon Kinesis Firehose & Amazon Kinesis Streams**: Allow setting a static partition key in the KinesisRecorderConfig. See [issue #228](https://github.com/aws/aws-sdk-android/pull/228).
- **AWS KMS**: Updated service to latest spec.

### Bug Fixes:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.org/aws/aws-sdk-android.png?branch=master)](https://travis-ci.org/aws/aws-sdk-android)
[![GitHub release](https://img.shields.io/github/release/aws/aws-sdk-android.svg)]()
[![Maven Central](https://img.shields.io/maven-central/v/com.amazonaws/aws-android-sdk-pom.svg)]()
[![Twitter Follow](https://img.shields.io/twitter/follow/awsformobile.svg?style=social&label=Follow)](https://twitter.com/AWSforMobile)
[![Twitter Follow](https://img.shields.io/twitter/follow/awsformobile.svg?style=social&label=Follow)]()

The [AWS SDK for Android](http://aws.amazon.com/sdkforandroid) provides a library and documentation for developers to build connected mobile applications using AWS.

Expand Down
4 changes: 2 additions & 2 deletions aws-android-sdk-apigateway-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-pom</artifactId>
<version>2.3.9</version>
<version>2.4.0</version>
</parent>

<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-core</artifactId>
<optional>false</optional>
<version>2.3.9</version>
<version>2.4.0</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@
import com.amazonaws.http.UrlHttpClient;
import com.amazonaws.mobileconnectors.apigateway.annotation.Operation;
import com.amazonaws.mobileconnectors.apigateway.annotation.Parameter;
import com.amazonaws.util.DateUtils;
import com.amazonaws.util.IOUtils;
import com.amazonaws.util.StringUtils;
import com.amazonaws.util.json.DateDeserializer;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
Expand All @@ -43,14 +46,21 @@
import java.lang.reflect.Type;
import java.net.URI;
import java.util.Collection;
import java.util.Date;
import java.util.Map;

/**
* Invocation handler responsible for serializing a request and deserializing a
* response.
*/
class ApiClientHandler implements InvocationHandler {
private static final Gson gson = new Gson();


private static final Gson gson = new GsonBuilder()
.registerTypeAdapter(Date.class, new DateDeserializer(new String[] {
DateUtils.ISO8601_DATE_PATTERN, DateUtils.ALTERNATE_ISO8601_DATE_PATTERN,
DateUtils.COMPRESSED_DATE_PATTERN, DateUtils.RFC822_DATE_PATTERN
})).create();

private final String endpoint;
private final String apiName;
Expand All @@ -62,12 +72,13 @@ class ApiClientHandler implements InvocationHandler {
// 'x-api-key' header.
private final String apiKey;

private final HttpClient client;
private HttpClient client;
private final HttpRequestFactory requestFactory;
private final ClientConfiguration clientConfiguration;

ApiClientHandler(String endpoint, String apiName,
Signer signer, AWSCredentialsProvider provider, String apiKey, ClientConfiguration clientConfiguration) {
Signer signer, AWSCredentialsProvider provider, String apiKey,
ClientConfiguration clientConfiguration) {
this.endpoint = endpoint;
this.apiName = apiName;
this.signer = signer;
Expand Down Expand Up @@ -197,9 +208,9 @@ Request<?> buildRequest(Method method, Object[] args) {
void processParameter(Request<?> request, Parameter p, Object arg) {
final String name = p.name();
final String location = p.location();

if (arg == null) {
return;
return;
}

if ("header".equals(location)) {
Expand All @@ -211,8 +222,7 @@ void processParameter(Request<?> request, Parameter p, Object arg) {
} else if ("query".equals(location)) {
if (Map.class.isAssignableFrom(arg.getClass())) {
@SuppressWarnings("unchecked")
final
Map<String, Object> map = (Map<String, Object>) arg;
final Map<String, Object> map = (Map<String, Object>) arg;
for (final Map.Entry<String, Object> entry : map.entrySet()) {
request.addParameter(entry.getKey(), String.valueOf(entry.getValue()));
}
Expand Down Expand Up @@ -341,4 +351,8 @@ private String joinList(Collection<?> objects) {
}
return sb.toString();
}

void setClient(HttpClient client) {
this.client = client;
}
}
4 changes: 2 additions & 2 deletions aws-android-sdk-autoscaling/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-pom</artifactId>
<version>2.3.9</version>
<version>2.4.0</version>
</parent>

<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-core</artifactId>
<optional>false</optional>
<version>2.3.9</version>
<version>2.4.0</version>
</dependency>
</dependencies>

Expand Down
4 changes: 2 additions & 2 deletions aws-android-sdk-cloudwatch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-pom</artifactId>
<version>2.3.9</version>
<version>2.4.0</version>
</parent>

<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-core</artifactId>
<optional>false</optional>
<version>2.3.9</version>
<version>2.4.0</version>
</dependency>
</dependencies>

Expand Down
6 changes: 3 additions & 3 deletions aws-android-sdk-cognito/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<artifactId>aws-android-sdk-cognito</artifactId>
<packaging>jar</packaging>
<name>AWS SDK for Android - Amazon Cognito Sync</name>
<version>2.3.9</version>
<version>2.4.0</version>
<description>The AWS Android SDK for Amazon Cognito Sync module holds the client classes that are used for communicating with Amazon Cognito Sync Service</description>
<url>http://aws.amazon.com/sdkforandroid</url>

<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-pom</artifactId>
<version>2.3.9</version>
<version>2.4.0</version>
</parent>

<licenses>
Expand All @@ -29,7 +29,7 @@
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-core</artifactId>
<optional>false</optional>
<version>2.3.9</version>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fabric-identifier=com.amazonaws.aws-android-sdk-cognito
fabric-version=2.3.9
fabric-version=2.4.0
fabric-build-type=binary
6 changes: 3 additions & 3 deletions aws-android-sdk-cognitoidentityprovider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<artifactId>aws-android-sdk-cognitoidentityprovider</artifactId>
<packaging>jar</packaging>
<name>AWS SDK for Android - Amazon Cognito Identity Provider</name>
<version>2.3.9</version>
<version>2.4.0</version>
<description>The AWS Android SDK for Amazon Cognito Identity Provider module holds the client classes that are used for communicating with Amazon Cognito Identity Provider Service</description>
<url>http://aws.amazon.com/sdkforandroid</url>

<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-pom</artifactId>
<version>2.3.9</version>
<version>2.4.0</version>
</parent>

<licenses>
Expand All @@ -29,7 +29,7 @@
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-core</artifactId>
<optional>false</optional>
<version>2.3.9</version>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
Expand Down
2 changes: 1 addition & 1 deletion aws-android-sdk-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-pom</artifactId>
<version>2.3.9</version>
<version>2.4.0</version>
</parent>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class SDKGlobalConfiguration {
/**
* Path to an override file for the region metadata loaded by the SDK that
* maps service/region pairs to endpoints and vice versa.
*
*
* @deprecated The SDK no longer supports a regions.xml override
*/
@Deprecated
Expand Down Expand Up @@ -102,6 +102,7 @@ public class SDKGlobalConfiguration {
* calculating a SHA-256 hash of the entire request body which can be
* expensive for large upload requests.
*/
@Deprecated
public static final String ENABLE_S3_SIGV4_SYSTEM_PROPERTY =
"com.amazonaws.services.s3.enableV4";

Expand All @@ -113,6 +114,7 @@ public class SDKGlobalConfiguration {
* will cause authentication failures in code that accesses buckets in
* regions other than US Standard without explicitly configuring a region.
*/
@Deprecated
public static final String ENFORCE_S3_SIGV4_SYSTEM_PROPERTY =
"com.amazonaws.services.s3.enforceV4";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
public class VersionInfoUtils {
/** SDK version info */
private static volatile String version = "2.3.9";
private static volatile String version = "2.4.0";
// changed build
// logic

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package com.amazonaws.util.json;

import com.amazonaws.util.DateUtils;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

import java.lang.reflect.Type;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

public class DateDeserializer implements JsonDeserializer<Date>, JsonSerializer<Date> {

private SimpleDateFormat mSimpleDateFormat;
private final List<String> dateFormats;
private final SimpleDateFormat mIso8601DateFormat;

public DateDeserializer(String[] dateFormats) {
this.dateFormats = Arrays.asList(dateFormats);
this.mIso8601DateFormat = new SimpleDateFormat(DateUtils.ISO8601_DATE_PATTERN);
}

@Override
public Date deserialize(JsonElement element, Type arg1, JsonDeserializationContext context)
throws JsonParseException {
final String dateString = element.getAsString();
Date date = null;
for (final String df : dateFormats) {
try {
date = new Date();
mSimpleDateFormat = new SimpleDateFormat(df);
date.setTime(mSimpleDateFormat.parse(dateString).getTime());
return date;
} catch (final ParseException e) {
// swallow , will try next type of date format
}
}
// default to default implementation
try {
return DateFormat.getDateInstance(DateFormat.DEFAULT).parse(dateString);
} catch (final ParseException e) {
throw new JsonParseException(e.getMessage(), e);
}

}

@Override
public JsonElement serialize(Date src, Type typeOfSrc,
JsonSerializationContext context) {
synchronized (mIso8601DateFormat) {
final String dateFormatAsString = mIso8601DateFormat.format(src);
return new JsonPrimitive(dateFormatAsString);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fabric-identifier=com.amazonaws.aws-android-sdk-core
fabric-version=2.3.9
fabric-version=2.4.0
fabric-build-type=binary
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class VersionInfoUtilsTest {

@Test
public void getVersion() {
assertEquals("2.3.9", VersionInfoUtils.getVersion());
assertEquals("2.4.0", VersionInfoUtils.getVersion());
}

@Test
Expand Down
8 changes: 4 additions & 4 deletions aws-android-sdk-ddb-mapper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-pom</artifactId>
<version>2.3.9</version>
<version>2.4.0</version>
</parent>

<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-core</artifactId>
<optional>false</optional>
<version>2.3.9</version>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-ddb</artifactId>
<optional>false</optional>
<version>2.3.9</version>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-s3</artifactId>
<optional>false</optional>
<version>2.3.9</version>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Loading

0 comments on commit be47f21

Please sign in to comment.