Home
last modified time | relevance | path

Searched refs:json (Results 1 – 25 of 98) sorted by relevance

1234

/packages/apps/Bluetooth/src/com/android/bluetooth/mapclient/obex/
DMessage.java19 import org.json.JSONException;
20 import org.json.JSONObject;
169 JSONObject json = new JSONObject(); in toString() local
172 json.put("handle", mHandle); in toString()
173 json.put("subject", mSubject); in toString()
174 json.put("datetime", mDateTime); in toString()
175 json.put("sender_name", mSenderName); in toString()
176 json.put("sender_addressing", mSenderAddressing); in toString()
177 json.put("replyto_addressing", mReplytoAddressing); in toString()
178 json.put("recipient_name", mRecipientName); in toString()
[all …]
DBmessage.java21 import org.json.JSONException;
22 import org.json.JSONObject;
148 JSONObject json = new JSONObject(); in toString() local
151 json.put("status", mBmsgStatus); in toString()
152 json.put("type", mBmsgType); in toString()
153 json.put("folder", mBmsgFolder); in toString()
154 json.put("charset", mBbodyCharset); in toString()
155 json.put("message", mMessage); in toString()
160 return json.toString(); in toString()
DEventReport.java21 import org.json.JSONException;
22 import org.json.JSONObject;
185 JSONObject json = new JSONObject(); in toString() local
188 json.put("type", mType); in toString()
189 json.put("handle", mHandle); in toString()
190 json.put("folder", mFolder); in toString()
191 json.put("old_folder", mOldFolder); in toString()
192 json.put("msg_type", mMsgType); in toString()
197 return json.toString(); in toString()
/packages/apps/Test/connectivity/sl4n/rapidjson/test/unittest/
Djsoncheckertest.cpp44 char* json = (char*)malloc(length + 1); in ReadFile() local
45 size_t readLength = fread(json, 1, length, fp); in ReadFile()
46 json[readLength] = '\0'; in ReadFile()
48 return json; in ReadFile()
63 char* json = ReadFile(filename, length); in TEST() local
64 if (!json) { in TEST()
71 document.Parse((const char*)json); in TEST()
74 document.Parse<kParseIterativeFlag>((const char*)json); in TEST()
77 free(json); in TEST()
84 char* json = ReadFile(filename, length); in TEST() local
[all …]
Dnamespacetest.cpp19 #define RAPIDJSON_NAMESPACE my::rapid::json
20 #define RAPIDJSON_NAMESPACE_BEGIN namespace my { namespace rapid { namespace json {
32 static const char json[] = "{\"hello\":\"world\",\"t\":true,\"f\":false,\"n\":null,\"i\":123,\"pi\"… variable
39 doc.Parse(json); in TEST()
50 StringStream s(json); in TEST()
57 EXPECT_STREQ(json, buffer.GetString()); in TEST()
58 EXPECT_EQ(sizeof(json)-1, buffer.GetSize()); in TEST()
68 EXPECT_STREQ(json, buffer.GetString()); in TEST()
Dwritertest.cpp37 #define TEST_ROUNDTRIP(json) \ argument
39 StringStream s(json); \
44 EXPECT_STREQ(json, buffer.GetString()); \
111 …const char json[] = "{\"hello\":\"world\",\"t\":true,\"f\":false,\"n\":null,\"i\":123,\"pi\":3.141… in TEST() local
115 StringStream s(json); in TEST()
120 EXPECT_STREQ(json, buffer.GetString()); in TEST()
125 StringStream s(json); in TEST()
137 EXPECT_STREQ(json, buffer2.GetString()); in TEST()
Dprettywritertest.cpp154 char* json = (char*)malloc(size + 1); in TEST() local
155 size_t readLength = fread(json, 1, size, fp); in TEST()
156 json[readLength] = '\0'; in TEST()
159 EXPECT_STREQ(kPrettyJson, json); in TEST()
160 free(json); in TEST()
Dreadertest.cpp714 char *json = StrDup("[ ] "); in TEST() local
715 InsituStringStream s(json); in TEST()
720 free(json); in TEST()
724 char *json = StrDup("[1, 2, 3, 4]"); in TEST() local
725 InsituStringStream s(json); in TEST()
730 free(json); in TEST()
798 …const char* json = "{ \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123,… in TEST() local
802 char* json2 = StrDup(json); in TEST()
813 StringStream s(json); in TEST()
1009 …const char* json = "{ \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123,… in TEST() local
[all …]
Ddocumenttest.cpp74 …const char* json = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123… in ParseTest() local
76 doc.Parse(json); in ParseTest()
80 StringStream s(json); in ParseTest()
85 char *buffer = strdup(json); in ParseTest()
293 GenericDocument< UTF16<> > json; in TEST() local
294json.Parse<kParseValidateEncodingFlag>(L"[{\"created_at\":\"Wed Oct 30 17:13:20 +0000 2012\"}]"); in TEST()
296 ASSERT_TRUE(json.IsArray()); in TEST()
297 GenericValue< UTF16<> >& v = json[0]; in TEST()
/packages/apps/Car/tests/TestMediaApp/src/com/android/car/media/testmediaapp/loader/
DTmaLoaderUtils.java24 import org.json.JSONArray;
25 import org.json.JSONException;
26 import org.json.JSONObject;
72 JSONObject json, K key, Map<String, E> enumMap, E fallback) { in getEnum() argument
73 E result = enumMap.get(getString(json, key)); in getEnum()
79 static <T extends Enum> JSONArray getArray(JSONObject json, T key) { in getArray() argument
81 return json.has(key.name()) ? json.getJSONArray(key.name()) : null; in getArray()
89 static <T extends Enum, U extends Enum> List<U> getEnumArray(JSONObject json, T key, in getEnumArray() argument
92 JSONArray array = json.has(key.name()) ? json.getJSONArray(key.name()) : null; in getEnumArray()
107 static <T extends Enum> String getString(JSONObject json, T key) { in getString() argument
[all …]
DTmaMediaItemReader.java38 import org.json.JSONArray;
39 import org.json.JSONException;
40 import org.json.JSONObject;
90 TmaMediaItem fromJson(@Nullable JSONObject json) { in fromJson() argument
91 if (json == null) return null; in fromJson()
94 JSONArray events = getArray(json, Keys.EVENTS); in fromJson()
105 JSONArray children = getArray(json, Keys.CHILDREN); in fromJson()
113 return new TmaMediaItem(TmaLoaderUtils.parseFlags(getString(json, Keys.FLAGS), mFlags), in fromJson()
114 getEnum(json, Keys.PLAYABLE_HINT, mContentStyles, ContentStyle.NONE), in fromJson()
115 getEnum(json, Keys.BROWSABLE_HINT, mContentStyles, ContentStyle.NONE), in fromJson()
[all …]
DTmaMediaEventReader.java34 import org.json.JSONObject;
85 TmaMediaEvent fromJson(@Nullable JSONObject json) { in fromJson() argument
86 if (json == null) return null; in fromJson()
88 getEnum(json, Keys.STATE, mEventStates, EventState.NONE), in fromJson()
89 getEnum(json, Keys.ERROR_CODE, mErrorCodes, StateErrorCode.UNKNOWN_ERROR), in fromJson()
90 getString(json, Keys.ERROR_MESSAGE), in fromJson()
91 getString(json, Keys.ACTION_LABEL), in fromJson()
92 getEnum(json, Keys.INTENT, mResolutionIntents, ResolutionIntent.NONE), in fromJson()
93 getEnum(json, Keys.ACTION, mActions, Action.NONE), in fromJson()
94 getInt(json, Keys.POST_DELAY_MS), in fromJson()
[all …]
/packages/apps/ThemePicker/src/com/android/customization/model/clock/
DClockManager.java24 import org.json.JSONException;
25 import org.json.JSONObject;
50 final JSONObject json = new JSONObject(); in handleApply() local
51 json.put(CLOCK_FIELD, option.getId()); in handleApply()
52 json.put(TIMESTAMP_FIELD, System.currentTimeMillis()); in handleApply()
53 stored = Secure.putString(mContentResolver, CLOCK_FACE_SETTING, json.toString()); in handleApply()
72 final JSONObject json = new JSONObject(value); in lookUpCurrentClock() local
73 return json.getString(CLOCK_FIELD); in lookUpCurrentClock()
/packages/services/Car/tools/emulator/
Dobd2_to_diagjson.py26 import json
32 return Json(json.load(file))
88 return json.dumps(self.store)
147 def fromJson(cls, json): argument
149 event.setTimestamp(json.timestamp)
150 event.setType(json.type)
151 for intValue in json.intValues:
153 for floatValue in json.floatValues:
155 event.setStringValue(json.stringValue)
178 class EventEncoder(json.JSONEncoder):
[all …]
/packages/services/Car/service/src/com/android/car/storagemonitoring/
DWearEstimateRecord.java26 import org.json.JSONException;
27 import org.json.JSONObject;
52 WearEstimateRecord(@NonNull JSONObject json) throws JSONException { in WearEstimateRecord() argument
53 mOldWearEstimate = new WearEstimate(json.getJSONObject("oldWearEstimate")); in WearEstimateRecord()
54 mNewWearEstimate = new WearEstimate(json.getJSONObject("newWearEstimate")); in WearEstimateRecord()
55 mTotalCarServiceUptime = json.getLong("totalCarServiceUptime"); in WearEstimateRecord()
56 mUnixTimestamp = Instant.ofEpochMilli(json.getLong("unixTimestamp")); in WearEstimateRecord()
/packages/apps/Test/connectivity/sl4n/rapidjson/example/tutorial/
Dtutorial.cpp15 …const char json[] = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":12… in main() local
16 printf("Original JSON:\n %s\n", json); in main()
22 if (document.Parse(json).HasParseError()) in main()
26 char buffer[sizeof(json)]; in main()
27 memcpy(buffer, json, sizeof(json)); in main()
/packages/apps/ThemePicker/src/com/android/customization/model/theme/
DThemeBundle.java57 import org.json.JSONException;
58 import org.json.JSONObject;
219 JSONObject json = new JSONObject(mPackagesByCategory); in getJsonPackages() local
221 removeNullValues(json); in getJsonPackages()
224 json.put(TIMESTAMP_FIELD, System.currentTimeMillis()); in getJsonPackages()
229 return json; in getJsonPackages()
232 private void removeNullValues(JSONObject json) { in removeNullValues() argument
233 Iterator<String> keys = json.keys(); in removeNullValues()
237 if (json.isNull(key)) { in removeNullValues()
242 json.remove(key); in removeNullValues()
/packages/apps/Launcher3/src/com/android/launcher3/
DInstallShortcutReceiver.java56 import org.json.JSONException;
57 import org.json.JSONObject;
58 import org.json.JSONStringer;
457 JSONStringer json = new JSONStringer() in encodeToString() local
467 json = json.key(ICON_KEY).value( in encodeToString()
473 json = json.key(ICON_RESOURCE_NAME_KEY).value(iconResource.resourceName); in encodeToString()
474 json = json.key(ICON_RESOURCE_PACKAGE_NAME_KEY) in encodeToString()
477 return json.endObject().toString(); in encodeToString()
/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/
DJsonBackedSuggestionExtras.java18 import org.json.JSONException;
19 import org.json.JSONObject;
36 public JsonBackedSuggestionExtras(String json) throws JSONException { in JsonBackedSuggestionExtras() argument
37 mExtras = new JSONObject(json); in JsonBackedSuggestionExtras()
/packages/apps/Test/connectivity/sl4n/rapidjson/doc/
Dstream.md21 const char json[] = "[1, 2, 3, 4]";
22 StringStream s(json);
32 const char json[] = "[1, 2, 3, 4]";
34 d.Parse(json);
80 FILE* fp = fopen("big.json", "rb"); // non-Windows use "r"
106 d.Parse(json);
109 FILE* fp = fopen("output.json", "wb"); // non-Windows use "w"
146 FILE* fp = fopen("utf16le.json", "rb"); // non-Windows use "r"
171 FILE* fp = fopen("output_utf32le.json", "wb"); // non-Windows use "w"
199 FILE* fp = fopen("any.json", "rb"); // non-Windows use "r"
[all …]
/packages/apps/Dialer/java/com/android/contacts/common/model/
DContactLoader.java66 import org.json.JSONArray;
67 import org.json.JSONException;
68 import org.json.JSONObject;
124 final JSONObject json = new JSONObject(jsonString); in loadEncodedContactEntity() local
129 final String displayName = json.optString(Contacts.DISPLAY_NAME); in loadEncodedContactEntity()
130 final String altDisplayName = json.optString(Contacts.DISPLAY_NAME_ALTERNATIVE, displayName); in loadEncodedContactEntity()
131 final int displayNameSource = json.getInt(Contacts.DISPLAY_NAME_SOURCE); in loadEncodedContactEntity()
132 final String photoUri = json.optString(Contacts.PHOTO_URI, null); in loadEncodedContactEntity()
154 final String accountName = json.optString(RawContacts.ACCOUNT_NAME, null); in loadEncodedContactEntity()
157 final String accountType = json.getString(RawContacts.ACCOUNT_TYPE); in loadEncodedContactEntity()
[all …]
/packages/apps/Contacts/src/com/android/contacts/model/
DContactLoader.java68 import org.json.JSONArray;
69 import org.json.JSONException;
70 import org.json.JSONObject;
359 final JSONObject json = new JSONObject(jsonString); in loadEncodedContactEntity() local
364 final String displayName = json.optString(Contacts.DISPLAY_NAME); in loadEncodedContactEntity()
365 final String altDisplayName = json.optString( in loadEncodedContactEntity()
367 final int displayNameSource = json.getInt(Contacts.DISPLAY_NAME_SOURCE); in loadEncodedContactEntity()
368 final String photoUri = json.optString(Contacts.PHOTO_URI, null); in loadEncodedContactEntity()
390 final String accountName = json.optString(RawContacts.ACCOUNT_NAME, null); in loadEncodedContactEntity()
393 final String accountType = json.getString(RawContacts.ACCOUNT_TYPE); in loadEncodedContactEntity()
[all …]
/packages/apps/Contacts/tests/src/com/android/contacts/model/
DContactLoaderTest.java42 import org.json.JSONException;
43 import org.json.JSONObject;
283 JSONObject json = new JSONObject(); in testLoadContactReturnDirectoryContactWithoutDisplayName() local
284 json.put(Contacts.NAME_RAW_CONTACT_ID, CONTACT_ID); in testLoadContactReturnDirectoryContactWithoutDisplayName()
285 json.put(Contacts.DISPLAY_NAME_SOURCE, DisplayNameSources.STRUCTURED_NAME); in testLoadContactReturnDirectoryContactWithoutDisplayName()
286 json.put(Contacts.CONTENT_ITEM_TYPE, itemJson); in testLoadContactReturnDirectoryContactWithoutDisplayName()
289 .encodedFragment(json.toString()) in testLoadContactReturnDirectoryContactWithoutDisplayName()
/packages/modules/vndk/apex/
DAndroid.bp17 manifest: "apex_manifest.current.json",
42 manifest: "apex_manifest.v29.json",
63 manifest: "apex_manifest.v28.json",
84 manifest: "apex_manifest.v27.json",
/packages/apps/Dialer/java/com/android/dialer/glidephotomanager/impl/
DDefaultLookupUriGenerator.java25 import org.json.JSONArray;
26 import org.json.JSONException;
27 import org.json.JSONObject;

1234