Skip to content

Commit 6591694

Browse files
author
AWS
committed
AWS SDK for Android 2.4.6
1 parent 84700f6 commit 6591694

File tree

72 files changed

+570
-931
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+570
-931
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Change Log - AWS SDK for Android
22

3+
## [Release 2.4.6](https://github.com/aws/aws-sdk-android/releases/tag/release_v2.4.6)
4+
5+
### Bug Fixes:
6+
7+
- **Amazon Cognito Identity Provider**
8+
- Fixed bug that caused `CognitoDeviceHelper.getDeviceKey` to return null on certain cases. See [issue #259](https://github.com/aws/aws-sdk-android/issues/259)
9+
- Fixed bug where `onSuccess` callback was missing from `verifyAttribute` function. See [issue #266](https://github.com/aws/aws-sdk-android/issues/266)
10+
11+
- **Amazon Pinpoint**
12+
- Fix crash in Pinpoint SDK when getting locale's country code.
13+
314
## [Release 2.4.5](https://github.com/aws/aws-sdk-android/releases/tag/release_v2.4.5)
415

516
- **Amazon S3**

aws-android-sdk-apigateway-core/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
<parent>
1313
<groupId>com.amazonaws</groupId>
1414
<artifactId>aws-android-sdk-pom</artifactId>
15-
<version>2.4.5</version>
15+
<version>2.4.6</version>
1616
</parent>
1717

1818
<dependencies>
1919
<dependency>
2020
<groupId>com.amazonaws</groupId>
2121
<artifactId>aws-android-sdk-core</artifactId>
2222
<optional>false</optional>
23-
<version>2.4.5</version>
23+
<version>2.4.6</version>
2424
</dependency>
2525
</dependencies>
2626

aws-android-sdk-autoscaling/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
<parent>
1313
<groupId>com.amazonaws</groupId>
1414
<artifactId>aws-android-sdk-pom</artifactId>
15-
<version>2.4.5</version>
15+
<version>2.4.6</version>
1616
</parent>
1717

1818
<dependencies>
1919
<dependency>
2020
<groupId>com.amazonaws</groupId>
2121
<artifactId>aws-android-sdk-core</artifactId>
2222
<optional>false</optional>
23-
<version>2.4.5</version>
23+
<version>2.4.6</version>
2424
</dependency>
2525
</dependencies>
2626

aws-android-sdk-cloudwatch/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
<parent>
1313
<groupId>com.amazonaws</groupId>
1414
<artifactId>aws-android-sdk-pom</artifactId>
15-
<version>2.4.5</version>
15+
<version>2.4.6</version>
1616
</parent>
1717

1818
<dependencies>
1919
<dependency>
2020
<groupId>com.amazonaws</groupId>
2121
<artifactId>aws-android-sdk-core</artifactId>
2222
<optional>false</optional>
23-
<version>2.4.5</version>
23+
<version>2.4.6</version>
2424
</dependency>
2525
</dependencies>
2626

aws-android-sdk-cognito/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
<artifactId>aws-android-sdk-cognito</artifactId>
77
<packaging>jar</packaging>
88
<name>AWS SDK for Android - Amazon Cognito Sync</name>
9-
<version>2.4.5</version>
9+
<version>2.4.6</version>
1010
<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>
1111
<url>http://aws.amazon.com/sdkforandroid</url>
1212

1313
<parent>
1414
<groupId>com.amazonaws</groupId>
1515
<artifactId>aws-android-sdk-pom</artifactId>
16-
<version>2.4.5</version>
16+
<version>2.4.6</version>
1717
</parent>
1818

1919
<licenses>
@@ -29,7 +29,7 @@
2929
<groupId>com.amazonaws</groupId>
3030
<artifactId>aws-android-sdk-core</artifactId>
3131
<optional>false</optional>
32-
<version>2.4.5</version>
32+
<version>2.4.6</version>
3333
</dependency>
3434
<dependency>
3535
<groupId>com.google.android</groupId>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
fabric-identifier=com.amazonaws.aws-android-sdk-cognito
2-
fabric-version=2.4.5
2+
fabric-version=2.4.6
33
fabric-build-type=binary

aws-android-sdk-cognitoauth/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
<artifactId>aws-android-sdk-cognitoauth</artifactId>
77
<packaging>aar</packaging>
88
<name>AWS SDK for Android - Amazon Cognito Auth</name>
9-
<version>2.4.5</version>
9+
<version>2.4.6</version>
1010
<description>The AWS Android SDK with app integration for Amazon Cognito Your User Pools Service</description>
1111
<url>http://aws.amazon.com/sdkforandroid</url>
1212

1313
<parent>
1414
<groupId>com.amazonaws</groupId>
1515
<artifactId>aws-android-sdk-pom</artifactId>
16-
<version>2.4.5</version>
16+
<version>2.4.6</version>
1717
</parent>
1818

1919
<repositories>

aws-android-sdk-cognitoidentityprovider/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
<artifactId>aws-android-sdk-cognitoidentityprovider</artifactId>
77
<packaging>jar</packaging>
88
<name>AWS SDK for Android - Amazon Cognito Identity Provider</name>
9-
<version>2.4.5</version>
9+
<version>2.4.6</version>
1010
<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>
1111
<url>http://aws.amazon.com/sdkforandroid</url>
1212

1313
<parent>
1414
<groupId>com.amazonaws</groupId>
1515
<artifactId>aws-android-sdk-pom</artifactId>
16-
<version>2.4.5</version>
16+
<version>2.4.6</version>
1717
</parent>
1818

1919
<licenses>
@@ -29,7 +29,7 @@
2929
<groupId>com.amazonaws</groupId>
3030
<artifactId>aws-android-sdk-core</artifactId>
3131
<optional>false</optional>
32-
<version>2.4.5</version>
32+
<version>2.4.6</version>
3333
</dependency>
3434
<dependency>
3535
<groupId>com.google.android</groupId>

aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/mobileconnectors/cognitoidentityprovider/CognitoUser.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,7 @@ public void verifyAttribute(String attributeName,
11721172
try {
11731173
final VerifyUserAttributeResult verifyUserAttributeResult = verifyAttributeInternal(
11741174
attributeName, verificationCode, this.getCachedSession());
1175+
callback.onSuccess();
11751176
} catch (final Exception e) {
11761177
callback.onFailure(e);
11771178
}
@@ -2298,7 +2299,8 @@ private InitiateAuthRequest initiateRefreshTokenAuthRequest(CognitoUserSession c
22982299
deviceKey = CognitoDeviceHelper.getDeviceKey(usernameInternal, pool.getUserPoolId(),
22992300
context);
23002301
} else {
2301-
deviceKey = CognitoDeviceHelper.getDeviceKey(userId, pool.getUserPoolId(), context);
2302+
deviceKey = CognitoDeviceHelper.getDeviceKey(currSession.getUsername(),
2303+
pool.getUserPoolId(), context);
23022304
}
23032305
}
23042306
initiateAuthRequest.addAuthParametersEntry(CognitoServiceConstants.AUTH_PARAM_DEVICE_KEY,
@@ -2536,7 +2538,8 @@ public void listDevices(int limit, String paginationToken, DevicesHandler callba
25362538

25372539
/**
25382540
* Returns the current device, if users in this pool can remember devices.
2539-
*
2541+
* If a deviceKey is not found with the userId, the deviceKey is searched
2542+
* with the username in cached tokens, if any.
25402543
* @return {@link CognitoDevice} if the device is available, null otherwise.
25412544
*/
25422545
public CognitoDevice thisDevice() {
@@ -2546,6 +2549,11 @@ public CognitoDevice thisDevice() {
25462549
context);
25472550
} else if (userId != null) {
25482551
deviceKey = CognitoDeviceHelper.getDeviceKey(userId, pool.getUserPoolId(), context);
2552+
if (deviceKey == null) {
2553+
CognitoUserSession currSession = this.readCachedTokens();
2554+
deviceKey = CognitoDeviceHelper.getDeviceKey(currSession.getUsername(),
2555+
this.pool.getUserPoolId(), this.context);
2556+
}
25492557
}
25502558
}
25512559
if (deviceKey != null) {

aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/mobileconnectors/cognitoidentityprovider/CognitoUserSession.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,24 @@ public boolean isValidForThreshold() {
117117
return false;
118118
}
119119
}
120+
121+
/**
122+
* Returns username contained in this session.
123+
* <p>
124+
* Reads the username from Access Tokens.
125+
* Returns null on Exceptions - This would mean that the contained tokens are not parsable
126+
* and hence are not valid.
127+
* </p>
128+
* @return Username of the user to whom these tokens belong.
129+
*/
130+
public String getUsername() {
131+
if (this.accessToken != null) {
132+
try {
133+
return this.accessToken.getUsername();
134+
} catch (Exception e) {
135+
return null;
136+
}
137+
}
138+
return null;
139+
}
120140
}

0 commit comments

Comments
 (0)