Home
last modified time | relevance | path

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

12345678910>>...40

/packages/modules/Permission/tests/cts/permission/src/android/permission/cts/
DFileSystemPermissionTest.java48 import java.io.File;
101 File myFile = new File(getContext().getFilesDir(), "hello"); in testCreateFileHasSanePermissions()
123 File myDir = new File(getContext().getFilesDir(), "helloDirectory"); in testCreateDirectoryHasSanePermissions()
145 Set<File> writableDirs = new HashSet<File>(); in testOtherApplicationDirectoriesAreNotWritable()
152 … writableDirs.addAll(getWritableDirectoriesAndSubdirectoriesOf(new File(app.dataDir))); in testOtherApplicationDirectoriesAreNotWritable()
164 File parentDir = new File(myDataDir).getParentFile(); in testApplicationParentDirectoryNotWritable()
189 assertFalse(isDirectoryWritable(new File("/"))); in testRootDirectoryNotWritable()
195 assertFalse(isDirectoryWritable(new File("/dev"))); in testDevDirectoryNotWritable()
201 assertFalse(isDirectoryWritable(new File("/proc"))); in testProcDirectoryNotWritable()
207 File f = new File("/dev/diag"); in testDevDiagSane()
[all …]
/packages/providers/MediaProvider/tests/src/com/android/providers/media/scan/
DModernMediaScannerTest.java86 import java.io.File;
105 private File mDir;
120 mDir = new File(context.getExternalMediaDirs()[0], "test_" + System.nanoTime()); in setUp()
259 final File file = File.createTempFile("test", ".jpg"); in testParseDateTaken_Complete()
278 final File file = File.createTempFile("test", ".jpg"); in testParseDateTaken_Gps()
317 final File file = File.createTempFile("test", ".jpg"); in testParseDateTaken_File()
346 final File file = File.createTempFile("test", ".jpg"); in testParseDateTaken_Hopeless()
391 File dir) { in assertShouldScanPathAndIsPathHidden()
407 assertShouldScanPathAndIsPathHidden(true, false, new File(prefix)); in testShouldScanPathAndIsPathHidden()
408 assertShouldScanPathAndIsPathHidden(true, false, new File(prefix + "/meow")); in testShouldScanPathAndIsPathHidden()
[all …]
/packages/providers/MediaProvider/tests/src/com/android/providers/media/util/
DFileUtilsTest.java92 import java.io.File;
118 private File mTarget;
119 private File mDcimTarget;
120 private File mDeleteTarget;
121 private File mDownloadTarget;
122 private File mTestDownloadDir;
129 mDcimTarget = new File(mTarget, "DCIM"); in setUp()
134 mDownloadTarget = new File(Environment.getExternalStorageDirectory(), in setUp()
136 mTestDownloadDir = new File(mDownloadTarget, TEST_DIRECTORY_NAME); in setUp()
147 final File file = new File(mDeleteTarget, name); in touch()
[all …]
/packages/providers/MediaProvider/tests/src/com/android/providers/media/
DResolvePlaylistTest.java44 import java.io.File;
48 private File mDir;
63 mDir = new File(context.getExternalMediaDirs()[0], "test_" + System.nanoTime()); in setUp()
99 final File music = new File(mDir, "Music"); in doPlaylist()
101 stage(R.raw.test_audio, new File(music, "001.mp3")); in doPlaylist()
102 stage(R.raw.test_audio, new File(music, "002.mp3")); in doPlaylist()
103 stage(R.raw.test_audio, new File(music, "003.mp3")); in doPlaylist()
104 stage(R.raw.test_audio, new File(music, "004.mp3")); in doPlaylist()
105 stage(R.raw.test_audio, new File(music, "005.mp3")); in doPlaylist()
106 stage(res, new File(music, name)); in doPlaylist()
[all …]
DMediaProviderForFuseTest.java50 import java.io.File;
70 private static File sTestDir;
103 final File file = new File(sTestDir, "test" + System.nanoTime() + ".jpg"); in testTypicalChangeDirectory()
124 File targetDir = Environment.getExternalStoragePublicDirectory( in testTypicalChangeDirectory()
131 final File renamed = new File(targetDir, "renamed" + System.nanoTime() + ".jpg"); in testTypicalChangeDirectory()
148 final File file = new File(sTestDir, "test" + System.nanoTime() + ".jpg"); in testTypical()
170 final File renamed = new File(sTestDir, "renamed" + System.nanoTime() + ".jpg"); in testTypical()
187 File file = createSubdirWithOneFile(sTestDir); in testRenameDirectory()
188 File oldDir = file.getParentFile(); in testRenameDirectory()
191 final File renamedDir = new File(sTestDir, "renamed" + System.nanoTime()); in testRenameDirectory()
[all …]
/packages/providers/MediaProvider/tests/src/com/android/providers/media/photopicker/
DItemsProviderTest.java76 import java.io.File;
144 final File cameraDir = getCameraDir(); in testGetCategories_camera()
145 File imageFile = assertCreateNewImage(cameraDir); in testGetCategories_camera()
164 final File picturesDir = getPicturesDir(); in testGetCategories_not_camera()
165 File nonCameraImageFile = assertCreateNewImage(picturesDir); in testGetCategories_not_camera()
184 final File moviesDir = getMoviesDir(); in testGetCategories_videos()
185 File videoFile = assertCreateNewVideo(moviesDir); in testGetCategories_videos()
204 final File picturesDir = getPicturesDir(); in testGetCategories_not_videos()
205 File imageFile = assertCreateNewImage(picturesDir); in testGetCategories_not_videos()
224 final File screenshotsDir = getScreenshotsDir(); in testGetCategories_screenshots()
[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/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/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/Messaging/src/com/android/messaging/util/
DFileUtil.java30 import java.io.File;
40 private static synchronized File getNewFile(File directory, String extension, in getNewFile()
47 File testFile = new File(directory, newName); in getNewFile()
66 public static File getNewFile(File directory, String contentType) throws IOException { in getNewFile()
75 public static void removeFileOrDirectory(File root) { in removeFileOrDirectory()
80 public static void removeFileOrDirectoryExcept(File root, File exclude) { in removeFileOrDirectoryExcept()
83 for (File file : root.listFiles()) { in removeFileOrDirectoryExcept()
98 public static void moveAllContentUnderDirectory(File sourceDir, File targetDir) { in moveAllContentUnderDirectory()
105 for (File file : sourceDir.listFiles()) { in moveAllContentUnderDirectory()
107 final File dirTarget = new File(targetDir, file.getName()); in moveAllContentUnderDirectory()
[all …]
/packages/providers/MediaProvider/tests/client/src/com/android/providers/media/client/
DDownloadProviderTest.java40 import java.io.File;
71 List<File> otherPackageDirs = createOtherPackageExternalFilesDir(); in testCanReadWriteOtherAppPrivateFiles()
72 List<File> otherPackagePrivateFiles = createOtherPackagePrivateFile(otherPackageDirs); in testCanReadWriteOtherAppPrivateFiles()
73 for (File privateFile: otherPackagePrivateFiles) { in testCanReadWriteOtherAppPrivateFiles()
81 List<File> otherPackageDirs = createOtherPackageExternalFilesDir(); in testCanOpenOtherAppPrivateDir()
82 for (File privateDir: otherPackageDirs) { in testCanOpenOtherAppPrivateDir()
89 private List<File> createOtherPackageExternalFilesDir() throws Exception { in createOtherPackageExternalFilesDir()
92 List<File> otherPackageDirs = new ArrayList(); in createOtherPackageExternalFilesDir()
95 File volPath = getVolumePath(context, volName); in createOtherPackageExternalFilesDir()
106 otherPackageDirs.add(new File(dir)); in createOtherPackageExternalFilesDir()
[all …]
/packages/modules/GeoTZ/data_pipeline/src/main/java/com/android/timezone/location/data_pipeline/steps/
DMergeTzS2Ranges.java29 import java.io.File;
53 private final File mInputDir;
57 private final File mWorkingDir;
59 private final File mOutputFile;
64 File inputDir, ExecutorService executorService, File workingDir, File outputFile, in MergeTzS2Ranges()
79 public File inputDir;
90 public File workingDir;
96 public File outputFile;
108 File inputDir = arguments.inputDir; in main()
110 File workingDir = arguments.workingDir; in main()
[all …]
/packages/modules/ExtServices/java/tests/src/android/ext/services/common/
DAdServicesFilesCleanupBootCompleteReceiverTest.java51 import java.io.File;
180 File file1 = createFile(root, dataRoot, "level_1.txt"); // Preserved in testReceiverDeletesAdServicesDirectories()
181 File file2 = createFile(root, dataRoot, "adservices_level_1.txt"); // Deleted in testReceiverDeletesAdServicesDirectories()
182 File file3 = createFile(root, dataRoot + "/non_adservices", in testReceiverDeletesAdServicesDirectories()
184 File file4 = createFile(root, dataRoot + "/non_adservices", in testReceiverDeletesAdServicesDirectories()
186 File file5 = createFile(root, dataRoot + "/non_adservices/adservices_nested", in testReceiverDeletesAdServicesDirectories()
188 File file6 = createFile(root, dataRoot + "/non_adservices/adservices_nested", in testReceiverDeletesAdServicesDirectories()
190 File file7 = createFile(root, dataRoot + "/non_adservices", in testReceiverDeletesAdServicesDirectories()
192 File file8 = createFile(root, dataRoot + "/adservices-data", in testReceiverDeletesAdServicesDirectories()
194 File file9 = createFile(root, dataRoot + "/adservices-data/nested", in testReceiverDeletesAdServicesDirectories()
[all …]
/packages/apps/Traceur/src_common/com/android/traceur/
DWinscopeUtils.java31 import java.io.File;
43 private static final File[] CONSISTENTLY_NAMED_TRACE_FILES = {
44 new File(WM_TRACE_DIR + "wm_trace.winscope"),
45 new File(WM_TRACE_DIR + "wm_log.winscope"),
46 new File(WM_TRACE_DIR + "ime_trace_clients.winscope"),
47 new File(WM_TRACE_DIR + "ime_trace_managerservice.winscope"),
48 new File(WM_TRACE_DIR + "ime_trace_service.winscope"),
87 private static List<File> getTraceFilesFromWmTraceDir() { in getTraceFilesFromWmTraceDir()
88 List<File> traceFiles = new ArrayList<>(); in getTraceFilesFromWmTraceDir()
89 File[] wmTraceFiles = new File(WM_TRACE_DIR).listFiles(); in getTraceFilesFromWmTraceDir()
[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/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/modules/Virtualization/tests/pvmfw/helper/java/com/android/pvmfw/test/host/
DPvmfw.java26 import java.io.File;
48 @NonNull private final File mPvmfwBinFile;
49 private final File[] mEntries;
58 @NonNull File pvmfwBinFile, in Pvmfw()
59 @NonNull File bccFile, in Pvmfw()
60 @Nullable File debugPolicyFile, in Pvmfw()
61 @Nullable File vmDtboFile, in Pvmfw()
62 @Nullable File vmReferenceDtFile, in Pvmfw()
74 mEntries = new File[PVMFW_ENTRY_MAX]; in Pvmfw()
92 public void serialize(@NonNull File outFile) throws IOException { in serialize()
[all …]
/packages/modules/HealthFitness/tests/unittests/src/com/android/server/healthconnect/exportimport/
DImportManagerTest.java60 import java.io.File;
102 File testDir = mContext.getDir(TEST_DIRECTORY_NAME, Context.MODE_PRIVATE); in tearDown()
103 File[] allContents = testDir.listFiles(); in tearDown()
105 for (File file : allContents) { in tearDown()
120 File originalDb = mTransactionManager.getDatabasePath(); in copiesAllData()
121 File dbToImport = in copiesAllData()
122 new File(mContext.getDir(TEST_DIRECTORY_NAME, Context.MODE_PRIVATE), "export.db"); in copiesAllData()
124 File zipToImport = in copiesAllData()
125 new File(mContext.getDir(TEST_DIRECTORY_NAME, Context.MODE_PRIVATE), "export.zip"); in copiesAllData()
158 File originalDb = mTransactionManager.getDatabasePath(); in skipsMissingTables()
[all …]
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/hal/fakevhal/
DFakeVhalConfigParserUnitTest.java43 import java.io.File;
72 File tempFile = new File("NotExist.json"); in testCustomConfigFileNotExist()
81 File tempFile = createTempFileWithContent(/* fileContent= */ ""); in testCustomConfigFileIsEmpty()
91 File tempFile = createTempFileWithContent(fileContent); in testConfigFileHaveInvalidJsonObject()
103 File tempFile = createTempFileWithContent(jsonString); in testConfigFileInvalidJsonKey()
114 File tempFile = createTempFileWithContent(jsonString); in testConfigFileRootIsNotArray()
125 File tempFile = createTempFileWithContent(jsonString); in testConfigFileRootHasElementIsNotJsonObject()
137 File tempFile = createTempFileWithContent(jsonString); in testParseEachPropertyJsonObjectIsEmpty()
150 File tempFile = createTempFileWithContent(jsonString); in testParsePropertyIdWithIntValue()
161 File tempFile = createTempFileWithContent(jsonString); in testParsePropertyIdFieldNotExist()
[all …]
/packages/modules/Virtualization/tests/pvmfw/tools/
DPvmfwTool.java21 import java.io.File;
41 File out = new File(args[0]); in main()
42 File pvmfwBin = new File(args[1]); in main()
43 File bccData = new File(args[2]); in main()
45 File vmReferenceDt = null; in main()
46 File vmDtbo = null; in main()
47 File dp = null; in main()
49 vmReferenceDt = new File(args[3]); in main()
52 vmDtbo = new File(args[4]); in main()
55 dp = new File(args[5]); in main()
/packages/services/Car/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/backup/
DKitchenSinkBackupTransport.java40 import java.io.File;
73 private File mDataDir;
74 private File mCurrentSetDir;
75 private File mCurrentSetFullDir;
76 private File mCurrentSetIncrementalDir;
82 private File mRestoreSetDir;
83 private File mRestoreSetIncrementalDir;
84 private File mRestoreSetFullDir;
99 mCurrentSetDir = new File(mDataDir, Long.toString(CURRENT_SET_TOKEN)); in makeDataDirs()
100 mCurrentSetFullDir = new File(mCurrentSetDir, FULL_DATA_DIR); in makeDataDirs()
[all …]
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/telemetry/
DResultStoreTest.java44 import java.io.File;
60 private File mTestRootDir;
61 private File mTestInterimResultDir;
62 private File mTestErrorResultDir;
63 private File mTestMetricsReportDir;
64 private File mTestPublisherDataDir;
81 mTestInterimResultDir = new File(mTestRootDir, ResultStore.INTERIM_RESULT_DIR); in setUp()
82 mTestErrorResultDir = new File(mTestRootDir, ResultStore.ERROR_RESULT_DIR); in setUp()
83 mTestMetricsReportDir = new File(mTestRootDir, ResultStore.FINAL_RESULT_DIR); in setUp()
84 mTestPublisherDataDir = new File(mTestRootDir, ResultStore.PUBLISHER_STORAGE_DIR); in setUp()
[all …]
/packages/modules/GeoTZ/common/host/main/java/com/android/timezone/location/common/
DLicenseSupport.java20 import java.io.File;
68 public void checkLicensePresentInDir(File dir) throws IOException { in checkLicensePresentInDir()
70 File licenseFile = new File(dir, LICENSE_FILE_NAME); in checkLicensePresentInDir()
83 public static void copyLicenseFile(File inputDir, File outputDir) throws IOException { in copyLicenseFile()
87 File licenseFileInput = new File(inputDir, LICENSE_FILE_NAME); in copyLicenseFile()
91 File licenseOutputFile = new File(outputDir, LICENSE_FILE_NAME); in copyLicenseFile()
103 private static void checkFilesIdentical(File one, File two) throws IOException { in checkFilesIdentical()
115 private static void checkFileContains(File file, String snippet) throws IOException { in checkFileContains()
127 private static void checkIsFile(File file) { in checkIsFile()
133 private static void checkIsDir(File dir) { in checkIsDir()
/packages/services/Car/tests/BugReportApp/src/com/android/car/bugreport/
DFileUtils.java24 import java.io.File;
51 static File getPendingDir(Context context) { in getPendingDir()
54 File dir = new File(context.getDataDir(), PENDING_DIR); in getPendingDir()
63 static File getTempDir(Context context, String timestamp) { in getTempDir()
66 File dir = new File(context.getDataDir(), TEMP_DIR + "/" + timestamp); in getTempDir()
111 static File getFileWithSuffix(Context context, String timestamp, String suffix) { in getFileWithSuffix()
112 return new File(getTempDir(context, timestamp), timestamp + suffix); in getFileWithSuffix()
124 static File getFile(Context context, String timestamp, String name) { in getFile()
125 return new File(getTempDir(context, timestamp), name); in getFile()
133 static void deleteDirectory(File directory) { in deleteDirectory()
[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 …]

12345678910>>...40