Home
last modified time | relevance | path

Searched refs:fileName (Results 1 – 25 of 185) sorted by relevance

12345678

/packages/providers/ContactsProvider/src/com/android/providers/contacts/debug/
DDataExporter.java55 final String fileName = generateRandomName() + OUT_FILE_SUFFIX; in exportData() local
56 final File outFile = getOutputFile(context, fileName); in exportData()
70 return DumpFileProvider.AUTHORITY_URI.buildUpon().appendPath(fileName).build(); in exportData()
82 public static void ensureValidFileName(String fileName) { in ensureValidFileName() argument
85 if (fileName.contains("..")) { in ensureValidFileName()
87 fileName); in ensureValidFileName()
90 if (!fileName.matches(VALID_FILE_NAME_REGEX)) { in ensureValidFileName()
92 " files are supported. Bad file name: " + fileName); in ensureValidFileName()
107 public static File getOutputFile(Context context, String fileName) { in getOutputFile() argument
108 return new File(getOutputDirectory(context), fileName); in getOutputFile()
DDumpFileProvider.java80 final String fileName = extractFileName(uri); in openFile() local
81 DataExporter.ensureValidFileName(fileName); in openFile()
82 final File file = DataExporter.getOutputFile(getContext(), fileName); in openFile()
93 final String fileName = extractFileName(uri); in query() local
94 DataExporter.ensureValidFileName(fileName); in query()
109 b.add(fileName); in query()
111 final File file = DataExporter.getOutputFile(getContext(), fileName); in query()
/packages/modules/OnDevicePersonalization/federatedcompute/src/com/android/federatedcompute/services/common/
DFileUtils.java38 public static ParcelFileDescriptor createTempFileDescriptor(String fileName, int mode) { in createTempFileDescriptor() argument
41 fileDescriptor = ParcelFileDescriptor.open(new File(fileName), mode); in createTempFileDescriptor()
43 LogUtil.e(TAG, e, "Failed to createTempFileDescriptor %s", fileName); in createTempFileDescriptor()
51 String fileName; in createTempFile() local
54 fileName = tempFile.getAbsolutePath(); in createTempFile()
58 return fileName; in createTempFile()
62 public static void writeToFile(String fileName, byte[] data) throws IOException { in writeToFile() argument
63 FileOutputStream out = new FileOutputStream(fileName); in writeToFile()
/packages/apps/DocumentsUI/tests/functional/com/android/documentsui/
DInternalStorageUiTest.java34 private static final String fileName = "!Test3345678"; field in InternalStorageUiTest
64 bots.directory.selectDocument(fileName); in testRenameFile()
74 bots.directory.assertDocumentsAbsent(fileName); in testRenameFile()
81 mDocsHelper.createFolder(rootPrimary, fileName); in createTestFiles()
87 if (bots.directory.hasDocuments(fileName)) { in deleteTestFiles()
88 bots.directory.selectDocument(fileName); in deleteTestFiles()
/packages/services/Car/service/src/com/android/car/telemetry/util/
DIoUtils.java63 @NonNull File dir, @NonNull String fileName, @NonNull PersistableBundle bundle) in writeBundle() argument
65 writeBundle(new File(dir, fileName), bundle); in writeBundle()
98 @NonNull File dir, @NonNull String fileName, @NonNull MessageLite proto) in writeProto() argument
100 writeProto(new File(dir, fileName), proto); in writeProto()
128 public static boolean deleteSilently(@NonNull File directory, @NonNull String fileName) { in deleteSilently() argument
131 directory.getAbsolutePath(), fileName)); in deleteSilently()
133 Slogf.w(CarLog.TAG_TELEMETRY, "Failed to delete file " + fileName + " in directory " in deleteSilently()
/packages/modules/Bluetooth/android/app/src/com/android/bluetooth/opp/
DBluetoothOppSendFileInfo.java86 String fileName, String type, long length, FileInputStream inputStream, int status) { in BluetoothOppSendFileInfo() argument
87 mFileName = fileName; in BluetoothOppSendFileInfo()
109 String fileName = null; in generateFileInfo() local
165 fileName = metadataCursor.getString(indexName); in generateFileInfo()
170 Log.d(TAG, "fileName = " + fileName + " length = " + length); in generateFileInfo()
176 if (fileName == null) { in generateFileInfo()
178 fileName = uri.getLastPathSegment(); in generateFileInfo()
179 Log.d(TAG, "fileName from URI :" + fileName); in generateFileInfo()
204 fileName = uri.getLastPathSegment(); in generateFileInfo()
353 return new BluetoothOppSendFileInfo(fileName, contentType, length, is, 0); in generateFileInfo()
/packages/apps/Car/Settings/src/com/android/car/settings/system/
DLicenseHtmlGeneratorFromXml.java201 String fileName = readText(parser).trim(); in parse() local
202 if (!TextUtils.isEmpty(fileName)) { in parse()
203 fileNameToContentIdMap.put(fileName, contentId); in parse()
249 for (String fileName : fileNameList) { in generateHtml()
250 String contentId = fileNameToContentIdMap.get(fileName); in generateHtml()
261 contentIdAndFileNamesList.get(id).mFileNameList.add(fileName); in generateHtml()
262 writer.format("<li><a href=\"#id%d\">%s</a></li>\n", id, fileName); in generateHtml()
273 for (String fileName : contentIdAndFileNames.mFileNameList) { in generateHtml()
274 writer.format("%s <br/>\n", fileName); in generateHtml()
/packages/apps/DocumentsUI/tests/unit/com/android/documentsui/inspector/
DHeaderTextSelectorTest.java55 CharSequence fileName = "filename"; in testSimpleFileName() local
57 String testSequence = fileName + extension; in testSimpleFileName()
65 assertEquals(selectedSequence, fileName); in testSimpleFileName()
71 CharSequence fileName = "filename"; in testLotsOfPeriodsInFileName() local
73 String testSequence = fileName + extension; in testLotsOfPeriodsInFileName()
81 assertEquals(selectedSequence, fileName); in testLotsOfPeriodsInFileName()
/packages/apps/DocumentsUI/src/com/android/documentsui/dirlist/
DDocumentHolder.java204 String fileName, UserId userId) { in getPreviewIconContentDescription() argument
210 profileLabel, fileName) in getPreviewIconContentDescription()
211 : itemView.getResources().getString(R.string.preview_file, fileName); in getPreviewIconContentDescription()
214 return getUpdatablePreviewIconContentDescription(isNonPersonalProfile, fileName); in getPreviewIconContentDescription()
218 fileName); in getPreviewIconContentDescription()
224 boolean isWorkProfile, String fileName) { in getUpdatablePreviewIconContentDescription() argument
232 () -> itemView.getResources().getString(defaultStringId, fileName), in getUpdatablePreviewIconContentDescription()
233 /* formatArgs= */ fileName); in getUpdatablePreviewIconContentDescription()
/packages/modules/OnDevicePersonalization/src/com/android/ondevicepersonalization/services/util/
DIoUtils.java53 public static ParcelFileDescriptor createFileDescriptor(String fileName, int mode) { in createFileDescriptor() argument
56 fileDescriptor = ParcelFileDescriptor.open(new File(fileName), mode); in createFileDescriptor()
58 sLogger.e(TAG + ": Failed to createTempFileDescriptor %s", fileName); in createFileDescriptor()
65 public static String writeToFile(Context context, String fileName, byte[] data) { in writeToFile() argument
67 File file = new File(context.getDataDir(), fileName); in writeToFile()
/packages/modules/AdServices/adservices/tests/cts/src/android/adservices/utils/
DScenarioLoader.java136 String fileName = json.getString(FIELD_BODY); in parseResponse() local
137 String filePath = Scenarios.SCENARIOS_DATA_JARPATH + fileName; in parseResponse()
138 if (!fileName.equals(FIELD_VALUE_NULL)) { in parseResponse()
216 private static String loadTextResource(String fileName) throws IOException { in loadTextResource() argument
217 InputStream is = ApplicationProvider.getApplicationContext().getAssets().open(fileName); in loadTextResource()
237 String fileName, Map<String, String> variables) { in loadTextResourceWithSubstitutions() argument
240 responseBody = ScenarioLoader.loadTextResource(fileName); in loadTextResourceWithSubstitutions()
241 sLogger.v("loading file: " + fileName); in loadTextResourceWithSubstitutions()
243 throw new IllegalArgumentException("failed to load fake response body: " + fileName, e); in loadTextResourceWithSubstitutions()
/packages/modules/Bluetooth/android/app/tests/unit/src/com/android/bluetooth/opp/
DBluetoothOppSendFileInfoTest.java73 String fileName = "abc.txt"; in createInstance_withFileInputStream() local
79 new BluetoothOppSendFileInfo(fileName, type, length, inputStream, status); in createInstance_withFileInputStream()
82 assertThat(info.mFileName).isEqualTo(fileName); in createInstance_withFileInputStream()
143 String fileName = "coolName.txt"; in generateFileInfo_withUncorrectableMismatch_returnsSendFileInfoError() local
150 mCursor.addRow(new Object[] {fileName, fileLength}); in generateFileInfo_withUncorrectableMismatch_returnsSendFileInfoError()
176 String fileName = "coolName.txt"; in generateFileInfo_withCorrectableMismatch_returnInfoWithCorrectLength() local
183 mCursor.addRow(new Object[] {fileName, fileLength}); in generateFileInfo_withCorrectableMismatch_returnInfoWithCorrectLength()
200 assertThat(info.mFileName).isEqualTo(fileName); in generateFileInfo_withCorrectableMismatch_returnInfoWithCorrectLength()
/packages/apps/TV/tuner/src/com/android/tv/tuner/source/
DTsStreamWriter.java224 String fileName = file.getName(); in getFileId() local
225 int lastSeparator = fileName.lastIndexOf(SEPARATOR); in getFileId()
226 if (!fileName.endsWith(".ts") || lastSeparator == -1) { in getFileId()
230 return Integer.parseInt(fileName.substring(lastSeparator + 1, fileName.length() - 3)); in getFileId()
233 Log.e(TAG, fileName + " is not a valid file name."); in getFileId()
/packages/services/Car/tests/vehiclehal_test/src/com/android/car/vehiclehal/test/
DE2eCarTestBase.java125 protected List<CarPropertyValue> getExpectedEvents(String fileName) in getExpectedEvents() argument
127 try (InputStream in = mContext.getAssets().open(fileName)) { in getExpectedEvents()
128 Log.d(TAG, "Reading expected events from file: " + fileName); in getExpectedEvents()
133 protected String getTestFileContent(String fileName) throws IOException { in getTestFileContent() argument
134 try (InputStream in = mContext.getAssets().open(fileName)) { in getTestFileContent()
135 Log.d(TAG, "Reading test data from file: " + fileName); in getTestFileContent()
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/data/signals/
DEncoderPersistenceDaoTest.java98 String fileName = mEncoderPersistenceDao.generateFileNameForBuyer(BUYER_1); in testCreateFileInDirectory() local
99 File encoderFile = new File(encoderDir, fileName); in testCreateFileInDirectory()
103 encoderFile = mEncoderPersistenceDao.createFileInDirectory(encoderDir, fileName); in testCreateFileInDirectory()
156 String fileName = mEncoderPersistenceDao.generateFileNameForBuyer(BUYER_1); in testWipeAllEncoders() local
157 File encoderFile = new File(encoderDir, fileName); in testWipeAllEncoders()
161 encoderFile = mEncoderPersistenceDao.createFileInDirectory(encoderDir, fileName); in testWipeAllEncoders()
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/utils/
DDictionaryInfoUtils.java229 public static String getCategoryFromFileName(@Nonnull final String fileName) {
230 final String id = getWordListIdFromFileName(fileName);
272 final String fileName = replaceFileNameDangerousCharacters(id);
273 return getCacheDirectoryForLocale(locale, context) + File.separator + fileName;
286 final String fileName = replaceFileNameDangerousCharacters(
288 return stagingDirectory + File.separator + fileName;
295 final String fileName = stagingFile.getName();
296 final int index = fileName.indexOf(TEMP_DICT_FILE_SUB);
302 final String[] localeAndFileId = fileName.split(TEMP_DICT_FILE_SUB);
528 String fileName = dictionaryFile.getName();
[all …]
/packages/modules/IPsec/tests/iketests/src/java/com/android/internal/net/ipsec/ike/testutils/
DCertUtils.java43 public static X509Certificate createCertFromPemFile(String fileName) throws Exception { in createCertFromPemFile() argument
46 context.getResources().getAssets().open(PEM_FOLDER_NAME + "/" + fileName); in createCertFromPemFile()
53 public static RSAPrivateKey createRsaPrivateKeyFromKeyFile(String fileName) throws Exception { in createRsaPrivateKeyFromKeyFile() argument
56 context.getResources().getAssets().open(KEY_FOLDER_NAME + "/" + fileName); in createRsaPrivateKeyFromKeyFile()
/packages/apps/Launcher3/src/com/android/launcher3/logging/
DFileLog.java172 String fileName = FILE_NAME_PREFIX + (cal.get(Calendar.DAY_OF_YEAR) % LOG_DAYS); in handleMessage() local
174 if (!fileName.equals(mCurrentFileName)) { in handleMessage()
180 mCurrentFileName = fileName; in handleMessage()
183 File logFile = new File(sLogsDirectory, fileName); in handleMessage()
232 private static void dumpFile(PrintWriter out, String fileName) {
233 File logFile = new File(sLogsDirectory, fileName);
240 out.println("--- logfile: " + fileName + " ---");
/packages/apps/Launcher3/tests/multivalentTests/src/com/android/launcher3/util/rule/
DBackAndRestoreRule.kt43 val fileName = Paths.get(rawFileName).fileName.pathString in dbBackUp() constant
44 return fileName.startsWith("launcher") && fileName.endsWith(".db") in dbBackUp()
/packages/services/BuiltInPrintService/src/com/android/bips/jni/
DPdfRender.java101 private int openDocument(String fileName) { in openDocument() argument
102 if (DEBUG) Log.d(TAG, "openDocument() " + fileName); in openDocument()
107 if (mCurrentFile != null && !mCurrentFile.equals(fileName)) { in openDocument()
112 ParcelFileDescriptor pfd = ParcelFileDescriptor.open(new File(fileName), in openDocument()
116 Log.w(TAG, "Failed to open " + fileName, ex); in openDocument()
/packages/modules/Wifi/service/java/com/android/server/wifi/hotspot2/anqp/
DIconInfo.java50 public IconInfo(int width, int height, String language, String iconType, String fileName) { in IconInfo() argument
55 mFileName = fileName; in IconInfo()
77 String fileName = in parse() local
80 return new IconInfo(width, height, language, iconType, fileName); in parse()
/packages/apps/CarrierConfig/tests/src/com/android/carrierconfig/
DCarrierConfigTest.java240 for (String fileName : files) { in forEachConfigXml()
242 if (!fileName.startsWith("carrier_config_")) continue; in forEachConfigXml()
243 if (fileName.startsWith("carrier_config_mccmnc_")) { in forEachConfigXml()
244 mccmnc = fileName.substring("carrier_config_mccmnc_".length(), in forEachConfigXml()
245 fileName.indexOf(".xml")); in forEachConfigXml()
250 parser.setInput(assetMgr.open(fileName), "utf-8"); in forEachConfigXml()
255 throw new AssertionError("Problem in " + fileName + ": " + e.getMessage(), e); in forEachConfigXml()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/data/signals/
DEncoderPersistenceDao.java160 File createFileInDirectory(File directory, String fileName) { in createFileInDirectory() argument
162 File file = FileCompatUtils.newFileHelper(directory, fileName); in createFileInDirectory()
208 String readDataFromFile(File directory, String fileName) { in readDataFromFile() argument
211 File file = FileCompatUtils.newFileHelper(directory, fileName); in readDataFromFile()
216 sLogger.e(String.format("Exception trying to read file: %s", fileName)); in readDataFromFile()
/packages/inputmethods/LatinIME/native/jni/src/dictionary/utils/
Dfile_utils.cpp108 const char *const fileName) { in getFilePathBufSize() argument
109 return strlen(dirPath) + 1 /* '/' */ + strlen(fileName) + 1 /* terminator */; in getFilePathBufSize()
112 /* static */ void FileUtils::getFilePath(const char *const dirPath, const char *const fileName, in getFilePath() argument
114 snprintf(outFilePath, filePathBufSize, "%s/%s", dirPath, fileName); in getFilePath()
/packages/modules/Profiling/service/java/com/android/os/profiling/
DTracingSession.java123 public void setFileName(String fileName) { in setFileName() argument
124 mFileName = fileName; in setFileName()
127 public void setRedactedFileName(String fileName) { in setRedactedFileName() argument
128 mRedactedFileName = fileName; in setRedactedFileName()

12345678