Home
last modified time | relevance | path

Searched refs:File (Results 1 – 25 of 435) sorted by relevance

12345678910>>...18

/packages/providers/MediaProvider/tests/src/com/android/providers/media/scan/
DModernMediaScannerTest.java58 import java.io.File;
67 private File mDir;
76 mDir = new File(Environment.getExternalStorageDirectory(), "test_" + System.nanoTime()); in setUp()
108 final File file = File.createTempFile("test", ".jpg"); in testParseDateTaken_Complete()
127 final File file = File.createTempFile("test", ".jpg"); in testParseDateTaken_Gps()
166 final File file = File.createTempFile("test", ".jpg"); in testParseDateTaken_File()
195 final File file = File.createTempFile("test", ".jpg"); in testParseDateTaken_Hopeless()
203 private static void assertDirectoryHidden(File file) { in assertDirectoryHidden()
207 private static void assertDirectoryNotHidden(File file) { in assertDirectoryNotHidden()
219 assertDirectoryNotHidden(new File(prefix)); in testIsDirectoryHidden()
[all …]
DMediaScannerTest.java48 import java.io.File;
63 private final File mDir;
69 mDir = new File(base.getFilesDir(), tag); in IsolatedContext()
90 public File getDatabasePath(String name) { in getDatabasePath()
91 return new File(mDir, name); in getDatabasePath()
118 final File dir = Environment.getExternalStorageDirectory(); in testCorrectness()
119 stage(R.raw.test_audio, new File(dir, "test.mp3")); in testCorrectness()
120 stage(R.raw.test_video, new File(dir, "test.mp4")); in testCorrectness()
121 stage(R.raw.test_image, new File(dir, "test.jpg")); in testCorrectness()
181 final File scanDir = Environment.getExternalStorageDirectory(); in testSpeed()
[all …]
/packages/apps/StorageManager/robotests/src/com/android/storagemanager/automatic/
DDownloadsDeletionTypeTest.java39 import java.io.File;
46 private File mDownloadsDirectory;
57 File temp = new File(mDownloadsDirectory, "temp"); in testInitializeWithUncheckedFiles()
58 File temp2 = new File(mDownloadsDirectory, "temp2"); in testInitializeWithUncheckedFiles()
70 File temp = new File(mDownloadsDirectory, "temp"); in testFetchDownloads()
71 File temp2 = new File(mDownloadsDirectory, "temp2"); in testFetchDownloads()
77 Set<File> fileSet = mDeletion.getFiles(); in testFetchDownloads()
85 File temp = new File(mDownloadsDirectory, "temp"); in testSetChecked()
103 File temp = new File(mDownloadsDirectory, "temp"); in testUncheckedFilesDoNotCountForSize()
124 File temp = new File(mDownloadsDirectory, "temp"); in testSaveAndRestoreRemembersUncheckedFiles()
[all …]
/packages/apps/Messaging/src/com/android/messaging/util/
DFileUtil.java29 import java.io.File;
37 private static synchronized File getNewFile(File directory, String extension, in getNewFile()
44 File testFile = new File(directory, newName); in getNewFile()
63 public static File getNewFile(File directory, String contentType) throws IOException { in getNewFile()
72 public static void removeFileOrDirectory(File root) { in removeFileOrDirectory()
77 public static void removeFileOrDirectoryExcept(File root, File exclude) { in removeFileOrDirectoryExcept()
80 for (File file : root.listFiles()) { in removeFileOrDirectoryExcept()
95 public static void moveAllContentUnderDirectory(File sourceDir, File targetDir) { in moveAllContentUnderDirectory()
102 for (File file : sourceDir.listFiles()) { in moveAllContentUnderDirectory()
104 final File dirTarget = new File(targetDir, file.getName()); in moveAllContentUnderDirectory()
[all …]
/packages/apps/Gallery2/src/com/android/gallery3d/filtershow/tools/
DSaveImage.java46 import java.io.File;
83 private final File mDestinationFile;
133 File destination, Bitmap previewImage, Callback callback) { in SaveImage()
147 public static File getFinalSaveDirectory(Context context, Uri sourceUri) { in getFinalSaveDirectory()
148 File saveDirectory = SaveImage.getSaveDirectory(context, sourceUri); in getFinalSaveDirectory()
150 saveDirectory = new File(Environment.getExternalStorageDirectory(), in getFinalSaveDirectory()
159 public static File getNewFile(Context context, Uri sourceUri) { in getNewFile()
160 File saveDirectory = getFinalSaveDirectory(context, sourceUri); in getNewFile()
164 return new File(saveDirectory, PREFIX_PANO + filename + POSTFIX_JPG); in getNewFile()
166 return new File(saveDirectory, PREFIX_IMG + filename + POSTFIX_JPG); in getNewFile()
[all …]
/packages/apps/Camera2/src/com/android/camera/session/
DSessionStorageManagerImpl.java24 import java.io.File;
38 private final File mBaseDirectory;
44 private final File mDeprecatedBaseDirectory;
58 SessionStorageManagerImpl(File baseDirectory, File deprecatedBaseDirectory) { in SessionStorageManagerImpl()
64 public File getSessionDirectory(String subDirectory) throws IOException { in getSessionDirectory()
65 File sessionDirectory = new File(mBaseDirectory, subDirectory); in getSessionDirectory()
78 File deprecatedSessionDirectory = new File(mDeprecatedBaseDirectory, subDirectory); in getSessionDirectory()
85 public File createTemporaryOutputPath(String subDirectory, String title) throws IOException { in createTemporaryOutputPath()
86 File tempDirectory = null; in createTemporaryOutputPath()
88 tempDirectory = new File( in createTemporaryOutputPath()
[all …]
/packages/services/Telephony/sip/src/com/android/services/telephony/sip/
DSipProfileDb.java26 import java.io.File;
71 File profileFile = new File(mProfilesDirectory, p.getProfileName()); in deleteProfile()
72 if (!isChild(new File(mProfilesDirectory), profileFile)) { in deleteProfile()
80 private void deleteProfile(File file) { in deleteProfile()
82 for (File child : file.listFiles()) deleteProfile(child); in deleteProfile()
89 File dbDir = new File(mProfilesDirectory); in cleanupUponMigration()
100 File f = new File(mProfilesDirectory, p.getProfileName()); in saveProfile()
101 if (!isChild(new File(mProfilesDirectory), f)) { in saveProfile()
105 AtomicFile atomicFile = new AtomicFile(new File(f, PROFILE_OBJ_FILE)); in saveProfile()
133 File root = new File(mProfilesDirectory); in retrieveSipProfileListInternal()
[all …]
/packages/apps/DocumentsUI/src/com/android/documentsui/clipping/
DClipStorage.java30 import java.io.File;
70 private final File mOutDir;
73 private final File[] mSlots = new File[NUM_OF_SLOTS];
79 public ClipStorage(File outDir, SharedPreferences pref) { in ClipStorage()
132 File slotData = toSlotDataFile(pos); in checkStaleFiles()
151 File file = toSlotDataFile(slot); in createWriter()
156 public synchronized File getFile(int slot) throws IOException { in getFile()
159 File primary = toSlotDataFile(slot); in getFile()
162 File link = new File(mSlots[slot], linkFileName); in getFile()
175 public ClipStorageReader createReader(File file) throws IOException { in createReader()
[all …]
/packages/apps/Car/Settings/src/com/android/car/settings/system/
DLicenseHtmlLoader.java24 import java.io.File;
31 public class LicenseHtmlLoader extends AsyncLoader<File> {
55 public File loadInBackground() { in loadInBackground()
59 private File generateHtmlFromDefaultXmlFiles() { in generateHtmlFromDefaultXmlFiles()
60 final List<File> xmlFiles = getVaildXmlFiles(); in generateHtmlFromDefaultXmlFiles()
66 File cachedHtmlFile = getCachedHtmlFile(); in generateHtmlFromDefaultXmlFiles()
75 private List<File> getVaildXmlFiles() { in getVaildXmlFiles()
76 final List<File> xmlFiles = new ArrayList(); in getVaildXmlFiles()
78 File file = new File(xmlPath); in getVaildXmlFiles()
86 private File getCachedHtmlFile() { in getCachedHtmlFile()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/avrcpcontroller/
DAvrcpCoverArtStorage.java26 import java.io.File;
56 File file = new File(path); in doesImageExist()
67 public File getImageFile(BluetoothDevice device, String imageHandle) { in getImageFile()
71 File file = new File(path); in getImageFile()
101 File deviceDirectory = new File(deviceDirectoryPath); in addImage()
134 File file = new File(path); in removeImage()
153 File deviceDirectory = new File(deviceDirectoryPath); in removeImagesForDevice()
166 File storageDirectory = new File(storageDirectoryPath); in clear()
192 private void deleteStorageDirectory(File directory) { in deleteStorageDirectory()
198 File[] files = directory.listFiles(); in deleteStorageDirectory()
[all …]
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/utils/
DDictionaryInfoUtils.java40 import java.io.File;
160 return context.getFilesDir() + File.separator + "dicts"; in getWordListCacheDirectory()
167 return context.getFilesDir() + File.separator + "staging"; in getWordListStagingDirectory()
174 return context.getFilesDir() + File.separator + "tmp"; in getWordListTempDirectory()
202 public static File[] getCachedDirectoryList(final Context context) { in getCachedDirectoryList()
203 return new File(DictionaryInfoUtils.getWordListCacheDirectory(context)).listFiles(); in getCachedDirectoryList()
206 public static File[] getStagingDirectoryList(final Context context) { in getStagingDirectoryList()
207 return new File(DictionaryInfoUtils.getWordListStagingDirectory(context)).listFiles(); in getStagingDirectoryList()
211 public static File[] getUnusedDictionaryList(final Context context) { in getUnusedDictionaryList()
214 public boolean accept(File dir, String filename) { in getUnusedDictionaryList()
[all …]
/packages/apps/TV/common/tests/robotests/src/com/android/tv/common/util/
DCommonUtilsTest.java28 import java.io.File;
38 File file = new File(RuntimeEnvironment.application.getExternalFilesDir(null), "file"); in deleteDirOrFile_file()
46 File dir = new File(RuntimeEnvironment.application.getExternalFilesDir(null), "dir"); in deleteDirOrFile_Dir()
48 assertThat(new File(dir, "file").createNewFile()).isTrue(); in deleteDirOrFile_Dir()
55 File dir = new File(RuntimeEnvironment.application.getExternalFilesDir(null), "dir"); in deleteDirOrFile_unreadableDir()
57 assertThat(new File(dir, "file").createNewFile()).isTrue(); in deleteDirOrFile_unreadableDir()
67 File dir = new File(RuntimeEnvironment.application.getExternalFilesDir(null), "dir"); in deleteDirOrFile_unreadableSubDir()
68 File subDir = new File(dir, "sub"); in deleteDirOrFile_unreadableSubDir()
70 File file = new File(subDir, "file"); in deleteDirOrFile_unreadableSubDir()
/packages/services/Car/tests/BugReportApp/src/com/google/android/car/bugreport/
DFileUtils.java22 import java.io.File;
46 static File getPendingDir(Context context) { in getPendingDir()
49 File dir = new File(context.getDataDir(), PENDING_DIR); in getPendingDir()
58 static File createTempDir(Context context, String timestamp) { in createTempDir()
59 File dir = getTempDir(context, timestamp); in createTempDir()
68 static File getTempDir(Context context, String timestamp) { in getTempDir()
71 return new File(context.getDataDir(), TEMP_DIR + "/" + timestamp); in getTempDir()
112 static File getFileWithSuffix(Context context, String timestamp, String suffix) { in getFileWithSuffix()
113 return new File(createTempDir(context, timestamp), timestamp + suffix); in getFileWithSuffix()
125 static File getFile(Context context, String timestamp, String name) { in getFile()
[all …]
/packages/apps/Dialer/java/com/android/dialer/persistentlog/
DPersistentLogFileHandler.java33 import java.io.File;
68 private File logDirectory;
75 private File outputFile;
89 logDirectory = new File(new File(context.getCacheDir(), LOG_DIRECTORY), subfolder); in initialize()
147 File[] files = getLogFiles(); in readBlob()
150 for (File file : files) { in readBlob()
156 private static int getTotalSize(File[] files) { in getTotalSize()
158 for (File file : files) { in getTotalSize()
185 for (File file : getLogFiles()) { in deleteLogs()
193 File[] files = getLogFiles(); in selectNextFileToWrite()
[all …]
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/
DBinaryDictionaryGetter.java31 import java.io.File;
51 private static final File[] EMPTY_FILE_ARRAY = new File[0];
77 final File directory = new File(DictionaryInfoUtils.getWordListTempDirectory(context)); in getTempFileName()
86 return File.createTempFile("xxx" + safeId, null, directory).getAbsolutePath(); in getTempFileName()
144 final File mFile;
146 public FileAndMatchLevel(final File file, final int matchLevel) { in FileAndMatchLevel()
166 public static File[] getCachedWordLists(final String locale, final Context context) { in getCachedWordLists()
167 final File[] directoryList = DictionaryInfoUtils.getCachedDirectoryList(context); in getCachedWordLists()
170 for (File directory : directoryList) { in getCachedWordLists()
176 final File[] wordLists = directory.listFiles(); in getCachedWordLists()
[all …]
/packages/providers/DownloadProvider/src/com/android/providers/downloads/
DHelpers.java63 import java.io.File;
238 final File parent; in generateSaveFile()
239 final File[] parentTest; in generateSaveFile()
243 final File file = new File(Uri.parse(hint).getPath()); in generateSaveFile()
245 parentTest = new File[] { parent }; in generateSaveFile()
249 parentTest = new File[] { in generateSaveFile()
257 for (File test : parentTest) { in generateSaveFile()
297 final File file = new File(parent, name); in generateSaveFile()
450 private static boolean isFilenameAvailableLocked(File[] parents, String name) { in isFilenameAvailableLocked()
453 for (File parent : parents) { in isFilenameAvailableLocked()
[all …]
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/
DBaseVoicemailProviderTest.java29 import java.io.File;
40 private File mTestDirectory;
114 public File getDir(String name, int mode) { in createMockProviderCalls()
126 private synchronized File getTestDirectory() {
128 File baseDirectory = getContext().getCacheDir();
129 mTestDirectory = new File(baseDirectory, Long.toString(System.currentTimeMillis()));
142 private static void recursiveDeleteAll(File input) {
144 for (File file : input.listFiles()) {
151 private List<File> findAllFiles(File input) {
158 List<File> results = new ArrayList<File>();
[all …]
/packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/
DHelpersTest.java26 import java.io.File;
43 final File expected = new File(getContext().getFilesDir(), "file.mp4"); in testGenerateSaveFile()
51 final File expected1 = new File(getContext().getFilesDir(), "file.txt"); in testGenerateSaveFileDupes()
55 final File expected2 = new File(getContext().getFilesDir(), "file-1.txt"); in testGenerateSaveFileDupes()
64 final File expected = new File(getContext().getFilesDir(), "file.mp4"); in testGenerateSaveFileNoExtension()
72 final File expected = new File(getContext().getFilesDir(), "meow"); in testGenerateSaveFileHint()
82 final File expected = new File(getContext().getFilesDir(), "real.mp4"); in testGenerateSaveFileDisposition()
/packages/apps/Car/SystemUpdater/src/com/android/car/systemupdater/
DDeviceListFragment.java41 import java.io.File;
60 private final Stack<File> mFileStack = new Stack<>();
63 private List<File> mListItems;
154 ArrayList<File> volumes = new ArrayList<>(vols.size()); in showMountedVolumes()
156 File path = vol.getPathForUser(getActivity().getUserId()); in showMountedVolumes()
170 private void setFileList(List<File> files) { in setFileList()
178 private void onFileSelected(File file) { in onFileSelected()
207 private void showFolderContent(File folder) { in showFolderContent()
219 new AsyncTask<File, Void, File[]>() { in showFolderContent()
221 protected File[] doInBackground(File... file) { in showFolderContent()
[all …]
/packages/providers/ContactsProvider/src/com/android/providers/contacts/
DPhotoStore.java31 import java.io.File;
57 private final File mStorePath;
70 public PhotoStore(File rootDirectory, ContactsDatabaseHelper databaseHelper) { in PhotoStore()
71 mStorePath = new File(rootDirectory, DIRECTORY); in PhotoStore()
89 File[] files = mStorePath.listFiles(); in clear()
91 for (File file : files) { in clear()
120 File[] files = mStorePath.listFiles(); in initialize()
124 for (File file : files) { in initialize()
195 File file = null; in insert()
199 file = File.createTempFile("img", null, mStorePath); in insert()
[all …]
/packages/apps/WallpaperPicker2/src/com/android/wallpaper/model/
DLegacyPartnerWallpaperInfo.java32 import java.io.File;
55 private File mSystemLegacyDir;
80 File systemDir = partnerProvider.getLegacyWallpaperDirectory(); in getAll()
87 for (File file : systemDir.listFiles()) { in getAll()
116 private File getSystemLegacyDir(Context context) { in getSystemLegacyDir()
127 final File systemDir = getSystemLegacyDir(context); in getThumbnail()
132 File thumbnail = new File(systemDir, mThumbName); in getThumbnail()
145 final File systemDir = getSystemLegacyDir(context); in getAsset()
146 File fullSizeImage = (systemDir == null) ? null : new File(systemDir, mFullName); in getAsset()
155 final File systemDir = getSystemLegacyDir(context); in getThumbAsset()
[all …]
/packages/apps/StorageManager/src/com/android/storagemanager/deletionhelper/
DFetchDownloadsLoader.java30 import java.io.File;
41 private File mDirectory;
48 public FetchDownloadsLoader(Context context, File directory) { in FetchDownloadsLoader()
63 static DownloadsResult collectFiles(File dir) { in collectFiles()
67 private static DownloadsResult collectFiles(File dir, DownloadsResult result) { in collectFiles()
71 File downloadFiles[] = dir.listFiles(); in collectFiles()
73 for (File currentFile : downloadFiles) { in collectFiles()
109 public ArrayList<File> files;
110 public HashMap<File, Bitmap> thumbnails;
113 this(0, Long.MAX_VALUE, new ArrayList<File>(), new HashMap<>()); in DownloadsResult()
[all …]
/packages/apps/StorageManager/robotests/src/com/android/storagemanager/deletionhelper/
DDownloadsFilePreferenceTest.java22 import java.io.File;
49 private File mTempDir;
63 File file = mock(File.class); in testSizeSummary()
79 File file = new File(mTempDir, "test.bmp"); in compareTo_biggerFileSortsAhead()
82 File otherFile = new File(mTempDir, "test.txt"); in compareTo_biggerFileSortsAhead()
94 File file = new File(mTempDir, "test.bmp"); in compareTo_fallbackToFileName()
97 File otherFile = new File(mTempDir, "test.txt"); in compareTo_fallbackToFileName()
/packages/apps/WallpaperPicker/src/com/android/wallpaperpicker/
DSavedWallpaperImages.java32 import java.io.File;
46 public SavedWallpaperInfo(int dbId, File target, Drawable thumb) { in SavedWallpaperInfo()
85 File file = new File(mContext.getFilesDir(), filename); in loadThumbnailsAndImageIdList()
90 new File(mContext.getFilesDir(), c.getString(2)), in loadThumbnailsAndImageIdList()
111 new File(mContext.getFilesDir(), result.getString(0)).delete(); in deleteImage()
112 new File(mContext.getFilesDir(), result.getString(1)).delete(); in deleteImage()
125 File imageFile = File.createTempFile("wallpaper", "", mContext.getFilesDir()); in writeImage()
131 File thumbFile = File.createTempFile("wallpaperthumb", "", mContext.getFilesDir()); in writeImage()
162 File oldSavedImagesFile = new File(context.getCacheDir(), in moveFromCacheDirectoryIfNecessary()
164 File savedImagesFile = context.getDatabasePath(WallpaperFiles.WALLPAPER_IMAGES_DB); in moveFromCacheDirectoryIfNecessary()
/packages/apps/TV/tuner/src/com/android/tv/tuner/exoplayer2/buffer/
DDvrStorageManager.java25 import java.io.File;
57 private final File mBufferDir;
62 public DvrStorageManager(File file, boolean isRecording) { in DvrStorageManager()
69 public File getBufferDir() { in getBufferDir()
172 File file = new File(getBufferDir(), fileName); in readTrackInfoFiles()
212 File file = new File(getBufferDir(), fileName); in readCaptionInfoFiles()
225 private ArrayList<BufferManager.PositionHolder> readOldIndexFile(File indexFile) in readOldIndexFile()
238 private ArrayList<BufferManager.PositionHolder> readNewIndexFile(File indexFile) in readNewIndexFile()
256 File file = new File(getBufferDir(), trackId + IDX_FILE_SUFFIX_V2); in readIndexFile()
260 return readOldIndexFile(new File(getBufferDir(), trackId + IDX_FILE_SUFFIX)); in readIndexFile()
[all …]

12345678910>>...18