/frameworks/base/core/java/android/os/ |
D | Environment.java | 36 import java.io.File; 72 private static final File DIR_ANDROID_ROOT = getDirectory(ENV_ANDROID_ROOT, "/system"); 73 private static final File DIR_ANDROID_DATA = getDirectory(ENV_ANDROID_DATA, "/data"); 74 private static final File DIR_ANDROID_EXPAND = getDirectory(ENV_ANDROID_EXPAND, "/mnt/expand"); 75 private static final File DIR_ANDROID_STORAGE = getDirectory(ENV_ANDROID_STORAGE, "/storage"); 76 private static final File DIR_DOWNLOAD_CACHE = getDirectory(ENV_DOWNLOAD_CACHE, "/cache"); 77 private static final File DIR_OEM_ROOT = getDirectory(ENV_OEM_ROOT, "/oem"); 78 private static final File DIR_ODM_ROOT = getDirectory(ENV_ODM_ROOT, "/odm"); 79 private static final File DIR_VENDOR_ROOT = getDirectory(ENV_VENDOR_ROOT, "/vendor"); 80 private static final File DIR_PRODUCT_ROOT = getDirectory(ENV_PRODUCT_ROOT, "/product"); [all …]
|
D | FileUtils.java | 63 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/ |
D | LicenseHtmlLoaderCompatTest.java | 35 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/ |
D | TaskSnapshotPersisterLoaderTest.java | 42 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/ |
D | LicenseHtmlLoaderCompat.java | 25 import java.io.File; 32 public class LicenseHtmlLoaderCompat extends AsyncLoaderCompat<File> { 55 public File loadInBackground() { in loadInBackground() 60 protected void onDiscardResult(File f) { in onDiscardResult() 63 private File generateHtmlFromDefaultXmlFiles() { in generateHtmlFromDefaultXmlFiles() 64 final List<File> xmlFiles = getVaildXmlFiles(); in generateHtmlFromDefaultXmlFiles() 70 File cachedHtmlFile = getCachedHtmlFile(mContext); in generateHtmlFromDefaultXmlFiles() 79 private List<File> getVaildXmlFiles() { in getVaildXmlFiles() 80 final List<File> xmlFiles = new ArrayList(); in getVaildXmlFiles() 82 File file = new File(xmlPath); in getVaildXmlFiles() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/ |
D | UserDataPreparerTest.java | 42 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/core/tests/coretests/src/android/view/textclassifier/ |
D | ModelFileManagerTest.java | 36 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/backup/java/com/android/server/backup/ |
D | UserBackupManagerFiles.java | 22 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 …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/ |
D | LockSettingsStorageTestable.java | 23 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/ |
D | MultiDex.java | 28 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/java/com/android/internal/util/ |
D | FileRotator.java | 24 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/ |
D | FileUtilsTest.java | 69 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/LocalTransport/src/com/android/localtransport/ |
D | LocalTransport.java | 40 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/ |
D | WallpaperBackupAgent.java | 46 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/base/core/tests/hosttests/test-apps/MultiDexLegacyTestServicesTests/src/com/android/framework/multidexlegacytestservices/test/ |
D | ServicesTests.java | 23 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/tests/hosttests/test-apps/MultiDexLegacyTestServicesTests2/src/com/android/framework/multidexlegacytestservices/test2/ |
D | ServicesTests.java | 33 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/services/core/java/com/android/server/power/ |
D | PreRebootLogger.java | 33 import java.io.File; 59 static void log(Context context, @NonNull File dumpDir) { in log() 70 private static void dump(@NonNull File dumpDir) { in dump() 81 private static void wipe(@NonNull File dumpDir) { in wipe() 83 for (File file : dumpDir.listFiles()) { in wipe() 89 private static File getDumpDir() { in getDumpDir() 90 final File dumpDir = new File(Environment.getDataMiscDirectory(), PREREBOOT_DIR); in getDumpDir() 98 private static void dumpLogsLocked(@NonNull File dumpDir, @NonNull String buffer) { in dumpLogsLocked() 100 final File dumpFile = new File(dumpDir, buffer); in dumpLogsLocked() 117 private static void dumpServiceLocked(@NonNull File dumpDir, @NonNull String serviceName) { in dumpServiceLocked() [all …]
|
/frameworks/base/packages/SharedStorageBackup/src/com/android/sharedstoragebackup/ |
D | ObbBackupService.java | 30 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/media/tests/MtpTests/src/android/mtp/ |
D | MtpStorageManagerTest.java | 35 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 …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/ |
D | MountServiceTests.java | 32 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 …]
|
D | DropBoxTest.java | 37 import java.io.File; 82 File dir = getEmptyDir("testAddText"); in testAddText() 119 File dir = getEmptyDir("testAddData"); 146 File dir = getEmptyDir("testAddFile"); 149 File clientDir = getEmptyDir("testAddFile_client"); 151 File f0 = new File(clientDir, "f0.txt"); 152 File f1 = new File(clientDir, "f1.txt.gz"); 153 File f2 = new File(clientDir, "f2.dat"); 154 File f3 = new File(clientDir, "f2.dat.gz"); 216 File dir = getEmptyDir("testAddEntriesInTheFuture"); in testAddEntriesInTheFuture() [all …]
|
/frameworks/base/services/core/java/com/android/server/updates/ |
D | CertificateTransparencyLogInstallReceiver.java | 25 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/core/java/com/android/server/pm/ |
D | PackageAbiHelperImpl.java | 47 import java.io.File; 54 final File codePath = new File(codePathString); in calculateBundledApkRoot() 55 final File codeRoot; in calculateBundledApkRoot() 72 String[] parts = fullPath.split(File.separator); in calculateBundledApkRoot() 74 codeRoot = new File(parts[1] + File.separator + parts[2]); in calculateBundledApkRoot() 83 File f = codePath.getCanonicalFile(); in calculateBundledApkRoot() 84 File parent = f.getParentFile(); // non-null because codePath is a file in calculateBundledApkRoot() 85 File tmp; in calculateBundledApkRoot() 109 final File codeFile = new File(codePath); in deriveCodePathName() 134 PackageParser.Package pkg, File appLib32InstallDir) { in getNativeLibraryPaths() [all …]
|
/frameworks/base/services/robotests/backup/src/com/android/server/backup/fullbackup/ |
D | AppMetadataBackupWriterTest.java | 46 import java.io.File; 69 private File mFilesDir; 70 private File mBackupDataOutputFile; 82 mBackupDataOutputFile = new File(mFilesDir, "output"); in setUp() 115 File manifestFile = createFile(BACKUP_MANIFEST_FILENAME); in testBackupManifest_withoutApkOrSignatures_writesCorrectData() 150 File manifestFile = createFile(BACKUP_MANIFEST_FILENAME); in testBackupManifest_withApk_writesApk() 186 File manifestFile = createFile(BACKUP_MANIFEST_FILENAME); in testBackupManifest_withSignatures_writesCorrectSignatures() 216 File manifestFile = createFile(BACKUP_MANIFEST_FILENAME); in testBackupManifest_withoutInstallerPackage_writesEmptyInstaller() 232 File manifestFile = createFile(BACKUP_MANIFEST_FILENAME); in testBackupManifest_whenRunPreviouslyWithSameData_producesSameBytesOnSecondRun() 261 File metadataFile = createFile(BACKUP_METADATA_FILENAME); in testBackupWidget_writesCorrectData() [all …]
|
/frameworks/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/ |
D | RenderTestBase.java | 53 import java.io.File; 144 if (platformDir != null && !platformDir.isEmpty() && new File(platformDir).isDirectory()) { in getPlatformDir() 150 platformDir = getPlatformDirFromHostOut(new File(androidHostOut)); in getPlatformDir() 156 File workingDir = new File(workingDirString); in getPlatformDir() 164 File currentDir = workingDir; in getPlatformDir() 190 private static String getPlatformDirFromRoot(File root) { in getPlatformDirFromRoot() 194 File out = new File(root, "out"); in getPlatformDirFromRoot() 198 File host = new File(out, "host"); in getPlatformDirFromRoot() 202 File[] hosts = host.listFiles(path -> path.isDirectory() && in getPlatformDirFromRoot() 206 for (File hostOut : hosts) { in getPlatformDirFromRoot() [all …]
|