Home
last modified time | relevance | path

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

123

/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/experimental/procstatlog/
Dprocstatreport.py19 import json
201 "id_js": json.write("total_cpu"),
203 "filename_js": json.write(files_url + "/total_cpu.csv"),
204 "options_js": json.write({
243 "id_js": json.write("cpu_speed"),
245 "filename_js": json.write(files_url + "/cpu_speed.csv"),
246 "options_js": json.write({
275 "id_js": json.write("context_switches"),
277 "filename_js": json.write(files_url + "/context_switches.csv"),
278 "options_js": json.write({
[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/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/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()
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 …]
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/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/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/Launcher2/src/com/android/launcher2/
DInstallShortcutReceiver.java38 import org.json.*;
84 JSONStringer json = new JSONStringer() in addToInstallQueue() local
91 json = json.key(ICON_KEY).value( in addToInstallQueue()
96 json = json.key(ICON_RESOURCE_NAME_KEY).value(info.iconResource.resourceName); in addToInstallQueue()
97 json = json.key(ICON_RESOURCE_PACKAGE_NAME_KEY) in addToInstallQueue()
100 json = json.endObject(); in addToInstallQueue()
102 addToStringSet(sharedPrefs, editor, APPS_PENDING_INSTALL, json.toString()); in addToInstallQueue()
104 } catch (org.json.JSONException e) { in addToInstallQueue()
119 for (String json : strings) { in getAndClearInstallQueue()
121 JSONObject object = (JSONObject) new JSONTokener(json).nextValue(); in getAndClearInstallQueue()
[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/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/Launcher3/src/com/android/launcher3/
DInstallShortcutReceiver.java49 import org.json.JSONException;
50 import org.json.JSONObject;
51 import org.json.JSONStringer;
420 JSONStringer json = new JSONStringer() in encodeToString() local
426 json = json.key(ICON_KEY).value( in encodeToString()
431 json = json.key(ICON_RESOURCE_NAME_KEY).value(iconResource.resourceName); in encodeToString()
432 json = json.key(ICON_RESOURCE_PACKAGE_NAME_KEY) in encodeToString()
435 return json.endObject().toString(); in encodeToString()
/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.java61 import org.json.JSONArray;
62 import org.json.JSONException;
63 import org.json.JSONObject;
369 final JSONObject json = new JSONObject(jsonString); in loadEncodedContactEntity() local
374 final String displayName = json.optString(Contacts.DISPLAY_NAME); in loadEncodedContactEntity()
375 final String altDisplayName = json.optString( in loadEncodedContactEntity()
377 final int displayNameSource = json.getInt(Contacts.DISPLAY_NAME_SOURCE); in loadEncodedContactEntity()
378 final String photoUri = json.optString(Contacts.PHOTO_URI, null); in loadEncodedContactEntity()
400 final String accountName = json.optString(RawContacts.ACCOUNT_NAME, null); in loadEncodedContactEntity()
403 final String accountType = json.getString(RawContacts.ACCOUNT_TYPE); in loadEncodedContactEntity()
[all …]

123