/packages/apps/DocumentsUI/tests/common/com/android/documentsui/ |
D | StubProvider.java | 127 final File file = new File(getContext().getCacheDir(), rootId); in clearCacheAndBuildRoots() local 128 if (file.mkdir()) { in clearCacheAndBuildRoots() 129 Log.i(TAG, "Created new root directory @ " + file.getPath()); in clearCacheAndBuildRoots() 131 final RootInfo rootInfo = new RootInfo(file, getSize(rootId)); in clearCacheAndBuildRoots() 174 final StubDocument file = mStorage.get(documentId); in queryDocument() local 175 if (file == null) { in queryDocument() 178 includeDocument(result, file); in queryDocument() 186 return FileUtils.contains(parentDocument.file, childDocument.file); in isChildDocument() 193 File file = createFile(parent, mimeType, displayName); in createDocument() local 195 final StubDocument document = StubDocument.createRegularDocument(file, mimeType, parent); in createDocument() [all …]
|
/packages/services/Car/tools/emulator/ |
D | vhal_const_generate.py | 32 print("# Copyright (C) %s The Android Open Source Project" % year, file=dest) 33 print("#", file=dest) 34 print("# Licensed under the Apache License, Version 2.0 (the \"License\");", file=dest) 35 print("# you may not use this file except in compliance with the License.", file=dest) 36 print("# You may obtain a copy of the License at", file=dest) 37 print("#", file=dest) 38 print("# http://www.apache.org/licenses/LICENSE-2.0", file=dest) 39 print("#", file=dest) 40 print("# Unless required by applicable law or agreed to in writing, software", file=dest) 41 print("# distributed under the License is distributed on an \"AS IS\" BASIS,", file=dest) [all …]
|
/packages/services/Car/tests/BugReportApp/utils/ |
D | bugreport_app_tester.py | 405 def _is_image(self, file): argument 407 ext = file.name.split('.')[-1] 410 def _validate_image(self, file): argument 411 if file.compress_size == 0: 412 return _red('[Invalid] Image %s is empty.' % file.name) 413 return file.name + ' (%d kb)' % (file.compress_size / 1024) 415 def _is_audio(self, file): argument 417 return file.name.endswith('.3gp') 419 def _validate_audio(self, file): argument 421 if file.compress_size == 0: [all …]
|
/packages/providers/MediaProvider/src/com/android/providers/media/scan/ |
D | ModernMediaScanner.java | 87 import java.nio.file.FileVisitResult; 88 import java.nio.file.FileVisitor; 89 import java.nio.file.Files; 90 import java.nio.file.Path; 91 import java.nio.file.attribute.BasicFileAttributes; 162 public void scanDirectory(File file) { in scanDirectory() argument 163 try (Scan scan = new Scan(file)) { in scanDirectory() 170 public Uri scanFile(File file) { in scanFile() argument 171 try (Scan scan = new Scan(file)) { in scanFile() 363 public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) in visitFile() argument [all …]
|
D | PlaylistResolver.java | 45 import java.nio.file.Path; 65 final File file; in resolvePlaylist() local 73 file = new File(cursor.getString(1)); in resolvePlaylist() 81 return resolvePlaylistM3u(resolver, uri, file); in resolvePlaylist() 83 return resolvePlaylistPls(resolver, uri, file); in resolvePlaylist() 86 return resolvePlaylistWpl(resolver, uri, file); in resolvePlaylist() 93 @NonNull ContentResolver resolver, @NonNull Uri uri, @NonNull File file) in resolvePlaylistM3u() argument 95 final Path parentPath = file.getParentFile().toPath(); in resolvePlaylistM3u() 99 new InputStreamReader(new FileInputStream(file)))) { in resolvePlaylistM3u() 116 @NonNull ContentResolver resolver, @NonNull Uri uri, @NonNull File file) in resolvePlaylistPls() argument [all …]
|
/packages/services/Car/tools/ |
D | update-obd2-sensors.py | 218 print(policy.sensors(intSensors), file=destfile) 222 print(policy.sensors(floatSensors), file=destfile) 243 print("}", file=intfile) 244 print("}", file=floatfile) 251 print("#!/usr/bin/env python3", file=destfile) 252 print("#", file=destfile) 253 print("# Copyright (C) 2017 The Android Open Source Project", file=destfile) 254 print("#", file=destfile) 255 print("# Licensed under the Apache License, Version 2.0 (the \"License\");", file=destfile) 256 print("# you may not use this file except in compliance with the License.", file=destfile) [all …]
|
/packages/services/Car/tests/BugReportApp/src/com/google/android/car/bugreport/ |
D | ZipUtils.java | 36 static void extractZippedFileToZipStream(File file, ZipOutputStream zipStream) { in extractZippedFileToZipStream() argument 37 if (!file.exists()) { in extractZippedFileToZipStream() 38 Log.w(TAG, "File " + file + " not found"); in extractZippedFileToZipStream() 41 if (file.length() == 0) { in extractZippedFileToZipStream() 45 Log.w(TAG, "Zip file " + file.getName() + " is empty, skipping."); in extractZippedFileToZipStream() 48 try (ZipFile zipFile = new ZipFile(file)) { in extractZippedFileToZipStream() 57 Log.w(TAG, "Failed to add " + file + " to zip", e); in extractZippedFileToZipStream() 62 static void addFileToZipStream(File file, ZipOutputStream zipStream) { in addFileToZipStream() argument 63 if (!file.exists()) { in addFileToZipStream() 64 Log.w(TAG, "File " + file + " not found"); in addFileToZipStream() [all …]
|
/packages/apps/DevCamera/src/com/android/devcamera/ |
D | MediaSaver.java | 63 File file; in saveDepth() local 66 file = new File(filename); in saveDepth() 67 if (!file.createNewFile()) { in saveDepth() 72 FileOutputStream fos = new FileOutputStream(file); in saveDepth() 90 bytesWritten, file, (t1 - t0) * 0.001)); in saveDepth() 104 File file; in saveJpeg() local 108 file = new File(filename); in saveJpeg() 109 if (file.createNewFile()) { in saveJpeg() 115 OutputStream os = new FileOutputStream(file); in saveJpeg() 124 insertImage(resolver, file); in saveJpeg() [all …]
|
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ |
D | PhotoStore.java | 91 for (File file : files) { in clear() 92 cleanupFile(file); in clear() 124 for (File file : files) { in initialize() 126 Entry entry = new Entry(file); in initialize() 130 cleanupFile(file); in initialize() 195 File file = null; in insert() local 199 file = File.createTempFile("img", null, mStorePath); in insert() 200 FileOutputStream fos = new FileOutputStream(file); in insert() 213 if (file.renameTo(target)) { in insert() 224 if (file != null) { in insert() [all …]
|
/packages/apps/Car/SystemUpdater/src/com/android/car/systemupdater/ |
D | DeviceListFragment.java | 56 file -> !file.isHidden() && (file.isDirectory() 57 || file.getName().toLowerCase().endsWith(UPDATE_FILE_SUFFIX)); 178 private void onFileSelected(File file) { in onFileSelected() argument 179 if (isUpdateFile(file)) { in onFileSelected() 181 mSystemUpdater.applyUpdate(file); in onFileSelected() 182 } else if (file.isDirectory()) { in onFileSelected() 183 showFolderContent(file); in onFileSelected() 184 mFileStack.push(file); in onFileSelected() 221 protected File[] doInBackground(File... file) { in showFolderContent() argument 222 return file[0].listFiles(UPDATE_FILE_FILTER); in showFolderContent() [all …]
|
/packages/apps/Gallery2/gallerycommon/src/com/android/gallery3d/common/ |
D | FileCache.java | 79 for (File file : rootDir.listFiles()) { in deleteFiles() 80 String name = file.getName(); in deleteFiles() 81 if (file.isFile() && name.startsWith(FILE_PREFIX) in deleteFiles() 82 && name.endsWith(FILE_POSTFIX)) file.delete(); in deleteFiles() 100 public void store(String downloadUrl, File file) { in store() argument 103 Utils.assertTrue(file.getParentFile().equals(mRootDir)); in store() 107 entry.filename = file.getName(); in store() 108 entry.size = file.length(); in store() 111 file.delete(); in store() 117 file.delete(); in store() [all …]
|
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/makedict/ |
D | BinaryDictDecoderEncoderTests.java | 160 private static long timeWritingDictToFile(final File file, final FusionDictionary dict, in timeWritingDictToFile() argument 166 final DictEncoder dictEncoder = BinaryDictUtils.getDictEncoder(file, formatOptions); in timeWritingDictToFile() 213 private static long timeReadingAndCheckDict(final File file, final List<String> words, in timeReadingAndCheckDict() argument 219 final DictDecoder dictDecoder = BinaryDictIOUtils.getDictDecoder(file, 0, file.length(), in timeReadingAndCheckDict() 242 final File file = BinaryDictUtils.getDictFile(dictName, dictVersion, formatOptions, in runReadAndWrite() local 251 final long write = timeWritingDictToFile(file, dict, formatOptions); in runReadAndWrite() 252 final long read = timeReadingAndCheckDict(file, words, bigrams, bufferType); in runReadAndWrite() 284 final File file = BinaryDictUtils.getDictFile(dictName, dictVersion, in testCharacterTableIsPresent() local 288 final DictEncoder dictEncoder = new Ver2DictEncoder(file, in testCharacterTableIsPresent() 299 final DictDecoder dictDecoder = BinaryDictIOUtils.getDictDecoder(file, 0, file.length(), in testCharacterTableIsPresent() [all …]
|
D | DictDecoder.java | 129 public DictBuffer getDictionaryBuffer(final File file) in getDictionaryBuffer() argument 143 public DictBuffer getDictionaryBuffer(final File file) in getDictionaryBuffer() argument 148 inStream = new FileInputStream(file); in getDictionaryBuffer() 150 0, file.length()); in getDictionaryBuffer() 172 public DictBuffer getDictionaryBuffer(final File file) in getDictionaryBuffer() argument 176 inStream = new FileInputStream(file); in getDictionaryBuffer() 177 final byte[] array = new byte[(int) file.length()]; in getDictionaryBuffer() 199 public DictBuffer getDictionaryBuffer(final File file) in getDictionaryBuffer() argument 204 raFile = new RandomAccessFile(file, "rw"); in getDictionaryBuffer() 205 buffer = raFile.getChannel().map(FileChannel.MapMode.READ_WRITE, 0, file.length()); in getDictionaryBuffer()
|
/packages/providers/DownloadProvider/src/com/android/providers/downloads/ |
D | Helpers.java | 243 final File file = new File(Uri.parse(hint).getPath()); in generateSaveFile() local 244 parent = file.getParentFile().getAbsoluteFile(); in generateSaveFile() 246 name = file.getName(); in generateSaveFile() 297 final File file = new File(parent, name); in generateSaveFile() 298 file.createNewFile(); in generateSaveFile() 299 return file.getAbsolutePath(); in generateSaveFile() 505 File file) { in triggerMediaScan() argument 508 in.putParcelable(Intent.EXTRA_STREAM, Uri.fromFile(file)); in triggerMediaScan() 521 static boolean isFilenameValid(Context context, File file) { in isFilenameValid() argument 522 return isFilenameValid(context, file, true); in isFilenameValid() [all …]
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/utils/ |
D | dict_file_writing_utils.cpp | 90 /* static */ bool DictFileWritingUtils::writeBufferToFileTail(FILE *const file, in writeBufferToFileTail() argument 96 if (fwrite(bufferSize, SIZE_OF_BUFFER_SIZE_FIELD, 1 /* count */, file) < 1) { in writeBufferToFileTail() 99 return writeBufferToFile(file, buffer); in writeBufferToFileTail() 110 FILE *const file = fdopen(fd, "wb"); in flushBufferToFile() local 111 if (!file) { in flushBufferToFile() 116 if (!writeBufferToFile(file, buffer)) { in flushBufferToFile() 117 fclose(file); in flushBufferToFile() 124 fclose(file); in flushBufferToFile() 129 /* static */ bool DictFileWritingUtils::writeBufferToFile(FILE *const file, in writeBufferToFile() argument 133 originalBufSize, 1, file) < 1) { in writeBufferToFile() [all …]
|
/packages/apps/TV/tuner/src/com/android/tv/tuner/source/ |
D | TsStreamWriter.java | 159 for (File file : mDirectory.listFiles()) { in deleteOutdatedFiles() 160 if (file.isFile() in deleteOutdatedFiles() 161 && getFileId(file) == mInstanceId in deleteOutdatedFiles() 162 && (deleteAll || !mFileName.equals(file.getName()))) { in deleteOutdatedFiles() 163 boolean deleted = file.delete(); in deleteOutdatedFiles() 165 Log.w(TAG, "Failed to delete " + file.getName()); in deleteOutdatedFiles() 205 for (File file : mDirectory.listFiles()) { in getExistingIds() 206 int id = getFileId(file); in getExistingIds() 220 private static int getFileId(File file) { in getFileId() argument 221 if (file == null || !file.isFile()) { in getFileId() [all …]
|
/packages/apps/Car/libs/car-ui-lib/tests/apitest/ |
D | resource_utils.py | 20 def __init__(self, file, line=None): argument 21 self.file = file 26 return self.file + ':' + str(self.line) 28 return self.file 72 for file in os.listdir(os.path.join(resDir, dir)): 73 if file.endswith('.xml'): 75 Resource(file[:-4], type, 76 ResourceLocation(os.path.join(resDir, dir, file)))) 79 for file in os.listdir(os.path.join(resDir, dir)): 80 if file.endswith('.xml'): [all …]
|
/packages/apps/Gallery2/src/com/android/gallery3d/filtershow/tools/ |
D | SaveImage.java | 214 for (File file : auxFiles) { in deleteAuxFiles() 215 file.delete(); in deleteAuxFiles() 237 public boolean putPanoramaXMPData(File file, Object xmp) { in putPanoramaXMPData() argument 239 return XmpUtilHelper.writeXMPMeta(file.getAbsolutePath(), xmp); in putPanoramaXMPData() 266 public boolean putExifData(File file, ExifInterface exif, Bitmap image, in putExifData() argument 271 s = exif.getExifWriterStream(file.getAbsolutePath()); in putExifData() 279 Log.w(LOGTAG, "File not found: " + file.getAbsolutePath(), e); in putExifData() 531 File file = new File(saveDirectory, filename + ".JPG"); in makeAndInsertUri() local 532 return linkNewFileToUri(context, sourceUri, file, time, false); in makeAndInsertUri() 583 File file = getLocalFileFromUri(context, sourceUri); in getSaveDirectory() local [all …]
|
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/ |
D | FileSystemWriteTest.java | 38 File file = new File("/data/misc/bluetooth/test.file"); in testBluetoothDirWrite() local 39 Assert.assertTrue("File not created", file.createNewFile()); in testBluetoothDirWrite() 40 file.delete(); in testBluetoothDirWrite() 49 File file = new File("/data/misc/bluedroid/test.file"); in testBluedroidDirWrite() local 50 Assert.assertTrue("File not created", file.createNewFile()); in testBluedroidDirWrite() 51 file.delete(); in testBluedroidDirWrite() 60 File file = new File("/data/misc/bluetooth/logs/test.file"); in testBluetoothLogsDirWrite() local 61 Assert.assertTrue("File not created", file.createNewFile()); in testBluetoothLogsDirWrite() 62 file.delete(); in testBluetoothLogsDirWrite()
|
/packages/apps/Messaging/src/com/android/messaging/util/ |
D | FileUtil.java | 80 for (File file : root.listFiles()) { in removeFileOrDirectoryExcept() 81 if (exclude == null || !file.equals(exclude)) { in removeFileOrDirectoryExcept() 82 removeFileOrDirectoryExcept(file, exclude); in removeFileOrDirectoryExcept() 102 for (File file : sourceDir.listFiles()) { in moveAllContentUnderDirectory() 103 if (file.isDirectory()) { in moveAllContentUnderDirectory() 104 final File dirTarget = new File(targetDir, file.getName()); in moveAllContentUnderDirectory() 106 moveAllContentUnderDirectory(file, dirTarget); in moveAllContentUnderDirectory() 109 final File fileTarget = new File(targetDir, file.getName()); in moveAllContentUnderDirectory() 110 Files.move(file, fileTarget); in moveAllContentUnderDirectory() 131 final File file = new File(uri.getPath()); in isInPrivateDir() local [all …]
|
/packages/providers/MediaProvider/tests/src/com/android/providers/media/ |
D | IsoInterfaceTest.java | 43 final File file = stageFile(R.raw.test_video); in testRepeated() local 44 final IsoInterface mp4 = IsoInterface.fromFile(file); in testRepeated() 56 final File file = stageFile(R.raw.test_video_gps); in testGps() local 57 final IsoInterface mp4 = IsoInterface.fromFile(file); in testGps() 67 final File file = stageFile(R.raw.test_video_xmp); in testXmp() local 68 final IsoInterface mp4 = IsoInterface.fromFile(file); in testXmp() 79 final File file = File.createTempFile("test", ".mp4"); in stageFile() local 81 OutputStream out = new FileOutputStream(file)) { in stageFile() 84 return file; in stageFile()
|
/packages/apps/StorageManager/src/com/android/storagemanager/deletionhelper/ |
D | DownloadsDeletionType.java | 132 for (File file : data.files) { in onLoadFinished() 133 mFiles.add(file); in onLoadFinished() 166 public void setFileChecked(File file, boolean checked) { in setFileChecked() argument 168 mUncheckedFiles.remove(file.getPath()); in setFileChecked() 170 mUncheckedFiles.add(file.getPath()); in setFileChecked() 177 for (File file : mFiles) { in getFreeableBytes() 178 if (isChecked(file) || countUnchecked) { in getFreeableBytes() 179 freedBytes += file.length(); in getFreeableBytes() 198 public boolean isChecked(File file) { in isChecked() argument 199 return !mUncheckedFiles.contains(file.getPath()); in isChecked()
|
/packages/services/Telephony/src/com/android/phone/ |
D | CallTime.java | 199 File file = PhoneGlobals.getInstance().getDir ("phoneTrace", Context.MODE_PRIVATE); in startTrace() local 200 if (file.exists() == false) { in startTrace() 201 file.mkdirs(); in startTrace() 203 String baseName = file.getPath() + File.separator + "callstate"; in startTrace() 207 file = new File(dataFile); in startTrace() 208 if (file.exists() == true) { in startTrace() 209 file.delete(); in startTrace() 212 file = new File(keyFile); in startTrace() 213 if (file.exists() == true) { in startTrace() 214 file.delete(); in startTrace()
|
/packages/providers/MediaProvider/tests/src/com/android/providers/media/scan/ |
D | ModernMediaScannerTest.java | 108 final File file = File.createTempFile("test", ".jpg"); in testParseDateTaken_Complete() local 109 final ExifInterface exif = new ExifInterface(file); in testParseDateTaken_Complete() 127 final File file = File.createTempFile("test", ".jpg"); in testParseDateTaken_Gps() local 128 final ExifInterface exif = new ExifInterface(file); in testParseDateTaken_Gps() 166 final File file = File.createTempFile("test", ".jpg"); in testParseDateTaken_File() local 167 final ExifInterface exif = new ExifInterface(file); in testParseDateTaken_File() 195 final File file = File.createTempFile("test", ".jpg"); in testParseDateTaken_Hopeless() local 196 final ExifInterface exif = new ExifInterface(file); in testParseDateTaken_Hopeless() 203 private static void assertDirectoryHidden(File file) { in assertDirectoryHidden() argument 204 assertTrue(file.getAbsolutePath(), isDirectoryHidden(file)); in assertDirectoryHidden() [all …]
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/structure/v4/ |
D | ver4_dict_buffers.cpp | 119 FILE *const file = fdopen(fd, "wb"); in flushHeaderAndDictBuffers() local 120 if (!file) { in flushHeaderAndDictBuffers() 126 if (!flushDictBuffers(file)) { in flushHeaderAndDictBuffers() 127 fclose(file); in flushHeaderAndDictBuffers() 130 fclose(file); in flushHeaderAndDictBuffers() 146 bool Ver4DictBuffers::flushDictBuffers(FILE *const file) const { in flushDictBuffers() 148 if (!DictFileWritingUtils::writeBufferToFileTail(file, &mExpandableTrieBuffer)) { in flushDictBuffers() 153 if (!mTerminalPositionLookupTable.flushToFile(file)) { in flushDictBuffers() 158 if (!mLanguageModelDictContent.save(file)) { in flushDictBuffers() 163 if (!mShortcutDictContent.flushToFile(file)) { in flushDictBuffers()
|