Home
last modified time | relevance | path

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

12345678910>>...20

/frameworks/base/core/java/android/os/
DEnvironment.java28 import java.io.File;
59 private static final File DIR_ANDROID_ROOT = getDirectory(ENV_ANDROID_ROOT, "/system");
60 private static final File DIR_OEM_ROOT = getDirectory(ENV_OEM_ROOT, "/oem");
61 private static final File DIR_VENDOR_ROOT = getDirectory(ENV_VENDOR_ROOT, "/vendor");
62 private static final File DIR_MEDIA_STORAGE = getDirectory(ENV_MEDIA_STORAGE, "/data/media");
87 private final File[] mExternalDirsForVold;
89 private final File[] mExternalDirsForApp;
91 private final File mEmulatedDirForDirect;
104 ArrayList<File> externalForVold = Lists.newArrayList(); in UserEnvironment()
105 ArrayList<File> externalForApp = Lists.newArrayList(); in UserEnvironment()
[all …]
DFileUtils.java27 import java.io.File;
74 public static int setPermissions(File path, int mode, int uid, int gid) { in setPermissions()
162 public static boolean copyFile(File srcFile, File destFile) { in copyFile()
181 public static boolean copyToFile(InputStream inputStream, File destFile) { in copyToFile()
211 public static boolean isFilenameSafe(File file) { in isFilenameSafe()
226 public static String readTextFile(File file, int max, String ellipsis) throws IOException { in readTextFile()
302 public static long checksumCrc32(File file) throws FileNotFoundException, IOException { in checksumCrc32()
331 public static boolean deleteOlderFiles(File dir, int minCount, long minAge) { in deleteOlderFiles()
336 final File[] files = dir.listFiles(); in deleteOlderFiles()
340 Arrays.sort(files, new Comparator<File>() { in deleteOlderFiles()
[all …]
/frameworks/base/services/core/java/com/android/server/updates/
DSELinuxPolicyInstallReceiver.java29 import java.io.File;
51 private void backupContexts(File contexts) { in backupContexts()
52 new File(contexts, versionPath).renameTo( in backupContexts()
53 new File(contexts, versionPath + "_backup")); in backupContexts()
55 new File(contexts, macPermissionsPath).renameTo( in backupContexts()
56 new File(contexts, macPermissionsPath + "_backup")); in backupContexts()
58 new File(contexts, seappContextsPath).renameTo( in backupContexts()
59 new File(contexts, seappContextsPath + "_backup")); in backupContexts()
61 new File(contexts, propertyContextsPath).renameTo( in backupContexts()
62 new File(contexts, propertyContextsPath + "_backup")); in backupContexts()
[all …]
/frameworks/base/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/
DMain.java40 import java.io.File;
107 if (platformDir != null && !platformDir.isEmpty() && new File(platformDir).isDirectory()) { in getPlatformDir()
113 platformDir = getPlatformDirFromHostOut(new File(androidHostOut)); in getPlatformDir()
119 File workingDir = new File(workingDirString); in getPlatformDir()
127 File currentDir = workingDir; in getPlatformDir()
136 private static String getPlatformDirFromRoot(File root) { in getPlatformDirFromRoot()
140 File out = new File(root, "out"); in getPlatformDirFromRoot()
144 File host = new File(out, "host"); in getPlatformDirFromRoot()
148 File[] hosts = host.listFiles(new FileFilter() { in getPlatformDirFromRoot()
150 public boolean accept(File path) { in getPlatformDirFromRoot()
[all …]
/frameworks/support/v4/java/android/support/v4/content/
DContextCompat.java30 import java.io.File;
157 public static File[] getObbDirs(Context context) { in getObbDirs()
162 final File single; in getObbDirs()
169 return new File[] { single }; in getObbDirs()
217 public static File[] getExternalFilesDirs(Context context, String type) { in getExternalFilesDirs()
222 final File single; in getExternalFilesDirs()
229 return new File[] { single }; in getExternalFilesDirs()
277 public static File[] getExternalCacheDirs(Context context) { in getExternalCacheDirs()
282 final File single; in getExternalCacheDirs()
289 return new File[] { single }; in getExternalCacheDirs()
[all …]
DFileProvider.java40 import java.io.File;
317 private static final File DEVICE_ROOT = new File("/");
375 public static Uri getUriForFile(Context context, String authority, File file) { in getUriForFile()
412 final File file = mStrategy.getFileForUri(uri); in query()
451 final File file = mStrategy.getFileForUri(uri); in getType()
497 final File file = mStrategy.getFileForUri(uri); in delete()
519 final File file = mStrategy.getFileForUri(uri); in openFile()
575 File target = null; in parsePathStrategy()
612 public Uri getUriForFile(File file); in getUriForFile()
617 public File getFileForUri(Uri uri); in getFileForUri()
[all …]
/frameworks/base/core/tests/coretests/src/android/os/
DFileUtilsTest.java32 import java.io.File;
43 private File mDir;
44 private File mTestFile;
45 private File mCopyFile;
51 mTestFile = new File(mDir, "test.file"); in setUp()
52 mCopyFile = new File(mDir, "copy.file"); in setUp()
79 assertTrue(FileUtils.isFilenameSafe(new File("foobar"))); in testIsFilenameSafe()
80 assertTrue(FileUtils.isFilenameSafe(new File("a_b-c=d.e/0,1+23"))); in testIsFilenameSafe()
81 assertFalse(FileUtils.isFilenameSafe(new File("foo*bar"))); in testIsFilenameSafe()
82 assertFalse(FileUtils.isFilenameSafe(new File("foo\nbar"))); in testIsFilenameSafe()
[all …]
/frameworks/base/core/java/com/android/internal/backup/
DLocalTransport.java41 import java.io.File;
79 private File mDataDir = new File(Environment.getDownloadCacheDirectory(), "backup");
80 private File mCurrentSetDir = new File(mDataDir, Long.toString(CURRENT_SET_TOKEN));
81 private File mCurrentSetIncrementalDir = new File(mCurrentSetDir, INCREMENTAL_DIR);
82 private File mCurrentSetFullDir = new File(mCurrentSetDir, FULL_DATA_DIR);
87 private File mRestoreSetDir;
88 private File mRestoreSetIncrementalDir;
89 private File mRestoreSetFullDir;
99 private File mFullRestoreSetDir;
173 File packageDir = new File(mCurrentSetIncrementalDir, packageInfo.packageName); in performBackup()
[all …]
/frameworks/support/tests/java/android/support/v4/content/
DFileProviderTest.java34 import java.io.File;
64 File file = buildPath(mContext.getFilesDir(), "file.test"); in testStrategyUriSimple()
84 File file = buildPath(mContext.getFilesDir(), "..", "file.test"); in testStrategyUriJumpOutside()
95 strat.addRoot("tag2", new File("/")); in testStrategyUriShortestRoot()
97 File file = buildPath(mContext.getFilesDir(), "file.test"); in testStrategyUriShortestRoot()
102 strat.addRoot("tag1", new File("/")); in testStrategyUriShortestRoot()
114 File file = buildPath(mContext.getFilesDir(), "file.test"); in testStrategyFileSimple()
138 File file = buildPath(mContext.getFilesDir(), "lol\"wat?foo&bar", "wat.txt"); in testStrategyEscaping()
151 File file = buildPath(mContext.getFilesDir(), "file.txt"); in testStrategyExtraParams()
161 File inFile = new File(mContext.getFilesDir(), "//foo//bar//"); in testStrategyExtraSeparators()
[all …]
/frameworks/multidex/library/src/android/support/multidex/
DMultiDexExtractor.java27 import java.io.File;
82 static List<File> load(Context context, ApplicationInfo applicationInfo, File dexDir, in load()
85 final File sourceApk = new File(applicationInfo.sourceDir); in load()
89 List<File> files; in load()
110 private static List<File> loadExistingExtractions(Context context, File sourceApk, File dexDir) in loadExistingExtractions()
116 final List<File> files = new ArrayList<File>(totalDexNumber); in loadExistingExtractions()
120 File extractedFile = new File(dexDir, fileName); in loadExistingExtractions()
136 private static boolean isModified(Context context, File archive, long currentCrc) { in isModified()
142 private static long getTimeStamp(File archive) { in getTimeStamp()
152 private static long getZipCrc(File archive) throws IOException { in getZipCrc()
[all …]
DMultiDex.java29 import java.io.File;
63 private static final String SECONDARY_FOLDER_NAME = "code_cache" + File.separator +
158 File dexDir = new File(applicationInfo.dataDir, SECONDARY_FOLDER_NAME); in install()
159 List<File> files = MultiDexExtractor.load(context, applicationInfo, dexDir, false); in install()
237 private static void installSecondaryDexes(ClassLoader loader, File dexDir, List<File> files) in installSecondaryDexes()
255 private static boolean checkValidZipFiles(List<File> files) { in checkValidZipFiles()
256 for (File file : files) { in checkValidZipFiles()
341 File dexDir = new File(context.getFilesDir(), OLD_SECONDARY_FOLDER_NAME); in clearOldDexDir()
344 File[] files = dexDir.listFiles(); in clearOldDexDir()
349 for (File oldFile : files) { in clearOldDexDir()
[all …]
/frameworks/base/core/java/com/android/internal/util/
DFileRotator.java24 import java.io.File;
54 private final File mBasePath;
98 public FileRotator(File basePath, String prefix, long rotateAgeMillis, long deleteAgeMillis) { in FileRotator()
114 final File backupFile = new File(mBasePath, name); in FileRotator()
115 final File file = new File( in FileRotator()
124 final File noBackupFile = new File(mBasePath, name); in FileRotator()
125 final File file = new File( in FileRotator()
143 new File(mBasePath, name).delete(); in deleteAll()
160 final File file = new File(mBasePath, name); in dumpAll()
235 final File file = new File(mBasePath, name); in rewriteSingle()
[all …]
DJournaledFile.java19 import java.io.File;
32 File mReal;
33 File mTemp;
36 public JournaledFile(File real, File temp) { in JournaledFile()
47 public File chooseForRead() { in chooseForRead()
48 File result; in chooseForRead()
71 public File chooseForWrite() { in chooseForWrite()
/frameworks/base/core/tests/hosttests/test-apps/MultiDexLegacyTestServicesTests/src/com/android/framework/multidexlegacytestservices/test/
DServicesTests.java23 import java.io.File;
38 File targetFilesDir = getInstrumentation().getTargetContext().getFilesDir(); in testStressConcurentFirstLaunch()
40 File resultFile = new File(targetFilesDir, "Service" + i); in testStressConcurentFirstLaunch()
44 File completeFile = new File(targetFilesDir, "Service" + i + ".complete"); in testStressConcurentFirstLaunch()
73 File resultFile = new File(targetFilesDir, "Service" + i); in testStressConcurentFirstLaunch()
79 private static boolean areAllServicesRunning(File tagetFilesDir) { in areAllServicesRunning()
81 File completeFile = new File(tagetFilesDir, "Service" + i + ".complete"); in areAllServicesRunning()
/frameworks/base/core/java/android/app/backup/
DRecentsBackupHelper.java8 import java.io.File;
35 final File mSystemDir;
36 final File mTasksDir;
37 final File mRestoredTasksDir;
38 final File mRestoredImagesDir;
48 mSystemDir = new File(Environment.getDataDirectory(), "system"); in RecentsBackupHelper()
49 mTasksDir = new File(mSystemDir, RECENTS_TASK_DIR); in RecentsBackupHelper()
50 mRestoredTasksDir = new File(mSystemDir, RECENTS_TASK_RESTORE_DIR); in RecentsBackupHelper()
51 mRestoredImagesDir = new File(mSystemDir, RECENTS_IMAGE_RESTORE_DIR); in RecentsBackupHelper()
54 File[] recentFiles = mTasksDir.listFiles(); in RecentsBackupHelper()
[all …]
/frameworks/support/v4/java/android/support/v4/provider/
DRawDocumentFile.java23 import java.io.File;
28 private File mFile;
30 RawDocumentFile(DocumentFile parent, File file) { in RawDocumentFile()
42 final File target = new File(mFile, displayName); in createFile()
54 final File target = new File(mFile, displayName); in createDirectory()
125 final File[] files = mFile.listFiles(); in listFiles()
127 for (File file : files) { in listFiles()
136 final File target = new File(mFile.getParentFile(), displayName); in renameTo()
158 private static boolean deleteContents(File dir) { in deleteContents()
159 File[] files = dir.listFiles(); in deleteContents()
[all …]
/frameworks/base/packages/SharedStorageBackup/src/com/android/sharedstoragebackup/
DObbBackupService.java30 import java.io.File;
60 File obbDir = Environment.buildExternalStorageAppObbDirs(packageName)[0];
63 ArrayList<File> obbList = allFileContents(obbDir);
71 for (File f : obbList) {
109 File outFile = Environment.buildExternalStorageAppObbDirs(packageName)[0];
111 outFile = new File(outFile, path);
128 ArrayList<File> allFileContents(File rootDir) {
129 final ArrayList<File> files = new ArrayList<File>();
130 final ArrayList<File> dirs = new ArrayList<File>();
134 File dir = dirs.remove(0);
[all …]
/frameworks/support/
Dsettings.gradle2 project(':support-annotations').projectDir = new File(rootDir, 'annotations')
5 project(':support-v4').projectDir = new File(rootDir, 'v4')
8 project(':support-appcompat-v7').projectDir = new File(rootDir, 'v7/appcompat')
11 project(':support-gridlayout-v7').projectDir = new File(rootDir, 'v7/gridlayout')
14 project(':support-mediarouter-v7').projectDir = new File(rootDir, 'v7/mediarouter')
17 project(':support-palette-v7').projectDir = new File(rootDir, 'v7/palette')
20 project(':support-recyclerview-v7').projectDir = new File(rootDir, 'v7/recyclerview')
23 project(':support-cardview-v7').projectDir = new File(rootDir, 'v7/cardview')
26 project(':support-v13').projectDir = new File(rootDir, 'v13')
29 project(':support-leanback-v17').projectDir = new File(rootDir, 'v17/leanback')
/frameworks/base/packages/ExternalStorageProvider/src/com/android/externalstorage/
DExternalStorageProvider.java50 import java.io.File;
97 private HashMap<String, File> mIdToPath;
100 private Map<File, DirectoryObserver> mObservers = Maps.newHashMap();
149 final File path = volume.getPathFile(); in updateVolumesLocked()
188 private String getDocIdForFile(File file) throws FileNotFoundException { in getDocIdForFile()
192 Map.Entry<String, File> mostSpecific = null; in getDocIdForFile()
194 for (Map.Entry<String, File> root : mIdToPath.entrySet()) { in getDocIdForFile()
220 private File getFileForDocId(String docId) throws FileNotFoundException { in getFileForDocId()
225 File target; in getFileForDocId()
235 target = new File(target, path); in getFileForDocId()
[all …]
/frameworks/base/core/tests/coretests/src/android/content/pm/
DAppCacheTest.java34 import java.io.File;
58 void cleanUpDirectory(File pDir, String dirName) { in cleanUpDirectory()
59 File testDir = new File(pDir, dirName); in cleanUpDirectory()
65 File file = new File(testDir, fList[i]); in cleanUpDirectory()
76 File testDir = mContext.getCacheDir(); in cleanUpCacheDirectory()
87 File file = new File(testDir, fList[i]); in cleanUpCacheDirectory()
128 File cacheDir = mContext.getCacheDir(); in testFreeApplicationCacheAllFiles()
145 File cacheDir = mContext.getCacheDir(); in testFreeApplicationCacheSomeFiles()
166 public void openOutFileInAppFilesDir(File pFile, String pFileOut) { in openOutFileInAppFilesDir()
222 File file = new File(con.getCacheDir(), fileName); in testAppCacheCreateFile()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/
DMountServiceTests.java34 import java.io.File;
115 private File getFilePath(String name) { in getFilePath()
116 final File filesDir = mContext.getFilesDir(); in getFilePath()
117 final File outFile = new File(filesDir, name); in getFilePath()
121 private void copyRawToFile(int rawResId, File outFile) { in copyRawToFile()
140 private void mountObb(StorageManager sm, final int resource, final File file, in mountObb()
162 final File file) { in mountObbWithoutWait()
172 private void waitForObbActionCompletion(final StorageManager sm, final File file, in waitForObbActionCompletion()
186 private String checkMountedPath(final StorageManager sm, final File file) { in checkMountedPath()
194 private void unmountObb(final StorageManager sm, final File file, int expectedState) { in unmountObb()
[all …]
/frameworks/base/packages/DefaultContainerService/src/com/android/defcontainer/
DDefaultContainerService.java55 import java.io.File;
105 final File packageFile = new File(packagePath);
135 final File packageFile = new File(packagePath);
164 final File packageFile = new File(packagePath);
210 final File dir = Environment.maybeTranslateEmulatedPathToInternal(new File(path));
237 final File directory = new File(path);
253 final File packageFile = new File(packagePath);
290 void eraseFiles(File[] paths) { in eraseFiles()
291 for (File path : paths) { in eraseFiles()
296 void eraseFiles(File path) { in eraseFiles()
[all …]
/frameworks/base/services/usage/java/com/android/server/usage/
DUsageStatsDatabase.java26 import java.io.File;
46 private final File[] mIntervalDirs;
49 private final File mVersionFile;
51 public UsageStatsDatabase(File dir) { in UsageStatsDatabase()
52 mIntervalDirs = new File[] { in UsageStatsDatabase()
53 new File(dir, "daily"), in UsageStatsDatabase()
54 new File(dir, "weekly"), in UsageStatsDatabase()
55 new File(dir, "monthly"), in UsageStatsDatabase()
56 new File(dir, "yearly"), in UsageStatsDatabase()
58 mVersionFile = new File(dir, "version"); in UsageStatsDatabase()
[all …]
/frameworks/base/services/core/java/com/android/server/pm/
DPackageInstallerSession.java75 import java.io.File;
104 final File stageDir;
153 private File mResolvedBaseFile;
156 private File mResolvedStageDir;
159 private final List<File> mResolvedStagedFiles = new ArrayList<>();
161 private final List<File> mResolvedInheritedFiles = new ArrayList<>();
188 File stageDir, String stageCid, boolean prepared, boolean sealed) { in PackageInstallerSession()
267 private File resolveStageDir() throws IOException { in resolveStageDir()
275 mResolvedStageDir = new File(path); in resolveStageDir()
350 final File target = new File(resolveStageDir(), name); in openWriteInternal()
[all …]
/frameworks/base/tests/RenderScriptTests/SceneGraph/src/com/android/testapp/
DFileSelector.java19 import java.io.File;
38 File[] mCurrentSubList;
39 File mCurrentFile;
42 public boolean accept(File file) { in accept()
50 private void populateList(File file) { in populateList()
83 populateList(new File("/sdcard/")); in onCreate()
89 File parent = mCurrentFile.getParentFile(); in onListItemClick()
98 File selectedFile = mCurrentSubList[position - 1]; in onListItemClick()

12345678910>>...20