Home
last modified time | relevance | path

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

12345678910>>...27

/cts/hostsidetests/appsecurity/test-apps/ExternalStorageApp/src/com/android/cts/externalstorageapp/
DCommonExternalStorageTest.java33 import java.io.File;
75 final File single = getContext().getExternalCacheDir(); in testMultipleCacheDirs()
77 final File firstMultiple = getContext().getExternalCacheDirs()[0]; in testMultipleCacheDirs()
85 final File single = getContext().getExternalFilesDir(Environment.DIRECTORY_PICTURES); in testMultipleFilesDirs()
87 final File firstMultiple = getContext() in testMultipleFilesDirs()
96 final File single = getContext().getObbDir(); in testMultipleObbDirs()
98 final File firstMultiple = getContext().getObbDirs()[0]; in testMultipleObbDirs()
107 final List<File> paths = getAllPackageSpecificPaths(getContext()); in testAllPackageDirsWritable()
108 for (File path : paths) { in testAllPackageDirsWritable()
115 final File directChild = new File(path, "directChild"); in testAllPackageDirsWritable()
[all …]
DGiftTest.java31 import java.io.File;
36 final List<File> noneList = getAllPackageSpecificNoGiftPaths(getContext(), PACKAGE_NONE); in testStageNonGifts()
37 for (File none : noneList) { in testStageNonGifts()
48 final List<File> readList = getAllPackageSpecificNoGiftPaths(getContext(), PACKAGE_READ); in testNoGifts()
49 for (File read : readList) { in testNoGifts()
53 final List<File> noneList = getAllPackageSpecificNoGiftPaths(getContext(), PACKAGE_NONE); in testNoGifts()
54 for (File none : noneList) { in testNoGifts()
64 final List<File> noneList = getAllPackageSpecificObbGiftPaths(getContext(), PACKAGE_NONE); in testObbGifts()
65 for (File none : noneList) { in testObbGifts()
72 final List<File> noneList = getAllPackageSpecificObbGiftPaths(getContext(), PACKAGE_NONE); in testRemoveObbGifts()
[all …]
/cts/tests/tests/os/src/android/os/cts/
DFileAccessPermissionTest.java25 import java.io.File;
57 File file = new File("/system"); in testSystemDirAccess()
61 File fakeSystemFile = new File(file, "test"); in testSystemDirAccess()
70 file = new File("/system/app"); in testSystemDirAccess()
75 File[] allFiles = file.listFiles(); in testSystemDirAccess()
76 for (File f : allFiles) { in testSystemDirAccess()
86 File file = new File("/system/app"); in testApksAlwaysReadable()
89 File[] apkFiles = file.listFiles(new FilenameFilter() { in testApksAlwaysReadable()
90 public boolean accept(File dir, String filename) { in testApksAlwaysReadable()
94 for (File f : apkFiles) { in testApksAlwaysReadable()
[all …]
DFileObserverTest.java29 import java.io.File;
40 …private static final File EXT_STORAGE_DIR = new File(Environment.getExternalStorageDirectory(), "f…
45 private void helpSetUp(File dir) throws Exception { in helpSetUp()
46 File testFile = new File(dir, TEST_FILE); in helpSetUp()
48 File testDir = new File(dir, TEST_DIR); in helpSetUp()
55 File dir = getContext().getFilesDir(); in setUp()
75 private void helpTearDown(File dir) throws Exception { in helpTearDown()
76 File testFile = new File(dir, TEST_FILE); in helpTearDown()
77 File testDir = new File(dir, TEST_DIR); in helpTearDown()
78 File moveDestFile = new File(testDir, TEST_FILE); in helpTearDown()
[all …]
/cts/hostsidetests/scopedstorage/src/android/scopedstorage/cts/
DScopedStorageTest.java108 import java.io.File;
239 final File topLevelPdf = new File(getExternalStorageDir(), NONMEDIA_FILE_NAME); in testManageExternalStorageCanCreateFilesAnywhere()
240 final File musicFileInMovies = new File(getMoviesDir(), AUDIO_FILE_NAME); in testManageExternalStorageCanCreateFilesAnywhere()
241 final File imageFileInDcim = new File(getDcimDir(), IMAGE_FILE_NAME); in testManageExternalStorageCanCreateFilesAnywhere()
256 final File otherAppImage = new File(getDcimDir(), "other" + IMAGE_FILE_NAME); in testManageExternalStorageCanReadRedactedContents()
276 final File otherAppExternalDataDir = new File(getExternalFilesDir().getPath().replace( in testManageExternalStorageCantReadWriteOtherAppExternalDir()
278 final File otherAppExternalDataFile = new File(otherAppExternalDataDir, in testManageExternalStorageCantReadWriteOtherAppExternalDir()
323 final File otherAppPdf = new File(getDownloadDir(), "other" + NONMEDIA_FILE_NAME); in testManageExternalStorageCanDeleteOtherAppsContents()
324 final File otherAppImage = new File(getDcimDir(), "other" + IMAGE_FILE_NAME); in testManageExternalStorageCanDeleteOtherAppsContents()
325 final File otherAppMusic = new File(getMusicDir(), "other" + AUDIO_FILE_NAME); in testManageExternalStorageCanDeleteOtherAppsContents()
[all …]
DAppCloningDeviceTest.java36 import java.io.File;
53 final File dir = new File(dirPath); in testInsertFilesInDirectoryViaMediaProvider()
56 final File file = new File(dir, getFileToBeCreatedName()); in testInsertFilesInDirectoryViaMediaProvider()
66 final File dir = new File(dirPath); in testInsertFilesInDirectoryViaMediaProviderWithPathSpecified()
69 final File file = new File(dir, getFileToBeCreatedName()); in testInsertFilesInDirectoryViaMediaProviderWithPathSpecified()
80 final File dir = new File(dirPath); in testGetFilesInDirectoryViaMediaProviderRespectsUserId()
82 final File expectedFile = new File(dir, getFileToBeExpectedName()); in testGetFilesInDirectoryViaMediaProviderRespectsUserId()
84 final File notExpectedFile = new File(dir, getFileNotToBeExpectedName()); in testGetFilesInDirectoryViaMediaProviderRespectsUserId()
/cts/hostsidetests/scopedstorage/general/src/android/scopedstorage/cts/general/
DScopedStorageDeviceTest.java166 import java.io.File;
292 final File dcimDir = getDcimDir(); in testTypePathConformity()
293 final File documentsDir = getDocumentsDir(); in testTypePathConformity()
294 final File downloadDir = getDownloadDir(); in testTypePathConformity()
295 final File moviesDir = getMoviesDir(); in testTypePathConformity()
296 final File musicDir = getMusicDir(); in testTypePathConformity()
297 final File picturesDir = getPicturesDir(); in testTypePathConformity()
301 new File(musicDir, NONMEDIA_FILE_NAME).createNewFile(); in testTypePathConformity()
305 new File(musicDir, VIDEO_FILE_NAME).createNewFile(); in testTypePathConformity()
309 new File(musicDir, IMAGE_FILE_NAME).createNewFile(); in testTypePathConformity()
[all …]
/cts/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/src/com/android/cts/writeexternalstorageapp/
DWriteExternalStorageTest.java46 import java.io.File;
59 private static final File TEST_FILE = new File(
66 private static final File[] IDENTICAL_FILES = {
67 new File("/sdcard/caek"),
68 new File(System.getenv("EXTERNAL_STORAGE"), "caek"),
69 new File(Environment.getExternalStorageDirectory(), "caek"),
76 for (File file : IDENTICAL_FILES) { in tearDown()
116 final File probe = new File( in testWriteExternalStorageDirs()
138 for (File target : IDENTICAL_FILES) { in testLegacyPaths()
140 for (File file : IDENTICAL_FILES) { in testLegacyPaths()
[all …]
DWriteGiftTest.java33 import java.io.File;
38 final List<File> writeList = getAllPackageSpecificNoGiftPaths(getContext(), PACKAGE_WRITE); in testStageNonGifts()
39 for (File write : writeList) { in testStageNonGifts()
50 final List<File> noneList = getAllPackageSpecificNoGiftPaths(getContext(), PACKAGE_NONE); in testNoGifts()
51 for (File none : noneList) { in testNoGifts()
55 final List<File> writeList = getAllPackageSpecificNoGiftPaths(getContext(), PACKAGE_WRITE); in testNoGifts()
56 for (File write : writeList) { in testNoGifts()
66 final List<File> noneList = getAllPackageSpecificObbGiftPaths(getContext(), PACKAGE_NONE); in testObbGifts()
67 for (File none : noneList) { in testObbGifts()
82 final List<File> noneList = getAllPackageSpecificObbGiftPaths(getContext(), PACKAGE_NONE); in testAccessObbGifts()
[all …]
/cts/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/src/com/android/cts/multiuserstorageapp/
DMultiUserStorageTest.java32 import java.io.File;
52 private void wipeTestFiles(File dir) { in wipeTestFiles()
54 final File[] files = dir.listFiles(); in wipeTestFiles()
56 for (File file : files) { in wipeTestFiles()
75 for (File path : getAllPackageSpecificPathsExceptObb(getContext())) { in testWriteIsolatedStorage()
80 writeInt(new File(path, FILE_SINGLETON), uid); in testWriteIsolatedStorage()
99 for (File path : getAllPackageSpecificPathsExceptObb(getContext())) { in testReadIsolatedStorage()
105 readInt(new File(path, FILE_SINGLETON))); in testReadIsolatedStorage()
132 final File myPath = Environment.getExternalStorageDirectory(); in testUserIsolation()
137 final File basePath = myPath.getParentFile(); in testUserIsolation()
[all …]
/cts/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/
DRootProcessScanner.java19 import java.io.File;
60 List<File> rootProcessDirs = getRootProcessDirs(); in getRootProcesses()
68 private static List<File> getRootProcessDirs() in getRootProcessDirs()
70 File proc = new File("/proc"); in getRootProcessDirs()
75 List<File> rootProcesses = new ArrayList<File>(); in getRootProcessDirs()
76 File[] processDirs = proc.listFiles(); in getRootProcessDirs()
78 for (File processDir : processDirs) { in getRootProcessDirs()
92 private static boolean isUnapprovedRootProcess(File pathname) in isUnapprovedRootProcess()
99 private static boolean isPidDirectory(File pathname) { in isPidDirectory()
103 private static boolean isKernelProcess(File processDir) in isKernelProcess()
[all …]
/cts/hostsidetests/statsdatom/apps/statsdapp/src/com/android/server/cts/device/statsdatom/
DDirectoryTests.java21 import java.io.File;
30 final File f = new File("/data/misc/stats-active-metric/"); in testStatsActiveMetricDirectoryExists()
37 final File f = new File("/data/misc/stats-data/"); in testStatsDataDirectoryExists()
44 final File f = new File("/data/misc/stats-metadata/"); in testStatsMetadataDirectoryExists()
51 final File f = new File("/data/misc/stats-service/"); in testStatsServiceDirectoryExists()
58 final File f = new File("/data/misc/train-info/"); in testTrainInfoDirectoryExists()
/cts/hostsidetests/appsecurity/test-apps/ReadExternalStorageApp/src/com/android/cts/readexternalstorageapp/
DReadMultiViewTest.java25 import java.io.File;
32 final File ourCache = getContext().getExternalCacheDir(); in testFolderSetup()
33 final File ourTestDir = new File(ourCache, "testDir"); in testFolderSetup()
34 final File ourFile = new File(ourTestDir, "test.probe"); in testFolderSetup()
44 final File ourCache = getContext().getExternalCacheDir(); in testRWAccess()
45 final File ourTestDir = new File(ourCache, "testDir"); in testRWAccess()
46 final File testFile = new File(ourTestDir, "test.probe"); in testRWAccess()
/cts/hostsidetests/scopedstorage/legacy/src/android/scopedstorage/cts/legacy/
DLegacyStorageTest.java106 import java.io.File;
196 assertCanCreateFile(new File(TestUtils.getExternalStorageDir(), "LegacyStorageTest.txt")); in testCreateFilesInRandomPlaces_hasW()
199 assertCanCreateFile(new File(TestUtils.getDcimDir(), "LegacyStorageTest.mp3")); in testCreateFilesInRandomPlaces_hasW()
202 assertCanCreateFile(new File(TestUtils.getExternalFilesDir(), in testCreateFilesInRandomPlaces_hasW()
206 final File otherAppDir = new File(TestUtils.getAndroidDataDir(), "com.android.shell"); in testCreateFilesInRandomPlaces_hasW()
207 final File file = new File(otherAppDir, "LegacyStorageTest.txt"); in testCreateFilesInRandomPlaces_hasW()
226 final File topLevelDir = new File(TestUtils.getExternalStorageDir(), "LegacyStorageTest"); in testMkdirInRandomPlaces_hasW()
229 final File otherAppDir = new File(TestUtils.getAndroidDataDir(), "com.android.shell"); in testMkdirInRandomPlaces_hasW()
232 final File subDir = new File(otherAppDir, "LegacyStorageTest"); in testMkdirInRandomPlaces_hasW()
248 final File newTxtFile = new File(TestUtils.getExternalStorageDir(), in testCantAccessExternalStorage()
[all …]
/cts/hostsidetests/backup/includeexcludeapp/src/android/cts/backup/includeexcludeapp/
DIncludeExcludeTest.java37 import java.io.File;
64 private List<File> mIncludeFiles;
65 private List<File> mExcludeFiles;
66 private List<File> mRequireFakeClientSideEncryptionFiles;
88 File filesDir = mContext.getFilesDir(); in setupFiles()
92 File databaseDir = mContext.getDatabasePath("db_name"); in setupFiles()
96 File externalDir = mContext.getExternalFilesDir(null); in setupFiles()
100 File rootDir = mContext.getDataDir(); in setupFiles()
102 mRequireFakeClientSideEncryptionFiles.add(new File(rootDir, "fake_encryption_file")); in setupFiles()
115 private void setupFileTree(File directory) { in setupFileTree()
[all …]
/cts/tests/MediaProviderTranscode/src/android/mediaprovidertranscode/cts/
DTranscodeTest.java60 import java.io.File;
70 private static final File EXTERNAL_STORAGE_DIRECTORY
72 private static final File DIR_CAMERA
73 = new File(EXTERNAL_STORAGE_DIRECTORY, Environment.DIRECTORY_DCIM + "/Camera");
77 private static final File[] DIRS_NO_TRANSCODE = {
78 new File(EXTERNAL_STORAGE_DIRECTORY, Environment.DIRECTORY_PICTURES),
79 new File(EXTERNAL_STORAGE_DIRECTORY, Environment.DIRECTORY_MOVIES),
80 new File(EXTERNAL_STORAGE_DIRECTORY, Environment.DIRECTORY_DOWNLOADS),
81 new File(EXTERNAL_STORAGE_DIRECTORY, Environment.DIRECTORY_DCIM),
82 new File(EXTERNAL_STORAGE_DIRECTORY, Environment.DIRECTORY_DOCUMENTS),
[all …]
/cts/tests/tests/security/src/android/security/cts/
DBannedFilesTest.java26 import java.io.File;
59 assertFalse("/dev/socket/init_runit", new File("/dev/socket/init_runit").exists()); in testNoRootCmdSocket()
60 assertFalse("/dev/socket/fotabinder", new File("/dev/socket/fotabinder").exists()); in testNoRootCmdSocket()
71 assertFalse("/dev/socket/fota", new File("/dev/socket/fota").exists()); in testNoSystemCmdSocket()
76 assertFalse("/sbin/su", new File("/sbin/su").exists()); in testNoSu()
77 assertFalse("/system/bin/su", new File("/system/bin/su").exists()); in testNoSu()
78 assertFalse("/system/sbin/su", new File("/system/sbin/su").exists()); in testNoSu()
79 assertFalse("/system/xbin/su", new File("/system/xbin/su").exists()); in testNoSu()
80 assertFalse("/vendor/bin/su", new File("/vendor/bin/su").exists()); in testNoSu()
91 File f = new File(i, "su"); in testNoSuInPath()
[all …]
/cts/hostsidetests/stagedinstall/src/com/android/tests/stagedinstall/host/
DApexShimValidationTest.java42 import java.io.File;
81 private File mDeapexingDir;
82 private File mDeapexerZip;
83 private File mAllApexesZip;
144 final File deapexer = extractDeapexer(mDeapexingDir); in testPackageNameOfShimApkInAllBundledApexesIsAllowed()
145 final File debugfs = new File(mDeapexingDir, DEBUGFS_STATIC_FILE_NAME); in testPackageNameOfShimApkInAllBundledApexesIsAllowed()
146 final File fsckerofs = new File(mDeapexingDir, FSCKEROFS_FILE_NAME); in testPackageNameOfShimApkInAllBundledApexesIsAllowed()
147 final List<File> apexes = extractApexes(mDeapexingDir); in testPackageNameOfShimApkInAllBundledApexesIsAllowed()
148 for (File apex : apexes) { in testPackageNameOfShimApkInAllBundledApexesIsAllowed()
149 final File outDir = new File(apex.getParent(), apex.getName().substring( in testPackageNameOfShimApkInAllBundledApexesIsAllowed()
[all …]
/cts/hostsidetests/scopedstorage/device/src/android/scopedstorage/cts/device/
DOwnedFilesRule.java30 import java.io.File;
45 private static final File sImageFile1 = new File(getDcimDir(), IMAGE_1);
46 private static final File sImageFile2Metadata = new File(getDcimDir(), IMAGE_2);
48 private static final File sVideoFile1 = new File(getDcimDir(), VIDEO_1);
55 private static final List<File> ownedItemsList = List.of(sImageFile1, sImageFile2Metadata,
70 public Uri createFile(int resourceId, File imageFile) throws IOException { in createFile()
78 public Uri createFile(File file) throws IOException { in createFile()
92 public static File getImageFile1() { in getImageFile1()
96 public static File getImageFile2Metadata() { in getImageFile2Metadata()
100 public static File getVideoFile1() { in getVideoFile1()
[all …]
DOtherAppFilesRule.java45 import java.io.File;
61 private static final File sImageFile = new File(getDcimDir(), IMAGE_1);
62 private static final File sImageFile2 = new File(getDcimDir(), IMAGE_2);
63 private static final File sVideoFile1 = new File(getDcimDir(), VIDEO_1);
64 private static final File sVideoFile2 = new File(getDcimDir(), VIDEO_2);
66 private static final List<File> otherAppFilesList = List.of(sImageFile, sImageFile2,
82 File buffer = new File(getDcimDir(), "OtherAppFilesRule_buffer_" + NONCE + ".jpg"); in before()
103 public static File getImageFile1() { in getImageFile1()
107 public static File getImageFile2() { in getImageFile2()
111 public static File getVideoFile1() { in getVideoFile1()
[all …]
/cts/hostsidetests/backup/fullbackupapp/src/android/cts/backup/fullbackupapp/
DFullbackupTest.java35 import java.io.File;
52 private File mNoBackupFile;
53 private File mNoBackupFile2;
54 private File mDoBackupFile;
55 private File mDoBackupFile2;
65 File noBackupDir = mContext.getNoBackupFilesDir(); in setupFiles()
66 File folderInNoBackup = new File(noBackupDir, "folder_not_to_backup"); in setupFiles()
68 mNoBackupFile = new File(noBackupDir, "file_not_backed_up"); in setupFiles()
69 mNoBackupFile2 = new File(folderInNoBackup, "file_not_backed_up2"); in setupFiles()
72 File filesDir = mContext.getFilesDir(); in setupFiles()
[all …]
/cts/tests/tests/view/src/android/view/cts/util/
DBitmapDumper.java25 import java.io.File;
39 private static File sDumpDirectory;
52 File[] toRemove = sDumpDirectory.listFiles(); in initializeIfNeeded()
54 for (File file : toRemove) { in initializeIfNeeded()
60 private static boolean deleteContentsAndDir(File dir) { in deleteContentsAndDir()
68 private static boolean deleteContents(File dir) { in deleteContents()
69 File[] files = dir.listFiles(); in deleteContents()
72 for (File file : files) { in deleteContents()
85 private static File getFile(String className, String testName, String type) { in getFile()
86 File testDirectory = new File(sDumpDirectory, className); in getFile()
[all …]
/cts/hostsidetests/appsecurity/test-apps/AppDataIsolationTestApp/common/src/com/android/cts/appdataisolation/common/
DFileUtils.java30 import java.io.File;
58 new FileInputStream(new File(path, "FILE_DOES_NOT_EXIST")); in assertDirIsNotAccessible()
63 assertThat(new File(path).canExecute()).isFalse(); in assertDirIsNotAccessible()
67 File directory = new File(path); in assertDirDoesNotExist()
76 File parent = directory.getParentFile(); in assertDirDoesNotExist()
100 assertThat(new File(path).canExecute()).isTrue(); in assertDirIsAccessible()
113 File directory = new File(path); in assertFileDoesNotExist()
117 new FileInputStream(new File(path, name)); in assertFileDoesNotExist()
124 File file = new File(path, name); in assertFileExists()
129 File file = new File(path, name); in touchFile()
[all …]
/cts/tests/tests/media/misc/src/android/media/misc/cts/
DThumbnailUtilsTest.java44 import java.io.File;
66 private File mDir;
111 final File file = stageFile("testmp3.mp3", new File(mDir, "cts.mp3")); in testCreateAudioThumbnail()
119 final File file = stageFile("monotestmp3.mp3", new File(mDir, "audio.mp3")); in testCreateAudioThumbnail_SeparateFile()
120 stageFile("volantis.jpg", new File(mDir, "AlbumArt.jpg")); in testCreateAudioThumbnail_SeparateFile()
129 final File file = stageFile("monotestmp3.mp3", new File(mDir, "cts.mp3")); in testCreateAudioThumbnail_None()
139 final File file = stageFile("volantis.jpg", new File(mDir, "cts.jpg")); in testCreateImageThumbnail()
157 final File file = stageFile(res, new File(mDir, "cts.jpg")); in testCreateImageThumbnail_sampleWithThumbnail()
166 final File file = stageFile(res, new File(mDir, "cts.jpg")); in testCreateImageThumbnail_strippedSample()
180 final File file = stageFile(res, new File(mDir, "cts.heic")); in testCreateImageThumbnail_HEICSample()
[all …]
/cts/tests/tests/textclassifier/src/android/view/textclassifier/cts/
DHelper.java29 import java.io.File;
48 File file = null; in takeScreenshotAndSave()
66 File file = null; in dumpsysAndSave()
81 private static File saveBitmapToFile(Bitmap bitmap, File file) { in saveBitmapToFile()
93 private static File createTestFile(String testName, String name, String targetFolder) in createTestFile()
95 final File dir = getLocalDirectory(targetFolder); in createTestFile()
103 private static File getLocalDirectory(String targetFolder) { in getLocalDirectory()
104 final File dir = new File(targetFolder); in getLocalDirectory()
113 private static File createFile(File dir, String filename) throws IOException { in createFile()
114 final File file = new File(dir, filename); in createFile()

12345678910>>...27