Skip to content

Commit cd7b81e

Browse files
committed
Address review comments.
1 parent db5b277 commit cd7b81e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

appcheck/firebase-appcheck-playintegrity/src/main/java/com/google/firebase/appcheck/playintegrity/internal/GeneratePlayIntegrityChallengeRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package com.google.firebase.appcheck.playintegrity.internal;
1616

1717
import androidx.annotation.NonNull;
18-
import org.json.JSONException;
1918
import org.json.JSONObject;
2019

2120
/**
@@ -27,9 +26,10 @@ public class GeneratePlayIntegrityChallengeRequest {
2726
public GeneratePlayIntegrityChallengeRequest() {}
2827

2928
@NonNull
30-
public String toJsonString() throws JSONException {
29+
public String toJsonString() {
3130
JSONObject jsonObject = new JSONObject();
3231

32+
// GeneratePlayIntegrityChallenge takes an empty POST body since the app ID is in the URL.
3333
return jsonObject.toString();
3434
}
3535
}

appcheck/firebase-appcheck-playintegrity/src/main/java/com/google/firebase/appcheck/playintegrity/internal/GeneratePlayIntegrityChallengeResponse.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package com.google.firebase.appcheck.playintegrity.internal;
1616

1717
import static com.google.android.gms.common.internal.Preconditions.checkNotNull;
18-
import static com.google.android.gms.common.util.Strings.emptyToNull;
1918

2019
import androidx.annotation.NonNull;
2120
import androidx.annotation.VisibleForTesting;
@@ -38,8 +37,8 @@ public class GeneratePlayIntegrityChallengeResponse {
3837
public static GeneratePlayIntegrityChallengeResponse fromJsonString(@NonNull String jsonString)
3938
throws JSONException {
4039
JSONObject jsonObject = new JSONObject(jsonString);
41-
String challenge = emptyToNull(jsonObject.optString(CHALLENGE_KEY));
42-
String timeToLive = emptyToNull(jsonObject.optString(TIME_TO_LIVE_KEY));
40+
String challenge = jsonObject.optString(CHALLENGE_KEY, null);
41+
String timeToLive = jsonObject.optString(TIME_TO_LIVE_KEY, null);
4342
return new GeneratePlayIntegrityChallengeResponse(challenge, timeToLive);
4443
}
4544

0 commit comments

Comments
 (0)