Skip to content

Commit

Permalink
Fix http requests starting with Android 9 (API level 28)
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Bogomolov committed Jun 12, 2021
1 parent aaf6eaa commit ab941dd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "tech.bogomolov.incomingsmsgateway"
minSdkVersion 19
targetSdkVersion 30
versionCode 6
versionName "2.0"
versionCode 7
versionName "2.0.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,17 @@ public void setup() {
}

@Test
public void testSuccess() throws Exception {
public void testHttpsSuccess() throws Exception {
WorkInfo workInfo = this.getWorkInfo("https://example.com", "test");
assertThat(workInfo.getState(), is(WorkInfo.State.SUCCEEDED));
}

@Test
public void testHttpSuccess() throws Exception {
WorkInfo workInfo = this.getWorkInfo("http://example.com", "test");
assertThat(workInfo.getState(), is(WorkInfo.State.SUCCEEDED));
}

@Test
public void testError() throws Exception {
WorkInfo workInfo = this.getWorkInfo("not a url", "test");
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">

<activity
android:name="tech.bogomolov.incomingsmsgateway.MainActivity"
Expand Down

0 comments on commit ab941dd

Please sign in to comment.