Home
last modified time | relevance | path

Searched refs:jsonArray (Results 1 – 25 of 32) sorted by relevance

12

/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/shell/customaudience/
DCustomAudienceListCommandTest.java84 JSONArray jsonArray = new JSONObject(actualResult.mOut).getJSONArray("custom_audiences"); in testRun_simpleCase_returnsSuccess() local
85 assertWithMessage("Length of JsonArray (%s)", jsonArray) in testRun_simpleCase_returnsSuccess()
86 .that(jsonArray.length()) in testRun_simpleCase_returnsSuccess()
88 assertThat(getCustomAudienceFromJson(jsonArray.getJSONObject(0))) in testRun_simpleCase_returnsSuccess()
90 assertThat(getCustomAudienceBackgroundFetchDataFromJson(jsonArray.getJSONObject(0))) in testRun_simpleCase_returnsSuccess()
106 JSONArray jsonArray = new JSONObject(actualResult.mOut).getJSONArray("custom_audiences"); in testRun_missingBackgroundFetchData_returnsEmpty() local
107 assertWithMessage("Length of JsonArray (%s)", jsonArray) in testRun_missingBackgroundFetchData_returnsEmpty()
108 .that(jsonArray.length()) in testRun_missingBackgroundFetchData_returnsEmpty()
110 assertThat(getCustomAudienceFromJson(jsonArray.getJSONObject(0))) in testRun_missingBackgroundFetchData_returnsEmpty()
112 assertThat(getCustomAudienceBackgroundFetchDataFromJson(jsonArray.getJSONObject(0))) in testRun_missingBackgroundFetchData_returnsEmpty()
[all …]
/packages/modules/AdServices/adservices/tests/cts/src/android/adservices/debuggablects/
DCustomAudienceShellCommandHelper.java92 private static ImmutableList<String> getStringsFromJsonArray(JSONArray jsonArray) in getStringsFromJsonArray() argument
95 for (int i = 0; i < jsonArray.length(); i++) { in getStringsFromJsonArray()
96 builder.add(jsonArray.getString(i)); in getStringsFromJsonArray()
101 private static ImmutableList<AdData> getAdsFromJsonArray(JSONArray jsonArray) in getAdsFromJsonArray() argument
104 for (int i = 0; i < jsonArray.length(); i++) { in getAdsFromJsonArray()
105 builder.add(getAdFromJson(jsonArray.getJSONObject(i))); in getAdsFromJsonArray()
129 private static ImmutableSet<Integer> getIntegersFromJsonArray(JSONArray jsonArray) in getIntegersFromJsonArray() argument
132 for (int i = 0; i < jsonArray.length(); i++) { in getIntegersFromJsonArray()
133 builder.add(jsonArray.getInt(i)); in getIntegersFromJsonArray()
/packages/services/Telephony/src/com/android/phone/satellite/entitlement/
DSatelliteEntitlementResponse.java123 JSONArray jsonArray = jsonToken.getJSONArray(PLMN_ALLOWED_KEY); in parsingResponse() local
125 for (int i = 0; i < jsonArray.length(); i++) { in parsingResponse()
126 String dataPlanType = jsonArray.getJSONObject(i).has(DATA_PLAN_TYPE_KEY) in parsingResponse()
127 ? jsonArray.getJSONObject(i).getString(DATA_PLAN_TYPE_KEY) : ""; in parsingResponse()
128 String plmn = jsonArray.getJSONObject(i).getString(PLMN_KEY); in parsingResponse()
137 JSONArray jsonArray = jsonToken.getJSONArray(PLMN_BARRED_KEY); in parsingResponse() local
138 for (int i = 0; i < jsonArray.length(); i++) { in parsingResponse()
139 String plmn = jsonArray.getJSONObject(i).getString(PLMN_KEY); in parsingResponse()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/shell/customaudience/
DCustomAudienceHelper.java209 private static ImmutableList<DBAdData> getAdsFromJsonArray(JSONArray jsonArray) in getAdsFromJsonArray() argument
212 for (int i = 0; i < jsonArray.length(); i++) { in getAdsFromJsonArray()
213 builder.add(getAdFromJson(jsonArray.getJSONObject(i))); in getAdsFromJsonArray()
237 private static ImmutableList<String> getStringsFromJsonArray(JSONArray jsonArray) in getStringsFromJsonArray() argument
240 for (int i = 0; i < jsonArray.length(); i++) { in getStringsFromJsonArray()
241 builder.add(jsonArray.getString(i)); in getStringsFromJsonArray()
247 JSONArray jsonArray = new JSONArray(); in getJsonArrayFromIntegerSet() local
249 jsonArray.put(i); in getJsonArrayFromIntegerSet()
251 return jsonArray; in getJsonArrayFromIntegerSet()
254 private static ImmutableSet<Integer> getIntegersFromJsonArray(@NonNull JSONArray jsonArray) in getIntegersFromJsonArray() argument
[all …]
DCustomAudienceListCommand.java156 JSONArray jsonArray = new JSONArray(); in createOutputJson() local
169 jsonArray.put( in createOutputJson()
173 jsonObject.put("custom_audiences", jsonArray); in createOutputJson()
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/measurement/
DTriggerSpecsUtil.java25 JSONArray jsonArray = new JSONArray(json); in triggerSpecArrayFrom() local
26 TriggerSpec[] triggerSpecArray = new TriggerSpec[jsonArray.length()]; in triggerSpecArrayFrom()
27 for (int i = 0; i < jsonArray.length(); i++) { in triggerSpecArrayFrom()
28 triggerSpecArray[i] = new TriggerSpec.Builder(jsonArray.getJSONObject(i)).build(); in triggerSpecArrayFrom()
/packages/services/Car/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/
DVhalJsonReader.java114 private static void copyValuesArray(List valuesList, JSONArray jsonArray, Class clazz) in copyValuesArray() argument
116 if (jsonArray == null) { in copyValuesArray()
119 for (int i = 0; i < jsonArray.length(); i++) { in copyValuesArray()
121 valuesList.add(jsonArray.getInt(i)); in copyValuesArray()
123 valuesList.add(jsonArray.getLong(i)); in copyValuesArray()
125 valuesList.add((float) jsonArray.getDouble(i)); in copyValuesArray()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/measurement/
DFilterMap.java217 JSONArray jsonArray = jsonObject.getJSONArray(key); in buildFilterData() local
219 for (int i = 0; i < jsonArray.length(); i++) { in buildFilterData()
220 filterMapList.add(jsonArray.getString(i)); in buildFilterData()
244 JSONArray jsonArray = jsonObject.getJSONArray(key); in buildFilterDataV2() local
246 for (int i = 0; i < jsonArray.length(); i++) { in buildFilterDataV2()
247 filterMapList.add(jsonArray.getString(i)); in buildFilterDataV2()
DTriggerSpec.java150 public static List<Long> getLongListFromJSON(JSONArray jsonArray) throws JSONException { in getLongListFromJSON() argument
152 for (int i = 0; i < jsonArray.length(); i++) { in getLongListFromJSON()
153 result.add(jsonArray.getLong(i)); in getLongListFromJSON()
169 public static List<UnsignedLong> getTriggerDataArrayFromJSON(JSONArray jsonArray) in getTriggerDataArrayFromJSON() argument
172 for (int i = 0; i < jsonArray.length(); i++) { in getTriggerDataArrayFromJSON()
173 result.add(new UnsignedLong(jsonArray.getString(i))); in getTriggerDataArrayFromJSON()
DTrigger.java483 JSONArray jsonArray = new JSONArray(this.mEventTriggers); in parseEventTriggers() local
486 for (int i = 0; i < jsonArray.length(); i++) { in parseEventTriggers()
487 JSONObject eventTrigger = jsonArray.getJSONObject(i); in parseEventTriggers()
588 JSONArray jsonArray = new JSONArray(mAttributionScopesString); in getAttributionScopes() local
590 for (int i = 0; i < jsonArray.length(); ++i) { in getAttributionScopes()
591 attributionScopes.add(jsonArray.getString(i)); in getAttributionScopes()
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/common/
DJsonUtilsTest.java44 JSONArray jsonArray = new JSONArray().put(VALID_VALUE); in testGetStringFromJsonArraySuccess() local
47 JsonUtils.getStringFromJsonArrayAtIndex(jsonArray, 0, CUSTOM_ERROR), VALID_VALUE); in testGetStringFromJsonArraySuccess()
76 JSONArray jsonArray = new JSONArray().put(1); in testGetStringFromJsonArrayThrowsJSONExceptionWhenValueIsNotString() local
82 JsonUtils.getStringFromJsonArrayAtIndex(jsonArray, 0, CUSTOM_ERROR); in testGetStringFromJsonArrayThrowsJSONExceptionWhenValueIsNotString()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/customaudience/
DScheduledUpdatesHandler.java280 JSONArray jsonArray = new JSONArray(); in fetchUpdate() local
284 jsonArray.put(i, validBlobs.get(i).asJSONObject()); in fetchUpdate()
290 sLogger.v("Request payload: %s", jsonArray.toString()); in fetchUpdate()
306 .setBodyInBytes(jsonArray.toString().getBytes(UTF_8)) in fetchUpdate()
483 JSONArray jsonArray = updateResponseJson.getJSONArray(LEAVE_CUSTOM_AUDIENCE_KEY);
485 for (int i = 0; i < jsonArray.length(); i++) {
486 customAudienceList.add(jsonArray.getString(i));
499 JSONArray jsonArray = updateResponseJson.getJSONArray(JOIN_CUSTOM_AUDIENCE_KEY);
501 for (int i = 0; i < jsonArray.length(); i++) {
502 customAudienceJsonList.add(jsonArray.getJSONObject(i));
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/common/
DJsonUtils.java53 @NonNull JSONArray jsonArray, int index, @NonNull String errorMsg) in getStringFromJsonArrayAtIndex()
55 Objects.requireNonNull(jsonArray); in getStringFromJsonArrayAtIndex()
58 return assertObjectIsString(jsonArray.get(index), errorMsg); in getStringFromJsonArrayAtIndex()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/measurement/aggregation/
DAggregateCryptoConverter.java140 final JSONArray jsonArray = jsonObject.getJSONArray("data"); in convert() local
141 if (null == jsonArray || jsonArray.length() == 0) { in convert()
146 for (int i = 0; i < jsonArray.length(); i++) { in convert()
147 JSONObject dataObject = jsonArray.getJSONObject(i); in convert()
DAggregateReport.java290 JSONArray jsonArray = new JSONArray(); in generateDebugPayload() local
292 jsonArray.put(contribution.toJSONObject()); in generateDebugPayload()
296 debugPayload.put(DATA, jsonArray); in generateDebugPayload()
/packages/modules/Virtualization/tests/hostside/helper/java/com/android/microdroid/test/host/
DMicrodroidHostTestCaseBase.java234 JSONArray jsonArray = new JSONArray(field); in parseStringArrayFieldsFromVmInfo() local
235 for (int i = 0; i < jsonArray.length(); i++) { in parseStringArrayFieldsFromVmInfo()
236 ret.add(jsonArray.getString(i)); in parseStringArrayFieldsFromVmInfo()
253 JSONArray jsonArray = new JSONArray(field); in getAssignableDevices() local
254 for (int i = 0; i < jsonArray.length(); i++) { in getAssignableDevices()
255 JSONObject jsonObject = jsonArray.getJSONObject(i); in getAssignableDevices()
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/measurement/actions/
DRegisterListSources.java87 private List<Uri> createRegistrationUris(JSONArray jsonArray) throws JSONException { in createRegistrationUris() argument
89 for (int i = 0; i < jsonArray.length(); i++) { in createRegistrationUris()
90 registrationUris.add(Uri.parse(jsonArray.getString(i))); in createRegistrationUris()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/data/customaudience/
DDBTrustedBiddingData.java192 JSONArray jsonArray = new JSONArray(stringList); in deserializeStringList() local
194 for (int i = 0; i < jsonArray.length(); i++) { in deserializeStringList()
195 result.add(jsonArray.getString(i)); in deserializeStringList()
DDBCustomAudience.java641 JSONArray jsonArray = new JSONArray(); in toJson() local
643 jsonArray.put(mAdDataConversionStrategy.toJson(adData)); in toJson()
645 return jsonArray.toString(); in toJson()
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/customaudience/
DScheduleCustomAudienceUpdateTestUtils.java144 JSONArray jsonArray = new JSONArray(requestBodyString); in extractPartialCustomAudiencesFromRequest() local
146 for (int i = 0; i < jsonArray.length(); i++) { in extractPartialCustomAudiencesFromRequest()
148 blob.overrideFromJSONObject(jsonArray.getJSONObject(i)); in extractPartialCustomAudiencesFromRequest()
/packages/modules/AdServices/adservices/tests/unittest/fixtures/java/com/android/adservices/service/measurement/
DSourceFixture.java412 JSONArray jsonArray = new JSONArray(json); in triggerSpecArrayFrom() local
413 TriggerSpec[] triggerSpecArray = new TriggerSpec[jsonArray.length()]; in triggerSpecArrayFrom()
414 for (int i = 0; i < jsonArray.length(); i++) { in triggerSpecArrayFrom()
415 triggerSpecArray[i] = new TriggerSpec.Builder(jsonArray.getJSONObject(i)).build(); in triggerSpecArrayFrom()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/download/
DEncryptionDataDownloadManager.java179 JSONArray jsonArray = new JSONArray(jsonString); in processDownloadedFile() local
182 for (int index = 0; index < jsonArray.length(); index++) { in processDownloadedFile()
183 JSONObject jsonKeyObject = jsonArray.getJSONObject(index); in processDownloadedFile()
/packages/apps/WallpaperPicker2/src/com/android/wallpaper/module/
DDefaultWallpaperPreferences.kt658 val jsonArray = JSONArray(jsonString) in <lambda>() constant
659 jsonArray.put(timestamp) in <lambda>()
662 .putString(NoBackupKeys.KEY_DAILY_ROTATION_TIMESTAMPS, jsonArray.toString()) in <lambda>()
672 val jsonArray = JSONArray(jsonString) in <lambda>() constant
673 if (jsonArray.length() == 0) { in <lambda>()
675 } else jsonArray.getLong(jsonArray.length() - 1) in <lambda>()
/packages/apps/UniversalMediaPlayer/java/com/android/pump/provider/
DWikidata.java231 JSONArray jsonArray = (JSONArray) object; in dumpJson() local
232 for (int i = 0; i < jsonArray.length(); ++i) { in dumpJson()
233 dumpJson(null, indent + " ", jsonArray.get(i)); in dumpJson()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/measurement/registration/
DFetcherUtil.java172 JSONArray jsonArray = json.getJSONArray(key); in extractStringArray() local
173 if (jsonArray.length() > maxArraySize) { in extractStringArray()
179 for (int i = 0; i < jsonArray.length(); ++i) { in extractStringArray()
180 Optional<String> string = FetcherUtil.extractString(jsonArray.get(i), maxStringLength); in extractStringArray()

12