Skip to content

Commit 0a964c5

Browse files
authored
Remove the check for INTERNET and ACCESS_NETWORK_STATE permissions (#1120)
1 parent da7b9d0 commit 0a964c5

File tree

3 files changed

+5
-44
lines changed

3 files changed

+5
-44
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
- `ENABLE_S3_SIGV4_SYSTEM_PROPERTY`
1010
- `ENFORCE_S3_SIGV4_SYSTEM_PROPERTY`
1111

12+
### Bug Fixes
13+
14+
- **Amazon Pinpoint**
15+
- Removed the check for INTERNET and ACCESS_NETWORK_STATE permissions while initializing `PinpointManager`. These are [normal permissions](https://developer.android.com/guide/topics/permissions/overview#normal_permissions) and therefore are not required to be checked before performing corresponding app-op. This changes Pinpoint SDK behavior to match that of our other SDKs where an `UnknownHostException` or a corresponding RuntimeException would be thrown if connectivity is not present when network calls are made by the SDK. This fixes [Issue#1092](https://github.com/aws-amplify/aws-sdk-android/issues/1092).
16+
1217
## [Release 2.14.2](https://github.com/aws/aws-sdk-android/releases/tag/release_v2.14.2)
1318

1419
### New Features

aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/PinpointManager.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import com.amazonaws.mobileconnectors.pinpoint.internal.core.util.Preconditions;
2626
import com.amazonaws.mobileconnectors.pinpoint.internal.core.util.SDKInfo;
2727
import com.amazonaws.mobileconnectors.pinpoint.internal.validate.EncodingValidator;
28-
import com.amazonaws.mobileconnectors.pinpoint.internal.validate.PermissionValidator;
2928
import com.amazonaws.mobileconnectors.pinpoint.targeting.TargetingClient;
3029
import com.amazonaws.mobileconnectors.pinpoint.targeting.notification.DeviceTokenRegisteredHandler;
3130
import com.amazonaws.mobileconnectors.pinpoint.targeting.notification.NotificationClient;
@@ -52,9 +51,6 @@ public class PinpointManager {
5251
private static final String SDK_NAME = "aws-sdk-android";
5352
private static final SDKInfo SDK_INFO = new SDKInfo(SDK_NAME, SDK_VERSION);
5453
private static final Log log = LogFactory.getLog(PinpointManager.class);
55-
private static final PermissionValidator INTERNET_PERMISSION_VALIDATOR = new PermissionValidator("android.permission.INTERNET");
56-
private static final PermissionValidator ACCESS_NETWORK_STATE_PERMISSION_VALIDATOR = new PermissionValidator(
57-
"android.permission.ACCESS_NETWORK_STATE");
5854
private static final EncodingValidator ENCODING_VALIDATOR = new EncodingValidator("UTF-8");
5955

6056
private final PinpointContext pinpointContext;
@@ -86,8 +82,6 @@ public PinpointManager(final PinpointConfiguration config) {
8682

8783
final AmazonPinpointClient targetingServiceClient = new AmazonPinpointClient(credentialsProvider, config.getClientConfiguration());
8884

89-
INTERNET_PERMISSION_VALIDATOR.validate(appContext);
90-
ACCESS_NETWORK_STATE_PERMISSION_VALIDATOR.validate(appContext);
9185
ENCODING_VALIDATOR.validate();
9286

9387
this.pinpointContext = new PinpointContext(analyticsServiceClient, targetingServiceClient, appContext, appId, SDK_INFO, config);

aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/validate/PermissionValidator.java

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)