Skip to content

Commit dbb8d8e

Browse files
author
Aaron Lopez
authored
Merge pull request #604 from BranchMetrics/Staging
RC 2.19.3
2 parents 2bdb8c5 + 09fd4fc commit dbb8d8e

File tree

7 files changed

+22
-5
lines changed

7 files changed

+22
-5
lines changed
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
fabric-identifier=io.branch.sdk.android.library
2-
fabric-version=2.19.2
2+
fabric-version=2.19.3
33
fabric-build-type=source

Branch-SDK/src/io/branch/referral/network/BranchRemoteInterfaceUrlConnection.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ private BranchResponse doRestfulPost(String url, JSONObject payload, int retryNu
137137

138138
outputStreamWriter.write(payload.toString());
139139
outputStreamWriter.flush();
140+
outputStreamWriter.close();
140141

141142
int responseCode = connection.getResponseCode();
142143
if (responseCode >= HttpsURLConnection.HTTP_INTERNAL_ERROR
@@ -149,16 +150,26 @@ private BranchResponse doRestfulPost(String url, JSONObject payload, int retryNu
149150
retryNumber++;
150151
return doRestfulPost(url, payload, retryNumber);
151152
} else {
153+
InputStream inputStream = null;
152154
try {
153155
if (responseCode != HttpsURLConnection.HTTP_OK && connection.getErrorStream() != null) {
154-
return new BranchResponse(getResponseString(connection.getErrorStream()), responseCode);
156+
inputStream = connection.getErrorStream();
155157
} else {
156-
return new BranchResponse(getResponseString(connection.getInputStream()), responseCode);
158+
inputStream = connection.getInputStream();
157159
}
160+
return new BranchResponse(getResponseString(inputStream), responseCode);
158161
} catch (FileNotFoundException ex) {
159162
// In case of Resource conflict getInputStream will throw FileNotFoundException. Handle it here in order to send the right status code
160163
PrefHelper.Debug("BranchSDK", "A resource conflict occurred with this request " + url);
161164
return new BranchResponse(null, responseCode);
165+
} finally {
166+
try {
167+
if (inputStream != null) {
168+
inputStream.close();
169+
}
170+
} catch(IOException e) {
171+
e.printStackTrace();
172+
}
162173
}
163174
}
164175

Branch-SDK/src/io/branch/referral/util/BranchEvent.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ private BranchEvent(String eventName, boolean isStandardEvent) {
4545
this.eventName = eventName;
4646

4747
for (BRANCH_STANDARD_EVENT event : BRANCH_STANDARD_EVENT.values()) {
48-
if (eventName == event.getName()) {
48+
if (eventName.equals(event.getName())) {
4949
isStandardEvent = true;
50+
break;
5051
}
5152
}
5253

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
Branch Android SDK change log
22

3+
- v2.19.3
4+
* _*Master Release*_ - August 22, 2018
5+
* Changed post request logic to close streams. [#600](https://github.com/BranchMetrics/android-branch-deep-linking/issues/600)
6+
* Added check for if `BranchEvent` is same name as `BRANCH_STANDARD_EVENT` name, send with `v2/event/standard` request. DEVEX-751
7+
38
- v2.19.2
49
* _*Master Release*_ - August 10, 2018
510
* Added notify network API to process requests when network is available. DEVEX-711

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION_NAME=2.19.2
1+
VERSION_NAME=2.19.3
22
VERSION_CODE=1
33
GROUP=io.branch.sdk.android
44

0 commit comments

Comments
 (0)