Home
last modified time | relevance | path

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

12345678910>>...32

/frameworks/base/core/java/android/os/
DEnvironment.java36 import java.io.File;
71 private static final File DIR_ANDROID_ROOT = getDirectory(ENV_ANDROID_ROOT, "/system");
72 private static final File DIR_ANDROID_DATA = getDirectory(ENV_ANDROID_DATA, "/data");
73 private static final File DIR_ANDROID_EXPAND = getDirectory(ENV_ANDROID_EXPAND, "/mnt/expand");
74 private static final File DIR_ANDROID_STORAGE = getDirectory(ENV_ANDROID_STORAGE, "/storage");
75 private static final File DIR_DOWNLOAD_CACHE = getDirectory(ENV_DOWNLOAD_CACHE, "/cache");
76 private static final File DIR_OEM_ROOT = getDirectory(ENV_OEM_ROOT, "/oem");
77 private static final File DIR_ODM_ROOT = getDirectory(ENV_ODM_ROOT, "/odm");
78 private static final File DIR_VENDOR_ROOT = getDirectory(ENV_VENDOR_ROOT, "/vendor");
79 private static final File DIR_PRODUCT_ROOT = getDirectory(ENV_PRODUCT_ROOT, "/product");
[all …]
DFileUtils.java63 import java.io.File;
141 public static int setPermissions(File path, int mode, int uid, int gid) { in setPermissions()
212 public static void copyPermissions(@NonNull File from, @NonNull File to) throws IOException { in copyPermissions()
259 public static boolean copyFile(File srcFile, File destFile) { in copyFile()
273 public static void copyFileOrThrow(File srcFile, File destFile) throws IOException { in copyFileOrThrow()
285 public static boolean copyToFile(InputStream inputStream, File destFile) { in copyToFile()
299 public static void copyToFileOrThrow(InputStream in, File destFile) throws IOException { in copyToFileOrThrow()
322 public static long copy(@NonNull File from, @NonNull File to) throws IOException { in copy()
338 public static long copy(@NonNull File from, @NonNull File to, in copy()
596 public static boolean isFilenameSafe(File file) { in isFilenameSafe()
[all …]
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/license/
DLicenseHtmlLoaderCompatTest.java35 import java.io.File;
60 ArrayList<File> xmlFiles = new ArrayList<>(); in testLoadInBackground()
61 xmlFiles.add(new File("test.xml")); in testLoadInBackground()
62 File cachedHtmlFile = new File("test.html"); in testLoadInBackground()
71 ArrayList<File> xmlFiles = new ArrayList<>(); in testLoadInBackgroundWithNoVaildXmlFiles()
72 File cachedHtmlFile = new File("test.html"); in testLoadInBackgroundWithNoVaildXmlFiles()
81 ArrayList<File> xmlFiles = new ArrayList<>(); in testLoadInBackgroundWithNonOutdatedCachedHtmlFile()
82 xmlFiles.add(new File("test.xml")); in testLoadInBackgroundWithNonOutdatedCachedHtmlFile()
83 File cachedHtmlFile = new File("test.html"); in testLoadInBackgroundWithNonOutdatedCachedHtmlFile()
92 ArrayList<File> xmlFiles = new ArrayList<>(); in testLoadInBackgroundWithGenerateHtmlFileFailed()
[all …]
/frameworks/base/services/tests/wmtests/src/com/android/server/wm/
DTaskSnapshotPersisterLoaderTest.java42 import java.io.File;
61 final File[] files = new File[] { new File(FILES_DIR.getPath() + "/snapshots/1.proto"), in testPersistAndLoadSnapshot()
62 new File(FILES_DIR.getPath() + "/snapshots/1.jpg"), in testPersistAndLoadSnapshot()
63 new File(FILES_DIR.getPath() + "/snapshots/1_reduced.jpg")}; in testPersistAndLoadSnapshot()
64 assertTrueForFiles(files, File::exists, " must exist"); in testPersistAndLoadSnapshot()
72 private static void assertTrueForFiles(File[] files, Predicate<File> predicate, in assertTrueForFiles()
74 for (File file : files) { in assertTrueForFiles()
84 assertFalse(new File(FILES_DIR.getPath() + "/snapshots/1.proto").exists()); in testTaskRemovedFromRecents()
85 assertFalse(new File(FILES_DIR.getPath() + "/snapshots/1.jpg").exists()); in testTaskRemovedFromRecents()
86 assertFalse(new File(FILES_DIR.getPath() + "/snapshots/1_reduced.jpg").exists()); in testTaskRemovedFromRecents()
[all …]
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/license/
DLicenseHtmlLoaderCompat.java25 import java.io.File;
32 public class LicenseHtmlLoaderCompat extends AsyncLoaderCompat<File> {
52 public File loadInBackground() { in loadInBackground()
57 protected void onDiscardResult(File f) { in onDiscardResult()
60 private File generateHtmlFromDefaultXmlFiles() { in generateHtmlFromDefaultXmlFiles()
61 final List<File> xmlFiles = getVaildXmlFiles(); in generateHtmlFromDefaultXmlFiles()
67 File cachedHtmlFile = getCachedHtmlFile(mContext); in generateHtmlFromDefaultXmlFiles()
76 private List<File> getVaildXmlFiles() { in getVaildXmlFiles()
77 final List<File> xmlFiles = new ArrayList(); in getVaildXmlFiles()
79 File file = new File(xmlPath); in getVaildXmlFiles()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/
DUserDataPreparerTest.java42 import java.io.File;
97 File userDeDir = mUserDataPreparer.getDataUserDeDirectory(null, TEST_USER_ID); in testPrepareUserData_De()
99 File systemDeDir = mUserDataPreparer.getDataSystemDeDirectory(TEST_USER_ID); in testPrepareUserData_De()
115 File userCeDir = mUserDataPreparer.getDataUserCeDirectory(null, TEST_USER_ID); in testPrepareUserData_Ce()
117 File systemCeDir = mUserDataPreparer.getDataSystemCeDirectory(TEST_USER_ID); in testPrepareUserData_Ce()
134 File systemCeDir = mUserDataPreparer.getDataSystemCeDirectory(TEST_USER_ID); in testDestroyUserData()
136 File ceFile = new File(systemCeDir, "file"); in testDestroyUserData()
152 File systemDir = mUserDataPreparer.getUserSystemDirectory(TEST_USER_ID); in testDestroyUserData_De()
154 writeFile(new File(systemDir, "file"), "-----" ); in testDestroyUserData_De()
155 File systemDeDir = mUserDataPreparer.getDataSystemDeDirectory(TEST_USER_ID); in testDestroyUserData_De()
[all …]
/frameworks/base/services/backup/java/com/android/server/backup/
DUserBackupManagerFiles.java22 import java.io.File;
30 private static File getBaseDir(int userId) { in getBaseDir()
34 static File getBaseStateDir(int userId) { in getBaseStateDir()
36 return new File(getBaseDir(userId), BACKUP_PERSISTENT_DIR); in getBaseStateDir()
40 return new File(Environment.getDataDirectory(), BACKUP_PERSISTENT_DIR); in getBaseStateDir()
43 static File getDataDir(int userId) { in getDataDir()
45 return new File(getBaseDir(userId), BACKUP_STAGING_DIR); in getDataDir()
49 return new File(Environment.getDownloadCacheDirectory(), BACKUP_STAGING_DIR); in getDataDir()
53 static File getStateDirInSystemDir(int userId) { in getStateDirInSystemDir()
54 return new File(getBaseStateDir(UserHandle.USER_SYSTEM), "" + userId); in getStateDirInSystemDir()
[all …]
DUserBackupManagerFilePersistedSettings.java24 import java.io.File;
43 private static boolean readBackupEnableState(File baseDir) { in readBackupEnableState()
44 File enableFile = new File(baseDir, BACKUP_ENABLE_FILE); in readBackupEnableState()
61 private static void writeBackupEnableState(File baseDir, boolean enable) { in writeBackupEnableState()
62 File enableFile = new File(baseDir, BACKUP_ENABLE_FILE); in writeBackupEnableState()
63 File stage = new File(baseDir, BACKUP_ENABLE_FILE + "-stage"); in writeBackupEnableState()
/frameworks/opt/gamesdk/src/tuningfork/tools/validation/src/main/java/com/google/tuningfork/validation/
DExternalProtoCompiler.java27 import java.io.File;
38 public ExternalProtoCompiler(File protoBinary) { in ExternalProtoCompiler()
43 public FileDescriptor compile(File file, Optional<File> outFile) in compile()
63 private FileDescriptor buildAndRunCompilerProcess(File file, Optional<File> outFile) in buildAndRunCompilerProcess()
86 public File encodeFromTextprotoFile( in encodeFromTextprotoFile()
88 File protoFile, in encodeFromTextprotoFile()
89 File textprotoFile, in encodeFromTextprotoFile()
91 Optional<File> errorFile) in encodeFromTextprotoFile()
95 File binFile = new File(binaryPath); in encodeFromTextprotoFile()
109 public File decodeToTextprotoFile( in decodeToTextprotoFile()
[all …]
DDeveloperTuningforkParser.java28 import java.io.File;
36 private Optional<File> devTuningforkProto = Optional.empty();
38 private ImmutableList<File> devFidelityFiles;
42 private final File folder;
46 public DeveloperTuningforkParser(ErrorCollector errors, File folder, File protocBinary) { in DeveloperTuningforkParser()
65 File descriptorFile = new File(folder, FolderConfig.DEV_TUNINGFORK_DESCRIPTOR); in validate()
111 File outFile = new File(folder, FolderConfig.TUNINGFORK_SETTINGS_BINARY); in saveBinarySettings()
141 private void encodeBinaryAndValidateDevFidelity(Descriptor fidelityField, File textprotoFile) { in encodeBinaryAndValidateDevFidelity()
142 File binaryFile; in encodeBinaryAndValidateDevFidelity()
171 private static String getBinaryPathForTextprotoPath(File textprotoFile) { in getBinaryPathForTextprotoPath()
[all …]
/frameworks/base/core/tests/coretests/src/android/view/textclassifier/
DModelFileManagerTest.java36 import java.io.File;
53 private File mRootTestDir;
54 private File mFactoryModelDir;
55 private File mUpdatedModelFile;
62 mFactoryModelDir = new File(mRootTestDir, "factory"); in setup()
63 mUpdatedModelFile = new File(mRootTestDir, "updated.model"); in setup()
89 new File("/path/a"), 1, Collections.emptyList(), "", true); in get()
102 new File("/path/a"), 1, in findBestModel_versionCode()
107 new File("/path/b"), 2, in findBestModel_versionCode()
123 new File("/path/a"), 1, in findBestModel_languageDependentModelIsPreferred()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/
DLockSettingsStorageTestable.java23 import java.io.File;
27 public File mStorageDir;
30 public LockSettingsStorageTestable(Context context, File storageDir) { in LockSettingsStorageTestable()
54 protected File getSyntheticPasswordDirectoryForUser(int userId) { in getSyntheticPasswordDirectoryForUser()
64 private File makeDirs(File baseDir, String filePath) { in makeDirs()
65 File path = new File(filePath); in makeDirs()
67 return new File(baseDir, filePath); in makeDirs()
69 File mappedDir = new File(baseDir, path.getParent()); in makeDirs()
71 return new File(mappedDir, path.getName()); in makeDirs()
/frameworks/multidex/library/src/androidx/multidex/
DMultiDex.java28 import java.io.File;
76 private static final Set<File> installedApk = new HashSet<File>();
114 new File(applicationInfo.sourceDir), in install()
115 new File(applicationInfo.dataDir), in install()
169 File dataDir = new File(applicationInfo.dataDir); in installInstrumentation()
172 new File(instrumentationInfo.sourceDir), in installInstrumentation()
179 new File(applicationInfo.sourceDir), in installInstrumentation()
201 private static void doInstallation(Context mainContext, File sourceApk, File dataDir, in doInstallation()
237 File dexDir = getDexDir(mainContext, dataDir, secondaryFolderName); in doInstallation()
244 List<? extends File> files = in doInstallation()
[all …]
/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/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 …]
/frameworks/base/core/tests/coretests/src/android/os/
DFileUtilsTest.java69 import java.io.File;
81 private File mDir;
82 private File mTestFile;
83 private File mCopyFile;
84 private File mTarget;
95 mTestFile = new File(mDir, "test.file"); in setUp()
96 mCopyFile = new File(mDir, "copy.file"); in setUp()
131 final File src = new File(mTarget, "src"); in testCopy_FileToFile()
132 final File dest = new File(mTarget, "dest"); in testCopy_FileToFile()
152 final File src = new File(mTarget, "src"); in testCopy_FileToPipe()
[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/base/packages/LocalTransport/src/com/android/localtransport/
DLocalTransport.java40 import java.io.File;
77 private File mDataDir;
78 private File mCurrentSetDir;
79 private File mCurrentSetIncrementalDir;
80 private File mCurrentSetFullDir;
85 private File mRestoreSetDir;
86 private File mRestoreSetIncrementalDir;
87 private File mRestoreSetFullDir;
103 mCurrentSetDir = new File(mDataDir, Long.toString(CURRENT_SET_TOKEN)); in makeDataDirs()
104 mCurrentSetIncrementalDir = new File(mCurrentSetDir, INCREMENTAL_DIR); in makeDataDirs()
[all …]
/frameworks/base/packages/WallpaperBackup/src/com/android/wallpaperbackup/
DWallpaperBackupAgent.java46 import java.io.File;
76 private File mWallpaperInfo; // wallpaper metadata file
77 private File mWallpaperFile; // primary wallpaper image file
78 private File mLockWallpaperFile; // lock wallpaper image file
81 private File mQuotaFile;
92 File wallpaperDir = Environment.getUserSystemDirectory(UserHandle.USER_SYSTEM); in onCreate()
93 mWallpaperInfo = new File(wallpaperDir, WALLPAPER_INFO); in onCreate()
94 mWallpaperFile = new File(wallpaperDir, WALLPAPER); in onCreate()
95 mLockWallpaperFile = new File(wallpaperDir, WALLPAPER_LOCK); in onCreate()
98 mQuotaFile = new File(getFilesDir(), QUOTA_SENTINEL); in onCreate()
[all …]
/frameworks/opt/gamesdk/src/tuningfork/tools/validation/src/test/java/com/google/tuningfork/validation/
DDeveloperTuningforkParserTest.java30 import java.io.File;
48 public File newFile(String filename) {
49 return new File(getRoot(), filename);
76 private static final File PROTOC_BINARY =
99 File settingsFile = new File(tempFolder.getRoot(), "tuningfork_settings.bin"); in checkSettings()
110 File file1 = new File(tempFolder.getRoot(), "dev_tuningfork_fidelityparams_1.bin"); in checkFidelityParametersFiles()
111 File file2 = new File(tempFolder.getRoot(), "dev_tuningfork_fidelityparams_2.bin"); in checkFidelityParametersFiles()
112 File file3 = new File(tempFolder.getRoot(), "dev_tuningfork_fidelityparams_3.bin"); in checkFidelityParametersFiles()
113 File file4 = new File(tempFolder.getRoot(), "dev_tuningfork_fidelityparams_4.bin"); in checkFidelityParametersFiles()
124 File devFidelityFile = new File(tempFolder.getRoot(), "dev_tuningfork_fidelityparams_1.bin"); in checkFidelityParameters()
/frameworks/base/core/tests/hosttests/test-apps/MultiDexLegacyTestServicesTests2/src/com/android/framework/multidexlegacytestservices/test2/
DServicesTests.java33 import java.io.File;
60 public boolean accept(File file) { in accept()
71 public boolean accept(File file) { in accept()
84 private File targetFilesDir;
91 File applicationDataDir = in setup()
92 new File(InstrumentationRegistry.getTargetContext().getApplicationInfo().dataDir); in setup()
195 private static void clearDirContent(File dir) { in clearDirContent()
196 for (File subElement : dir.listFiles()) { in clearDirContent()
225 File resultFile = new File(targetFilesDir, "Service" + i); in initServicesWorkFiles()
230 File completeFile = new File(targetFilesDir, "Service" + i + ".complete"); in initServicesWorkFiles()
[all …]
/frameworks/base/packages/PackageInstaller/src/com/android/packageinstaller/
DTemporaryFileManager.java26 import java.io.File;
43 public static File getStagedFile(@NonNull Context context) throws IOException { in getStagedFile()
44 return File.createTempFile("package", ".apk", context.getNoBackupFilesDir()); in getStagedFile()
55 public static File getInstallStateFile(@NonNull Context context) { in getInstallStateFile()
56 return new File(context.getNoBackupFilesDir(), "install_results.xml"); in getInstallStateFile()
67 public static File getUninstallStateFile(@NonNull Context context) { in getUninstallStateFile()
68 return new File(context.getNoBackupFilesDir(), "uninstall_results.xml"); in getUninstallStateFile()
75 File[] filesOnBoot = context.getNoBackupFilesDir().listFiles(); in onReceive()
82 File fileOnBoot = filesOnBoot[i]; in onReceive()
/frameworks/base/services/core/java/com/android/server/updates/
DCertificateTransparencyLogInstallReceiver.java25 import java.io.File;
66 File currentSymlink = new File(updateDir, "current"); in install()
67 File newVersion = new File(updateDir, LOGDIR_PREFIX + String.valueOf(version)); in install()
68 File oldDirectory; in install()
107 File tempSymlink = new File(updateDir, "new_symlink"); in install()
127 private void installLog(File directory, JSONObject logObject) throws IOException { in installLog()
130 File file = new File(directory, logFilename); in installLog()
170 File currentTarget = new File(updateDir, "current").getCanonicalFile(); in deleteOldLogDirectories()
173 public boolean accept(File file) { in deleteOldLogDirectories()
177 for (File f : updateDir.listFiles(filter)) { in deleteOldLogDirectories()
/frameworks/base/services/tests/servicestests/src/com/android/server/
DMountServiceTests.java32 import java.io.File;
103 private File getFilePath(String name) { in getFilePath()
104 final File filesDir = mContext.getFilesDir(); in getFilePath()
105 final File outFile = new File(filesDir, name); in getFilePath()
109 private void copyRawToFile(int rawResId, File outFile) { in copyRawToFile()
128 private void mountObb(StorageManager sm, final int resource, final File file, in mountObb()
150 final File file) { in mountObbWithoutWait()
160 private void waitForObbActionCompletion(final StorageManager sm, final File file, in waitForObbActionCompletion()
174 private String checkMountedPath(final StorageManager sm, final File file) { in checkMountedPath()
182 private void unmountObb(final StorageManager sm, final File file, int expectedState) { in unmountObb()
[all …]
/frameworks/base/media/tests/MtpTests/src/android/mtp/
DMtpStorageManagerTest.java35 import java.io.File;
52 private static final File TEMP_DIR_FILE = new File(TEMP_DIR);
60 private File mainStorageDir;
61 private File secondaryStorageDir;
79 private static void vWriteNewFile(File newFile) { in vWriteNewFile()
87 private static File createNewFile(File parent) { in createNewFile()
91 private static File createNewFileNonZero(File parent) { in createNewFileNonZero()
95 private static File createNewFile(File parent, String name) { in createNewFile()
99 private static File createNewFileNonZero(File parent, String name) { in createNewFileNonZero()
103 private static File createNewFile(File parent, String name, boolean fgNonZero) { in createNewFile()
[all …]

12345678910>>...32