Home
last modified time | relevance | path

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

1234567

/packages/services/Car/tests/DiagnosticTools/src/com/google/android/car/diagnostictools/utils/
DSensorMetadata.java23 import org.json.JSONException;
24 import org.json.JSONObject;
121 static SensorMetadata buildFromJson(JSONObject json) { in buildFromJson() argument
122 String name = readStringFromJSON(NAME_KEY, json); in buildFromJson()
123 String units = readStringFromJSON(UNITS_KEY, json); in buildFromJson()
125 if (json.has(CONVERSION_KEY)) { in buildFromJson()
127 JSONObject conversionObject = json.getJSONObject(CONVERSION_KEY); in buildFromJson()
135 } else if (json.has(MAPPING_KEY)) { in buildFromJson()
137 Map<Integer, String> mapping = readMappingFromJSON(MAPPING_KEY, json); in buildFromJson()
143 String translationString = readStringFromJSON(TRANSLATION_KEY, json); in buildFromJson()
[all …]
/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 …]
/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.java39 import org.json.JSONArray;
40 import org.json.JSONException;
41 import org.json.JSONObject;
92 TmaMediaItem fromJson(@Nullable JSONObject json) { in fromJson() argument
93 if (json == null) return null; in fromJson()
96 JSONArray events = getArray(json, Keys.EVENTS); in fromJson()
107 JSONArray children = getArray(json, Keys.CHILDREN); in fromJson()
115 return new TmaMediaItem(TmaLoaderUtils.parseFlags(getString(json, Keys.FLAGS), mFlags), in fromJson()
116 getEnum(json, Keys.PLAYABLE_HINT, mContentStyles, ContentStyle.NONE), in fromJson()
117 getEnum(json, Keys.BROWSABLE_HINT, mContentStyles, ContentStyle.NONE), in fromJson()
[all …]
DTmaMediaEventReader.java32 import org.json.JSONObject;
84 TmaMediaEvent fromJson(@Nullable JSONObject json) { in fromJson() argument
85 if (json == null) return null; in fromJson()
87 getEnum(json, Keys.STATE, mEventStates, EventState.NONE), in fromJson()
88 getEnum(json, Keys.ERROR_CODE, mErrorCodes, StateErrorCode.UNKNOWN_ERROR), in fromJson()
89 getString(json, Keys.ERROR_MESSAGE), in fromJson()
90 getString(json, Keys.ACTION_LABEL), in fromJson()
91 getEnum(json, Keys.INTENT, mResolutionIntents, ResolutionIntent.NONE), in fromJson()
92 getEnum(json, Keys.ACTION, mActions, Action.NONE), in fromJson()
93 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/modules/NeuralNetworks/tools/systrace_parser/
Dparse_systrace.py24 def produce_stats(trace, print_detail=False, total_times=False, per_execution=False, json=False): argument
38 if json:
49 if json and printed_one:
52 print_stats(tracker_map, print_detail, total_times, per_execution, json,
63 if json and printed_one:
65 print_stats(tracker_map, print_detail, total_times, per_execution, json, starting_mark, sep)
66 if json:
78 produce_stats(trace, args.print_detail, args.total_times, args.per_execution, args.json)
/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/apps/Car/DebuggingRestrictionController/server/
DHOW_TO.md11 +- firebase.json # Describes properties of the project
16 + package.json # npm package file
20 +- api_config.SAMPLE.json # A sample configuration
22 +- .eslintrc.json # Rules for JavaScript linting
24 +- package.json # npm package file
29 # package.json) are installed
41 * Configure the token issuer in a config file. See `api_config.SAMPLE.json`
45 api_config="$(cat YOUR_CONFIG.json)"`.
/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/modules/Virtualization/microdroid/
DAndroid.bp71 "cgroups.json",
90 linker_config_src: "linker.config.json",
381 name: "microdroid_cdisk.json",
382 src: "microdroid_cdisk.json",
386 name: "microdroid_cdisk_env.json",
387 src: "microdroid_cdisk_env.json",
391 name: "microdroid_cdisk_userdata.json",
392 src: "microdroid_cdisk_userdata.json",
396 name: "microdroid_payload.json",
397 src: "microdroid_payload.json",
DREADME.md27 Create a config file, `microdroid.json`:
29 ```json
67 …ex/com.android.virt/bin/mk_cdisk /apex/com.android.virt/etc/microdroid_cdisk.json os_composite.img'
68 …m.android.virt/bin/mk_cdisk /apex/com.android.virt/etc/microdroid_cdisk_env.json env_composite.img'
69 …id.virt/bin/mk_cdisk /apex/com.android.virt/etc/microdroid_cdisk_userdata.json userdata_composite.…
71 …pex/com.android.virt/bin/mk_payload /apex/com.android.virt/etc/microdroid_payload.json payload.img'
73 $ adb push microdroid.json /data/local/tmp/microdroid/microdroid.json
85 …RACE=1 RUST_LOG=trace /apex/com.android.virt/bin/vm run /data/local/tmp/microdroid/microdroid.json"
/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/robolectric_tests/src/com/android/customization/model/clock/
DClockManagerTest.java32 import org.json.JSONException;
33 import org.json.JSONObject;
80 JSONObject json = in testApply() local
82 assertEquals(CLOCK_ID, json.getString(CLOCK_FIELD)); in testApply()
99 JSONObject json = new JSONObject().put(CLOCK_FIELD, CLOCK_ID); in testGetCurrentClock_returnsClockId() local
100 Secure.putString(mContentResolver, ClockManager.CLOCK_FACE_SETTING, json.toString()); in testGetCurrentClock_returnsClockId()
/packages/apps/ThemePicker/src/com/android/customization/model/theme/
DThemeBundle.java55 import org.json.JSONException;
56 import org.json.JSONObject;
193 JSONObject json = new JSONObject(mPackagesByCategory); in getJsonPackages() local
195 removeNullValues(json); in getJsonPackages()
198 json.put(TIMESTAMP_FIELD, System.currentTimeMillis()); in getJsonPackages()
203 return json; in getJsonPackages()
206 private void removeNullValues(JSONObject json) { in removeNullValues() argument
207 Iterator<String> keys = json.keys(); in removeNullValues()
211 if (json.isNull(key)) { in removeNullValues()
216 json.remove(key); in removeNullValues()
/packages/modules/Virtualization/apex/
DAndroid.bp11 manifest: "manifest.json",
56 "microdroid_cdisk.json",
57 "microdroid_cdisk_env.json",
58 "microdroid_cdisk_userdata.json",
59 "microdroid_payload.json",
/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 …]

1234567