Home
last modified time | relevance | path

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

12345

/packages/apps/UnifiedEmail/src/com/android/mail/providers/
DAccount.java41 import org.json.JSONArray;
42 import org.json.JSONException;
43 import org.json.JSONObject;
263 JSONObject json = new JSONObject(); in serialize() local
265 json.put(AccountColumns.NAME, displayName); in serialize()
266 json.put(AccountColumns.TYPE, type); in serialize()
267 json.put(AccountColumns.SENDER_NAME, senderName); in serialize()
268 json.put(AccountColumns.ACCOUNT_MANAGER_NAME, accountManagerName); in serialize()
269 json.put(AccountColumns.ACCOUNT_ID, accountId); in serialize()
270 json.put(AccountColumns.PROVIDER_VERSION, providerVersion); in serialize()
[all …]
DSettings.java37 import org.json.JSONException;
38 import org.json.JSONObject;
203 private Settings(JSONObject json) { in Settings() argument
204 signature = json.optString(SettingsColumns.SIGNATURE, sDefault.signature); in Settings()
205 mAutoAdvance = json.optInt(SettingsColumns.AUTO_ADVANCE, sDefault.getAutoAdvanceSetting()); in Settings()
206 snapHeaders = json.optInt(SettingsColumns.SNAP_HEADERS, sDefault.snapHeaders); in Settings()
207 replyBehavior = json.optInt(SettingsColumns.REPLY_BEHAVIOR, sDefault.replyBehavior); in Settings()
208 convListIcon = json.optInt(SettingsColumns.CONV_LIST_ICON, sDefault.convListIcon); in Settings()
209 confirmDelete = json.optBoolean(SettingsColumns.CONFIRM_DELETE, sDefault.confirmDelete); in Settings()
210 confirmArchive = json.optBoolean(SettingsColumns.CONFIRM_ARCHIVE, sDefault.confirmArchive); in Settings()
[all …]
DReplyFromAccount.java28 import org.json.JSONException;
29 import org.json.JSONObject;
65 JSONObject json = new JSONObject(); in serialize() local
67 json.put(BASE_ACCOUNT_URI, baseAccountUri); in serialize()
68 json.put(ADDRESS_STRING, address); in serialize()
69 json.put(NAME_STRING, name); in serialize()
70 json.put(REPLY_TO, replyTo); in serialize()
71 json.put(IS_DEFAULT, isDefault); in serialize()
72 json.put(IS_CUSTOM_FROM, isCustomFrom); in serialize()
76 return json; in serialize()
[all …]
DListParams.java25 import org.json.JSONException;
26 import org.json.JSONObject;
91 JSONObject json = new JSONObject(); in serialize() local
93 json.put(LIMIT_KEY, mLimit); in serialize()
94 json.put(USE_NETWORK_KEY, mUseNetwork); in serialize()
98 return json.toString(); in serialize()
112 JSONObject json = null; in newinstance() local
114 json = new JSONObject(serializedParams); in newinstance()
115 final int limit = json.getInt(LIMIT_KEY); in newinstance()
116 final boolean useNetwork = json.getBoolean(USE_NETWORK_KEY); in newinstance()
/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()
/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.java31 import org.json.JSONObject;
78 TmaMediaEvent fromJson(@Nullable JSONObject json) { in fromJson() argument
79 if (json == null) return null; in fromJson()
81 getEnum(json, Keys.STATE, mEventStates, EventState.NONE), in fromJson()
82 getEnum(json, Keys.ERROR_CODE, mErrorCodes, StateErrorCode.UNKNOWN_ERROR), in fromJson()
83 getString(json, Keys.ERROR_MESSAGE), in fromJson()
84 getString(json, Keys.ACTION_LABEL), in fromJson()
85 getEnum(json, Keys.INTENT, mResolutionIntents, ResolutionIntent.NONE), in fromJson()
86 getInt(json, Keys.POST_DELAY_MS)); in fromJson()
/packages/apps/Email/tests/src/com/android/emailcommon/provider/
DAccountTest.java22 import org.json.JSONException;
23 import org.json.JSONObject;
29 final JSONObject json = new JSONObject(); in testDeserializeFromJSON() local
30 json.put(EmailContent.AccountColumns.DISPLAY_NAME, "David Hasselhoff"); in testDeserializeFromJSON()
31 json.put(EmailContent.AccountColumns.EMAIL_ADDRESS, "dhoff@example.com"); in testDeserializeFromJSON()
32 json.put(EmailContent.AccountColumns.SYNC_LOOKBACK, 42); in testDeserializeFromJSON()
33 json.put(EmailContent.AccountColumns.SYNC_INTERVAL, 99); in testDeserializeFromJSON()
34 json.put(Account.JSON_TAG_HOST_AUTH_RECV, getHostAuthJSON("receiver", "recpass").toJson()); in testDeserializeFromJSON()
35 json.put(Account.JSON_TAG_HOST_AUTH_SEND, getHostAuthJSON("send", "sendpass").toJson()); in testDeserializeFromJSON()
36 json.put(EmailContent.AccountColumns.FLAGS, 22); in testDeserializeFromJSON()
[all …]
DHostAuthTests.java24 import org.json.JSONException;
25 import org.json.JSONObject;
224 final JSONObject json = new JSONObject(); in testDeserializeFromJSON() local
225 json.put(EmailContent.HostAuthColumns.PROTOCOL, "IMAP"); in testDeserializeFromJSON()
226 json.put(EmailContent.HostAuthColumns.ADDRESS, "dhoff@example.com"); in testDeserializeFromJSON()
227 json.put(EmailContent.HostAuthColumns.PORT, 1337); in testDeserializeFromJSON()
228 json.put(EmailContent.HostAuthColumns.FLAGS, 293847); in testDeserializeFromJSON()
229 json.put(EmailContent.HostAuthColumns.LOGIN, "dhoff"); in testDeserializeFromJSON()
230 json.put(EmailContent.HostAuthColumns.PASSWORD, "daknightrida"); in testDeserializeFromJSON()
231 json.put(EmailContent.HostAuthColumns.DOMAIN, "example.com"); in testDeserializeFromJSON()
[all …]
/packages/apps/Email/emailcommon/src/com/android/emailcommon/provider/
DAccount.java38 import org.json.JSONException;
39 import org.json.JSONObject;
757 final JSONObject json = toJson(); in toJsonString() local
758 if (json != null) { in toJsonString()
759 return json.toString(); in toJsonString()
766 final JSONObject json = new JSONObject(); in toJson() local
767 json.putOpt(AccountColumns.DISPLAY_NAME, mDisplayName); in toJson()
768 json.put(AccountColumns.EMAIL_ADDRESS, mEmailAddress); in toJson()
769 json.put(AccountColumns.SYNC_LOOKBACK, mSyncLookback); in toJson()
770 json.put(AccountColumns.SYNC_INTERVAL, mSyncInterval); in toJson()
[all …]
DHostAuth.java32 import org.json.JSONException;
33 import org.json.JSONObject;
258 final JSONObject json = new JSONObject(); in toJson() local
259 json.put(HostAuthColumns.PROTOCOL, mProtocol); in toJson()
260 json.put(HostAuthColumns.ADDRESS, mAddress); in toJson()
261 json.put(HostAuthColumns.PORT, mPort); in toJson()
262 json.put(HostAuthColumns.FLAGS, mFlags); in toJson()
263 json.put(HostAuthColumns.LOGIN, mLogin); in toJson()
264 json.putOpt(HostAuthColumns.PASSWORD, mPassword); in toJson()
265 json.putOpt(HostAuthColumns.DOMAIN, mDomain); in toJson()
[all …]
DCredential.java15 import org.json.JSONException;
16 import org.json.JSONObject;
174 final JSONObject json = new JSONObject(); in toJson() local
175 json.put(PROVIDER_COLUMN, mProviderId); in toJson()
176 json.putOpt(ACCESS_TOKEN_COLUMN, mAccessToken); in toJson()
177 json.putOpt(REFRESH_TOKEN_COLUMN, mRefreshToken); in toJson()
178 json.put(EXPIRATION_COLUMN, mExpiration); in toJson()
179 return json; in toJson()
186 protected static Credential fromJson(final JSONObject json) { in fromJson() argument
189 c.mProviderId = json.getString(PROVIDER_COLUMN); in fromJson()
[all …]
/packages/apps/UnifiedEmail/src/com/android/mail/preferences/
DSimpleBackupSharedPreference.java21 import org.json.JSONArray;
22 import org.json.JSONException;
23 import org.json.JSONObject;
58 final JSONObject json = new JSONObject(); in toJson() local
59 json.put(KEY, mKey); in toJson()
66 json.put(VALUE, array); in toJson()
68 json.put(VALUE, mValue); in toJson()
70 return json; in toJson()
73 public static BackupSharedPreference fromJson(final JSONObject json) throws JSONException { in fromJson() argument
74 Object value = json.get(VALUE); in fromJson()
[all …]
/packages/apps/UnifiedEmail/tests/src/com/android/mail/providers/
DAccountTests.java25 import org.json.JSONException;
26 import org.json.JSONObject;
63 final JSONObject json = new JSONObject(); in testDeserializeNullSenderNameUsingJSON() local
65 json.put(UIProvider.AccountColumns.NAME, "name"); in testDeserializeNullSenderNameUsingJSON()
66 json.put(UIProvider.AccountColumns.TYPE, "type"); in testDeserializeNullSenderNameUsingJSON()
67 json.put(UIProvider.AccountColumns.PROVIDER_VERSION, 1); in testDeserializeNullSenderNameUsingJSON()
68 json.put(UIProvider.AccountColumns.CAPABILITIES, 2); in testDeserializeNullSenderNameUsingJSON()
71 json.put(UIProvider.AccountColumns.SENDER_NAME, null); in testDeserializeNullSenderNameUsingJSON()
73 final Account account = Account.newInstance(json.toString()); in testDeserializeNullSenderNameUsingJSON()
/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()

12345