Skip to content

Commit e6d592d

Browse files
desokroshanrohandubal
authored andcommitted
Update AWSIotMqttManager to respect the SDK's global time offset (#853)
* Update AWSIotMqttManager to respect the SDK's global time offset * Chagelog update
1 parent a46598d commit e6d592d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
* Amazon Comprehend
2626
* Amazon Kinesis Video
2727

28+
* **AWS IoT**
29+
* Fixed the timestamp used for signing requests to AWS IoT by accounting for the offset specified in `SDKGlobalConfiguration`. See [issue #814](https://github.com/aws-amplify/aws-sdk-android/issues/814)
30+
2831
## [Release 2.12.6](https://github.com/aws/aws-sdk-android/releases/tag/release_v2.12.6)
2932

3033
### Misc. Updates

aws-android-sdk-iot/src/main/java/com/amazonaws/mobileconnectors/iot/AWSIotMqttManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import android.os.Looper;
2222

2323
import com.amazonaws.AmazonClientException;
24+
import com.amazonaws.SDKGlobalConfiguration;
2425
import com.amazonaws.auth.AWSCredentialsProvider;
2526
import com.amazonaws.regions.Region;
2627
import com.amazonaws.util.StringUtils;
@@ -795,7 +796,7 @@ public void run() {
795796
try {
796797
final String mqttWebSocketURL = signer.getSignedUrl(endpointWithHttpPort,
797798
clientCredentialsProvider.getCredentials(),
798-
System.currentTimeMillis());
799+
System.currentTimeMillis() - SDKGlobalConfiguration.getGlobalTimeOffset() * MILLIS_IN_ONE_SECOND);
799800

800801
final MqttConnectOptions options = new MqttConnectOptions();
801802

0 commit comments

Comments
 (0)