use of com.google.android.apps.muzei.api.UserCommand in project muzei by romannurik.
the class SourceState method toJson.
public synchronized JSONObject toJson() throws JSONException {
JSONObject jsonObject = new JSONObject();
if (mCurrentArtwork != null) {
jsonObject.put("currentArtwork", mCurrentArtwork.toJson());
}
jsonObject.put("description", mDescription);
jsonObject.put("wantsNetworkAvailable", mWantsNetworkAvailable);
JSONArray commandsSerialized = new JSONArray();
for (UserCommand command : mUserCommands) {
commandsSerialized.put(command.serialize());
}
jsonObject.put("userCommands", commandsSerialized);
return jsonObject;
}
Aggregations