Merge pull request #2285 from collinjackson/nested

Fix type of nested data structures on Android
This commit is contained in:
Collin Jackson 2016-01-22 17:40:51 -08:00
commit 2bb3d6d265

View File

@ -189,13 +189,9 @@ public class FirebaseImpl implements org.chromium.mojom.firebase.Firebase {
DataSnapshot toMojoSnapshot(com.firebase.client.DataSnapshot snapshot) {
DataSnapshot mojoSnapshot = new DataSnapshot();
mojoSnapshot.key = snapshot.getKey();
try {
JSONObject jsonObject = new JSONObject();
jsonObject.put("value", snapshot.getValue());
mojoSnapshot.jsonValue = jsonObject.toString();
} catch (JSONException e) {
Log.e(TAG, "toMojoSnapshot JSONException", e);
}
Map<String, Object> jsonValue = new HashMap<String, Object>();
jsonValue.put("value", snapshot.getValue());
mojoSnapshot.jsonValue = new JSONObject(jsonValue).toString();
return mojoSnapshot;
}