Home
last modified time | relevance | path

Searched refs:file (Results 1 – 25 of 721) sorted by relevance

12345678910>>...29

/packages/apps/DocumentsUI/tests/common/com/android/documentsui/
DStubProvider.java131 final File file = new File(getContext().getCacheDir(), rootId); in clearCacheAndBuildRoots() local
132 if (file.mkdir()) { in clearCacheAndBuildRoots()
133 Log.i(TAG, "Created new root directory @ " + file.getPath()); in clearCacheAndBuildRoots()
135 final RootInfo rootInfo = new RootInfo(file, getSize(rootId)); in clearCacheAndBuildRoots()
178 final StubDocument file = mStorage.get(documentId); in queryDocument() local
179 if (file == null) { in queryDocument()
182 includeDocument(result, file); in queryDocument()
191 if (parentDocument.file == null || childDocument.file == null) { in isChildDocument()
196 parentDocument.file.getAbsolutePath(), childDocument.file.getAbsolutePath()); in isChildDocument()
213 File file = createFile(parent, mimeType, displayName); in createDocument() local
[all …]
/packages/services/Car/cpp/surround_view/service-impl/
DMtlReader.cpp33 void ReadFloat3(FILE* file, float* value) { in ReadFloat3() argument
35 int res = fscanf(file, "%f %f %f", &temp[0], &temp[1], &temp[2]); in ReadFloat3()
39 void ReadFloat(FILE* file, float* value) { in ReadFloat() argument
41 int res = fscanf(file, "%f", &temp); in ReadFloat()
45 void ReadInt(FILE* file, int* value) { in ReadInt() argument
47 int res = fscanf(file, "%d", &temp); in ReadInt()
51 void ReadString(FILE* file, std::string* value) { in ReadString() argument
53 fscanf(file, "%s", temp); in ReadString()
60 FILE* file = fopen(mtlFilename.c_str(), "r"); in ReadMtlFromFile() local
61 if (!file) { in ReadMtlFromFile()
[all …]
DObjReader.cpp78 FILE* file = fopen(objFilename.c_str(), "r"); in ReadObjFromFile() local
79 if (!file) { in ReadObjFromFile()
86 fclose(file); in ReadObjFromFile()
103 int res = fscanf(file, "%s", lineHeader); in ReadObjFromFile()
109 fgets(lineHeader, sizeof(lineHeader), file); in ReadObjFromFile()
117 res = fscanf(file, "%s", lineHeader); in ReadObjFromFile()
144 res = fscanf(file, "%s", lineHeader); in ReadObjFromFile()
175 res = fscanf(file, "%s", lineHeader); in ReadObjFromFile()
194 fscanf(file, "%f %f %f\n", &pos[option.coordinateMapping[0]], in ReadObjFromFile()
203 fscanf(file, "%f %f %f\n", &texture[0], &texture[1], &texture[2]); in ReadObjFromFile()
[all …]
/packages/services/Car/tools/emulator/
Dvhal_const_generate.py32 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 …]
DVehicleHalProto_pb2.py31 file=DESCRIPTOR,
90 file=DESCRIPTOR,
141 file=DESCRIPTOR,
194 file=DESCRIPTOR,
203 serialized_options=None, file=DESCRIPTOR),
210 serialized_options=None, file=DESCRIPTOR),
217 serialized_options=None, file=DESCRIPTOR),
224 serialized_options=None, file=DESCRIPTOR),
231 serialized_options=None, file=DESCRIPTOR),
238 serialized_options=None, file=DESCRIPTOR),
[all …]
/packages/services/Car/tests/BugReportApp/utils/
Dbugreport_app_tester.py405 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/services/Car/tools/
Dupdate-obd2-sensors.py218 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/android/car/bugreport/
DZipUtils.java36 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/
DMediaSaver.java63 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/MediaProvider/src/com/android/providers/media/scan/
DModernMediaScanner.java104 import java.nio.file.FileVisitResult;
105 import java.nio.file.FileVisitor;
106 import java.nio.file.Files;
107 import java.nio.file.Path;
108 import java.nio.file.attribute.BasicFileAttributes;
224 public void scanDirectory(File file, int reason) { in scanDirectory() argument
225 try (Scan scan = new Scan(file, reason, /*ownerPackage*/ null)) { in scanDirectory()
232 public Uri scanFile(File file, int reason) { in scanFile() argument
233 return scanFile(file, reason, /*ownerPackage*/ null); in scanFile()
237 public Uri scanFile(File file, int reason, @Nullable String ownerPackage) { in scanFile() argument
[all …]
/packages/providers/ContactsProvider/src/com/android/providers/contacts/
DPhotoStore.java91 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/
DDeviceListFragment.java54 file -> !file.isHidden() && (file.isDirectory()
55 || file.getName().toLowerCase().endsWith(UPDATE_FILE_SUFFIX));
156 for (File file : files) { in setFileList()
158 item.setTitle(file.getName()); in setFileList()
159 item.setOnItemClickedListener(i -> onFileSelected(file)); in setFileList()
169 private void onFileSelected(File file) { in onFileSelected() argument
170 if (isUpdateFile(file)) { in onFileSelected()
172 mSystemUpdater.applyUpdate(file); in onFileSelected()
173 } else if (file.isDirectory()) { in onFileSelected()
174 showFolderContent(file); in onFileSelected()
[all …]
/packages/apps/Gallery2/gallerycommon/src/com/android/gallery3d/common/
DFileCache.java79 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/providers/MediaProvider/tests/src/com/android/providers/media/
DMediaProviderForFuseTest.java86 final File file = new File(sTestDir, "test" + System.nanoTime() + ".jpg"); in testTypical() local
90 file.getPath(), sTestUid)).isEqualTo(0); in testTypical()
92 sTestDir.getPath(), sTestUid))).contains(file.getName()); in testTypical()
95 file.createNewFile(); in testTypical()
99 file.getPath(), sTestUid, true)).isEqualTo(0); in testTypical()
103 file.getPath(), sTestUid, 0)).isEqualTo(new long[0]); in testTypical()
108 file.getPath(), renamed.getPath(), sTestUid)).isEqualTo(0); in testTypical()
110 sTestDir.getPath(), sTestUid))).doesNotContain(file.getName()); in testTypical()
127 final File file = new File(sTestDir, "test" + System.nanoTime() + ".jpg"); in testRenameDirectory() local
129 file.getPath(), sTestUid)).isEqualTo(0); in testRenameDirectory()
[all …]
DIdleServiceTest.java65 final File file = MediaScannerTest.stage(R.raw.test_image, in testPruneThumbnails() local
67 final Uri uri = MediaStore.scanFile(resolver, file); in testPruneThumbnails()
111 public static File delete(File file) throws IOException { in delete() argument
112 executeShellCommand("rm -rf " + file.getAbsolutePath()); in delete()
113 assertFalse(exists(file)); in delete()
114 return file; in delete()
117 public static File touch(File file) throws IOException { in touch() argument
118 executeShellCommand("mkdir -p " + file.getParentFile().getAbsolutePath()); in touch()
119 executeShellCommand("touch " + file.getAbsolutePath()); in touch()
120 assertTrue(exists(file)); in touch()
[all …]
/packages/apps/Car/libs/car-ui-lib/tests/apitest/
Dresource_utils.py21 def __init__(self, file, line=None): argument
22 self.file = file
27 return self.file + ':' + str(self.line)
29 return self.file
73 for file in os.listdir(os.path.join(resDir, dir)):
74 if file.endswith('.xml'):
76 Resource(file[:-4], type,
77 ResourceLocation(os.path.join(resDir, dir, file))))
79 for resource in get_ids_from_layout_file(os.path.join(resDir, dir, file)):
83 for file in os.listdir(os.path.join(resDir, dir)):
[all …]
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/makedict/
DBinaryDictDecoderEncoderTests.java160 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 …]
DDictDecoder.java129 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/
DHelpers.java245 final File file = new File(Uri.parse(hint).getPath()); in generateSaveFile() local
246 parent = file.getParentFile().getAbsoluteFile(); in generateSaveFile()
248 name = file.getName(); in generateSaveFile()
299 final File file = new File(parent, name); in generateSaveFile()
300 file.createNewFile(); in generateSaveFile()
301 return file.getAbsolutePath(); in generateSaveFile()
506 File file) { in triggerMediaScan() argument
507 return MediaStore.scanFile(ContentResolver.wrap(mediaProviderClient), file); in triggerMediaScan()
520 static boolean isFilenameValid(Context context, File file) { in isFilenameValid() argument
521 return isFilenameValid(context, file, true); in isFilenameValid()
[all …]
/packages/inputmethods/LatinIME/native/jni/src/dictionary/utils/
Ddict_file_writing_utils.cpp90 /* 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/
DTsStreamWriter.java159 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/providers/MediaProvider/src/com/android/providers/media/util/
DFileUtils.java73 import java.nio.file.FileVisitResult;
74 import java.nio.file.FileVisitor;
75 import java.nio.file.Files;
76 import java.nio.file.NoSuchFileException;
77 import java.nio.file.Path;
78 import java.nio.file.attribute.BasicFileAttributes;
97 public static @NonNull ParcelFileDescriptor openSafely(@NonNull File file, int pfdFlags) in openSafely() argument
101 final FileDescriptor fd = Os.open(file.getAbsolutePath(), posixFlags, in openSafely()
168 final File file = files[i]; in deleteOlderFiles() local
171 final long age = System.currentTimeMillis() - file.lastModified(); in deleteOlderFiles()
[all …]
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/
DFileSystemWriteTest.java38 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/Gallery2/src/com/android/gallery3d/filtershow/tools/
DSaveImage.java214 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/Messaging/src/com/android/messaging/util/
DFileUtil.java80 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 …]

12345678910>>...29