Home
last modified time | relevance | path

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

12345678910>>...18

/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;
39 final List<File> noneList = getAllPackageSpecificGiftPaths(getContext(), PACKAGE_NONE); in testGifts()
40 for (File none : noneList) { in testGifts()
45 final List<File> readList = getAllPackageSpecificGiftPaths(getContext(), PACKAGE_READ); in testGifts()
46 for (File read : readList) { in testGifts()
50 final List<File> writeList = getAllPackageSpecificGiftPaths(getContext(), PACKAGE_WRITE); in testGifts()
51 for (File write : writeList) { in testGifts()
60 final List<File> noneList = getAllPackageSpecificObbGiftPaths(getContext(), PACKAGE_NONE); in testObbGifts()
61 for (File none : noneList) { in testObbGifts()
68 final List<File> noneList = getAllPackageSpecificObbGiftPaths(getContext(), PACKAGE_NONE); in testRemoveObbGifts()
[all …]
/cts/tests/tests/os/src/android/os/cts/
DFileAccessPermissionTest.java24 import java.io.File;
55 File file = new File("/system"); in testSystemDirAccess()
59 File fakeSystemFile = new File(file, "test"); in testSystemDirAccess()
68 file = new File("/system/app"); in testSystemDirAccess()
73 File[] allFiles = file.listFiles(); in testSystemDirAccess()
74 for (File f : allFiles) { in testSystemDirAccess()
84 File file = new File("/system/app"); in testApksAlwaysReadable()
87 File[] apkFiles = file.listFiles(new FilenameFilter() { in testApksAlwaysReadable()
88 public boolean accept(File dir, String filename) { in testApksAlwaysReadable()
92 for (File f : apkFiles) { in testApksAlwaysReadable()
[all …]
DFileObserverTest.java27 import java.io.File;
41 private void helpSetUp(File dir) throws Exception { in helpSetUp()
42 File testFile = new File(dir, TEST_FILE); in helpSetUp()
44 File testDir = new File(dir, TEST_DIR); in helpSetUp()
51 File dir = getContext().getFilesDir(); in setUp()
64 private void helpTearDown(File dir) throws Exception { in helpTearDown()
65 File testFile = new File(dir, TEST_FILE); in helpTearDown()
66 File testDir = new File(dir, TEST_DIR); in helpTearDown()
67 File moveDestFile = new File(testDir, TEST_FILE); in helpTearDown()
86 File dir = getContext().getFilesDir(); in tearDown()
[all …]
/cts/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/src/com/android/cts/writeexternalstorageapp/
DWriteMultiViewTest.java32 import java.io.File;
40 final File ourCache = getContext().getExternalCacheDir(); in testMoveAway()
41 final File otherCache = new File(ourCache.getAbsolutePath() in testMoveAway()
43 final File ourTestDir = new File(ourCache, "testDir"); in testMoveAway()
44 final File otherTestDir = new File(otherCache, "testDir"); in testMoveAway()
45 final File beforeFile = new File(otherTestDir, "test.probe"); in testMoveAway()
46 final File afterFile = new File(ourTestDir, "test.probe"); in testMoveAway()
59 final File ourCache = getContext().getExternalCacheDir(); in testMoveBack()
60 final File otherCache = new File(ourCache.getAbsolutePath() in testMoveBack()
62 final File ourTestDir = new File(ourCache, "testDir"); in testMoveBack()
[all …]
DWriteExternalStorageTest.java46 import java.io.File;
58 private static final File TEST_FILE = new File(
65 private static final File[] IDENTICAL_FILES = {
66 new File("/sdcard/caek"),
67 new File(System.getenv("EXTERNAL_STORAGE"), "caek"),
68 new File(Environment.getExternalStorageDirectory(), "caek"),
75 for (File file : IDENTICAL_FILES) { in tearDown()
105 final File probe = new File( in testWriteExternalStorageDirs()
121 for (File target : IDENTICAL_FILES) { in testLegacyPaths()
123 for (File file : IDENTICAL_FILES) { in testLegacyPaths()
[all …]
DWriteGiftTest.java34 import java.io.File;
42 final List<File> noneList = getAllPackageSpecificGiftPaths(getContext(), PACKAGE_NONE); in testGifts()
43 for (File none : noneList) { in testGifts()
52 final List<File> readList = getAllPackageSpecificGiftPaths(getContext(), PACKAGE_READ); in testGifts()
53 for (File read : readList) { in testGifts()
62 final List<File> writeList = getAllPackageSpecificGiftPaths(getContext(), PACKAGE_WRITE); in testGifts()
63 for (File write : writeList) { in testGifts()
77 final List<File> noneList = getAllPackageSpecificObbGiftPaths(getContext(), PACKAGE_NONE); in testObbGifts()
78 for (File none : noneList) { in testObbGifts()
93 final List<File> noneList = getAllPackageSpecificObbGiftPaths(getContext(), PACKAGE_NONE); in testAccessObbGifts()
[all …]
/cts/tests/tests/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 …]
/cts/hostsidetests/appsecurity/test-apps/ReadExternalStorageApp/src/com/android/cts/readexternalstorageapp/
DReadMultiViewTest.java29 import java.io.File;
37 final File ourCache = getContext().getExternalCacheDir(); in testFolderSetup()
38 final File ourTestDir = new File(ourCache, "testDir"); in testFolderSetup()
39 final File ourFile = new File(ourTestDir, "test.probe"); in testFolderSetup()
49 final File ourCache = getContext().getExternalCacheDir(); in testRWAccess()
50 final File ourTestDir = new File(ourCache, "testDir"); in testRWAccess()
51 final File testFile = new File(ourTestDir, "test.probe"); in testRWAccess()
63 final File ourCache = getContext().getExternalCacheDir(); in testROAccess()
64 final File otherCache = new File(ourCache.getAbsolutePath() in testROAccess()
66 final File otherTestDir = new File(otherCache, "testDir"); in testROAccess()
[all …]
DReadGiftTest.java29 import java.io.File;
37 final List<File> noneList = getAllPackageSpecificGiftPaths(getContext(), PACKAGE_NONE); in testGifts()
38 for (File none : noneList) { in testGifts()
43 final List<File> readList = getAllPackageSpecificGiftPaths(getContext(), PACKAGE_READ); in testGifts()
44 for (File read : readList) { in testGifts()
49 final List<File> writeList = getAllPackageSpecificGiftPaths(getContext(), PACKAGE_WRITE); in testGifts()
50 for (File write : writeList) { in testGifts()
/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/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/tests/media/src/android/media/cts/
DThumbnailUtilsTest.java35 import java.io.File;
50 private File mDir;
66 final File file = stageFile(R.raw.testmp3, new File(mDir, "cts.mp3")); in testCreateAudioThumbnail()
74 final File file = stageFile(R.raw.monotestmp3, new File(mDir, "audio.mp3")); in testCreateAudioThumbnail_SeparateFile()
75 stageFile(R.raw.volantis, new File(mDir, "AlbumArt.jpg")); in testCreateAudioThumbnail_SeparateFile()
84 final File file = stageFile(R.raw.monotestmp3, new File(mDir, "cts.mp3")); in testCreateAudioThumbnail_None()
94 final File file = stageFile(R.raw.volantis, new File(mDir, "cts.jpg")); in testCreateImageThumbnail()
102 final File file = stageFile( in testCreateVideoThumbnail()
104 new File(mDir, "cts.mp4")); in testCreateVideoThumbnail()
110 private static File stageFile(int resId, File file) throws IOException { in stageFile()
[all …]
DMediaScannerNotificationTest.java25 import java.io.File;
56 File noMedia = new File(tmpPath, ".nomedia"); in testMediaScannerNotification()
83 File tmpDir = new File(externalPath, "" + System.nanoTime()); in createTempFiles()
89 File foo = new File(tmpPath, "foobar." + extensions[i]); in createTempFiles()
107 File foo = new File(tmpPath, "foobar." + extensions[i]); in checkTempFiles()
115 assertTrue(new File(tmpPath, "foobar." + extensions[i]).delete()); in deleteTempFiles()
117 assertTrue(new File(tmpPath).delete()); in deleteTempFiles()
/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/security/src/android/security/cts/
DBannedFilesTest.java27 import java.io.File;
61 assertFalse("/dev/socket/init_runit", new File("/dev/socket/init_runit").exists()); in testNoRootCmdSocket()
62 assertFalse("/dev/socket/fotabinder", new File("/dev/socket/fotabinder").exists()); in testNoRootCmdSocket()
73 assertFalse("/dev/socket/fota", new File("/dev/socket/fota").exists()); in testNoSystemCmdSocket()
78 assertFalse("/sbin/su", new File("/sbin/su").exists()); in testNoSu()
79 assertFalse("/system/bin/su", new File("/system/bin/su").exists()); in testNoSu()
80 assertFalse("/system/sbin/su", new File("/system/sbin/su").exists()); in testNoSu()
81 assertFalse("/system/xbin/su", new File("/system/xbin/su").exists()); in testNoSu()
82 assertFalse("/vendor/bin/su", new File("/vendor/bin/su").exists()); in testNoSu()
93 File f = new File(i, "su"); in testNoSuInPath()
[all …]
/cts/hostsidetests/backup/FullBackupOnly/src/
DFullBackupOnlyTest.java35 import java.io.File;
52 private File mKeyValueBackupFile;
53 private File mDoBackupFile;
54 private File mDoBackupFile2;
69 File filesDir = mContext.getFilesDir(); in setupFiles()
70 File normalFolder = new File(filesDir, "normal_folder"); in setupFiles()
72 mDoBackupFile = new File(filesDir, "file_to_backup"); in setupFiles()
73 mDoBackupFile2 = new File(normalFolder, "file_to_backup2"); in setupFiles()
112 protected static File getKeyValueBackupFile(Context context) { in getKeyValueBackupFile()
115 File noBackupDir = context.getNoBackupFilesDir(); in getKeyValueBackupFile()
[all …]
/cts/hostsidetests/appsecurity/test-apps/StorageApp/src/com/android/cts/storageapp/
DUtils.java29 import java.io.File;
74 final File subdir = makeUniqueFile(c.getCacheDir()); in useSpace()
99 public static File makeUniqueFile(File dir) { in makeUniqueFile()
100 return new File(dir, Long.toString(System.nanoTime())); in makeUniqueFile()
103 public static File useWrite(File file, long size) throws Exception { in useWrite()
114 public static File useFallocate(File file, long length, long time) throws Exception { in useFallocate()
115 final File res = useFallocate(file, length); in useFallocate()
120 public static File useFallocate(File file, long length) throws Exception { in useFallocate()
131 public static long getSizeManual(File dir) throws Exception { in getSizeManual()
135 public static long getSizeManual(File dir, boolean excludeObb) throws Exception { in getSizeManual()
[all …]
DStorageTest.java51 import java.io.File;
75 final File dataDir = getContext().getDataDir(); in testFullDisk()
188 final File filesDir = getContext().getFilesDir(); in testVerifyAllocateApi()
189 final File extDir = Environment.getExternalStorageDirectory(); in testVerifyAllocateApi()
203 final File filesFile = makeUniqueFile(filesDir); in testVerifyAllocateApi()
215 final File dir = makeUniqueFile(getContext().getCacheDir()); in testBehaviorNormal()
220 final File ext = makeUniqueFile(getContext().getExternalCacheDir()); in testBehaviorNormal()
229 final File dir = makeUniqueFile(getContext().getCacheDir()); in testBehaviorGroup()
234 final File ext = makeUniqueFile(getContext().getExternalCacheDir()); in testBehaviorGroup()
243 final File dir = makeUniqueFile(getContext().getCacheDir()); in testBehaviorTombstone()
[all …]
/cts/tests/tests/database/src/android/database/sqlite/cts/
DSQLiteWalTest.java28 import java.io.File;
67 (new File(to)).delete(); in copyFile()
107 assertTrue((new File(db.getPath())).exists()); in prepareDatabase()
108 assertTrue((new File(db.getPath() + SHM_SUFFIX)).exists()); in prepareDatabase()
109 assertTrue((new File(db.getPath() + WAL_SUFFIX)).exists()); in prepareDatabase()
111 assertTrue((new File(db.getPath())).length() > 0); in prepareDatabase()
112 assertTrue((new File(db.getPath() + SHM_SUFFIX)).length() > 0); in prepareDatabase()
113 assertTrue((new File(db.getPath() + WAL_SUFFIX)).length() > 0); in prepareDatabase()
135 assertEquals(0, (new File(db.getPath() + WAL_SUFFIX)).length()); in testWalTruncate()
150 assertTrue((new File(db.getPath() + WAL_SUFFIX)).length() > 0); in testWalNoTruncate()
[all …]
/cts/tools/vm-tests-tf/build/src/util/build/
DBuildDalvikSuite.java19 import java.io.File;
214 File scriptDataDir = new File(OUTPUT_FOLDER + "/data/"); in handleTests()
216 writeToFile(new File(scriptDataDir, "scriptdata"), handler.datafileContent); in handleTests()
237 File sourceFolder = new File(JAVASRC_FOLDER); in generateBuildStepForDependant()
240 if (new File(sourceFolder, fileName + ".dfh").exists()) { in generateBuildStepForDependant()
245 if (new File(sourceFolder, fileName + ".d").exists()) { in generateBuildStepForDependant()
253 File dexFile = null; in generateBuildStepForDependant()
255 File smaliFile = new File(sourceFolder, fileName + ".smali"); in generateBuildStepForDependant()
256 File smalisDir = new File(sourceFolder, fileName + ".smalis"); in generateBuildStepForDependant()
259 dexFile = new File(OUTPUT_FOLDER, fileName + ".dex"); in generateBuildStepForDependant()
[all …]
DBuildStep.java19 import java.io.File;
33 final File folder;
34 final File fileName;
37 this.folder = new File(folder); in BuildFile()
38 this.fileName = new File(this.folder, fileName); in BuildFile()
40 BuildFile(File file) { in BuildFile()
77 BuildStep(File output) { in BuildStep()
111 public static void copyFile(File in, File out) throws IOException { in copyFile()
/cts/hostsidetests/dexmetadata/host/src/com/android/cts/dexmetadata/
DInstallDexMetadataHostTest.java30 import java.io.File;
68 private File mTmpDir;
69 private File mApkBaseFile = null;
70 private File mApkFeatureAFile = null;
71 private File mApkBaseFileWithVdex = null;
72 private File mApkFeatureAFileWithVdex = null;
73 private File mDmBaseFile = null;
74 private File mDmFeatureAFile = null;
75 private File mDmBaseFileWithVdex = null;
76 private File mDmFeatureAFileWithVdex = null;
[all …]
/cts/hostsidetests/backup/AllowBackup/src/
DAllowBackupTest.java35 import java.io.File;
53 private File mDoBackupFile;
54 private File mDoBackupFile2;
63 File filesDir = mContext.getFilesDir(); in setupFiles()
64 File normalFolder = new File(filesDir, "normal_folder"); in setupFiles()
66 mDoBackupFile = new File(filesDir, "file_to_backup"); in setupFiles()
67 mDoBackupFile2 = new File(normalFolder, "file_to_backup2"); in setupFiles()
112 private void addData(File file) throws IOException { in addData()

12345678910>>...18