/frameworks/base/core/java/android/os/ |
D | Environment.java | 39 import java.io.File; 80 private static final File DIR_ANDROID_ROOT = getDirectory(ENV_ANDROID_ROOT, "/system"); 81 private static final File DIR_ANDROID_DATA = getDirectory(ENV_ANDROID_DATA, "/data"); 82 private static final File DIR_ANDROID_EXPAND = getDirectory(ENV_ANDROID_EXPAND, "/mnt/expand"); 83 private static final File DIR_ANDROID_STORAGE = getDirectory(ENV_ANDROID_STORAGE, "/storage"); 84 private static final File DIR_DOWNLOAD_CACHE = getDirectory(ENV_DOWNLOAD_CACHE, "/cache"); 85 private static final File DIR_OEM_ROOT = getDirectory(ENV_OEM_ROOT, "/oem"); 86 private static final File DIR_ODM_ROOT = getDirectory(ENV_ODM_ROOT, "/odm"); 87 private static final File DIR_VENDOR_ROOT = getDirectory(ENV_VENDOR_ROOT, "/vendor"); 88 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/services/tests/wmtests/src/com/android/server/wm/ |
D | TaskSnapshotLowResDisabledTest.java | 38 import java.io.File; 71 final File[] files = new File[]{ in testPersistAndLoadSnapshot() 72 new File(FILES_DIR.getPath() + "/snapshots/1.proto"), in testPersistAndLoadSnapshot() 73 new File(FILES_DIR.getPath() + "/snapshots/1.jpg")}; in testPersistAndLoadSnapshot() 74 final File[] nonExistsFiles = new File[]{ in testPersistAndLoadSnapshot() 75 new File(FILES_DIR.getPath() + "/snapshots/1_reduced.jpg")}; in testPersistAndLoadSnapshot() 76 assertTrueForFiles(files, File::exists, " must exist"); in testPersistAndLoadSnapshot() 95 final File[] existsFiles = new File[]{ in testRemoveObsoleteFiles() 96 new File(FILES_DIR.getPath() + "/snapshots/1.proto"), in testRemoveObsoleteFiles() 97 new File(FILES_DIR.getPath() + "/snapshots/1.jpg")}; in testRemoveObsoleteFiles() [all …]
|
D | TaskSnapshotPersisterLoaderTest.java | 50 import java.io.File; 75 final File[] files = new File[]{new File(FILES_DIR.getPath() + "/snapshots/1.proto"), in testPersistAndLoadSnapshot() 76 new File(FILES_DIR.getPath() + "/snapshots/1.jpg"), in testPersistAndLoadSnapshot() 77 new File(FILES_DIR.getPath() + "/snapshots/1_reduced.jpg")}; in testPersistAndLoadSnapshot() 78 assertTrueForFiles(files, File::exists, " must exist"); in testPersistAndLoadSnapshot() 92 assertFalse(new File(FILES_DIR.getPath() + "/snapshots/1.proto").exists()); in testTaskRemovedFromRecents() 93 assertFalse(new File(FILES_DIR.getPath() + "/snapshots/1.jpg").exists()); in testTaskRemovedFromRecents() 94 assertFalse(new File(FILES_DIR.getPath() + "/snapshots/1_reduced.jpg").exists()); in testTaskRemovedFromRecents() 130 final File[] existsFiles = new File[]{ in testPurging() 131 new File(FILES_DIR.getPath() + "/snapshots/3.proto"), in testPurging() [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/packages/SettingsLib/src/com/android/settingslib/license/ |
D | LicenseHtmlLoaderCompat.java | 25 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/ |
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/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/core/java/com/android/server/integrity/ |
D | IntegrityFileManager.java | 39 import java.io.File; 61 private final File mDataDir; 63 private final File mRulesDir; 66 private final File mStagingDir; 87 IntegrityFileManager(RuleParser ruleParser, RuleSerializer ruleSerializer, File dataDir) { in IntegrityFileManager() 92 mRulesDir = new File(dataDir, "integrity_rules"); in IntegrityFileManager() 93 mStagingDir = new File(dataDir, "integrity_staging"); in IntegrityFileManager() 100 File metadataFile = new File(mRulesDir, METADATA_FILE); in IntegrityFileManager() 118 return new File(mRulesDir, RULES_FILE).exists() in initialized() 119 && new File(mRulesDir, METADATA_FILE).exists() in initialized() [all …]
|
/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/android/content/pm/ |
D | PackagePartitions.java | 27 import java.io.File; 96 private static File canonicalize(File path) { in canonicalize() 122 private SystemPartition(@NonNull File folder, @PartitionType int type, in SystemPartition() 145 public SystemPartition(@NonNull File rootFolder, @NonNull SystemPartition partition) { in SystemPartition() 152 public File getFolder() { in getFolder() 158 public File getAppFolder() { in getAppFolder() 164 public File getPrivAppFolder() { in getPrivAppFolder() 170 public File getOverlayFolder() { in getOverlayFolder() 176 return containsFile(new File(path)); in containsPath() 180 public boolean containsFile(@NonNull File file) { in containsFile() [all …]
|
/frameworks/base/core/java/com/android/internal/util/ |
D | FileRotator.java | 24 import java.io.File; 55 private final File mBasePath; 99 public FileRotator(File basePath, String prefix, long rotateAgeMillis, long deleteAgeMillis) { in FileRotator() 115 final File backupFile = new File(mBasePath, name); in FileRotator() 116 final File file = new File( in FileRotator() 125 final File noBackupFile = new File(mBasePath, name); in FileRotator() 126 final File file = new File( in FileRotator() 144 new File(mBasePath, name).delete(); in deleteAll() 161 final File file = new File(mBasePath, name); in dumpAll() 236 final File file = new File(mBasePath, name); in rewriteSingle() [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/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 | 41 import java.io.File; 78 private File mDataDir; 79 private File mCurrentSetDir; 80 protected File mCurrentSetIncrementalDir; 81 private File mCurrentSetFullDir; 86 private File mRestoreSetDir; 87 protected File mRestoreSetIncrementalDir; 88 private File mRestoreSetFullDir; 104 mCurrentSetDir = new File(mDataDir, Long.toString(CURRENT_SET_TOKEN)); in makeDataDirs() 105 mCurrentSetIncrementalDir = new File(mCurrentSetDir, INCREMENTAL_DIR); in makeDataDirs() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/ |
D | LockSettingsStorageTestable.java | 30 import java.io.File; 35 public File mStorageDir; 39 public LockSettingsStorageTestable(Context context, File storageDir) { in LockSettingsStorageTestable() 85 protected File getSyntheticPasswordDirectoryForUser(int userId) { in getSyntheticPasswordDirectoryForUser() 95 private File makeDirs(File baseDir, String filePath) { in makeDirs() 96 File path = new File(filePath); in makeDirs() 98 return new File(baseDir, filePath); in makeDirs() 100 File mappedDir = new File(baseDir, path.getParent()); in makeDirs() 102 return new File(mappedDir, path.getName()); in makeDirs()
|
/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/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 | MtpDatabaseTest.java | 43 import java.io.File; 58 private static final File mBaseDir = InstrumentationRegistry.getContext().getExternalCacheDir(); 67 private static final File mMainStorageDir = new File(MAIN_STORAGE_DIR); 76 private static File createNewDir(File parent, String name) { in createNewDir() 77 File ret = new File(parent, name); in createNewDir() 84 private static void writeNewFile(File newFile) { in writeNewFile() 92 private static void writeNewFileFromByte(File newFile, byte[] byteData) { in writeNewFileFromByte() 156 private File stageFile(int resId, File file) throws IOException { in stageFile() 209 private void testThumbnail(int fileHandle, File imgFile, boolean isGoodThumb) in testThumbnail() 243 File baseDir = new File(baseTestDirStr); in testMtpDatabaseThumbnail() [all …]
|
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/mockingservicestests/src/com/android/server/blob/ |
D | BlobStoreManagerServiceTest.java | 55 import java.io.File; 68 private File mBlobsDir; 94 doReturn(new File[0]).when(mBlobsDir).listFiles(); in setUp() 118 final File sessionFile1 = mock(File.class); in testHandlePackageRemoved() 124 final File sessionFile2 = mock(File.class); in testHandlePackageRemoved() 130 final File sessionFile3 = mock(File.class); in testHandlePackageRemoved() 136 final File sessionFile4 = mock(File.class); in testHandlePackageRemoved() 144 final File blobFile1 = mock(File.class); in testHandlePackageRemoved() 153 final File blobFile2 = mock(File.class); in testHandlePackageRemoved() 162 final File blobFile3 = mock(File.class); in testHandlePackageRemoved() [all …]
|
/frameworks/base/packages/BackupEncryption/src/com/android/server/backup/encryption/chunking/ |
D | ProtoStore.java | 30 import java.io.File; 51 private final File mStoreFolder; 59 new File(context.getFilesDir().getAbsoluteFile(), CHUNK_LISTING_FOLDER)); in createChunkListingStore() 67 new File(context.getFilesDir().getAbsoluteFile(), KEY_VALUE_LISTING_FOLDER)); in createKeyValueListingStore() 76 ProtoStore(Class<T> clazz, File storeFolder) throws IOException { in ProtoStore() 81 private static File ensureDirectoryExistsOrThrow(File directory) throws IOException { in ensureDirectoryExistsOrThrow() 100 File file = getFileForPackage(packageName); in loadProto() 121 File file = getFileForPackage(packageName); in saveProto() 143 File file = getFileForPackage(packageName); in deleteProto() 149 File[] files = mStoreFolder.listFiles(); in deleteAllProtos() [all …]
|
/frameworks/base/core/java/com/android/internal/content/ |
D | FileSystemProvider.java | 55 import java.io.File; 97 private final ArrayMap<File, DirectoryObserver> mObservers = new ArrayMap<>(); 101 protected abstract File getFileForDocId(String docId, boolean visible) in getFileForDocId() 104 protected abstract String getDocIdForFile(File file) throws FileNotFoundException; in getDocIdForFile() 131 final File parent = getFileForDocId(parentDocId).getCanonicalFile(); in isChildDocument() 132 final File doc = getFileForDocId(docId).getCanonicalFile(); in isChildDocument() 143 File file = getFileForDocId(documentId); in getDocumentMetadata() 216 protected final List<String> findDocumentPath(File parent, File doc) in findDocumentPath() 242 final File parent = getFileForDocId(docId); in createDocument() 247 final File file = FileUtils.buildUniqueFile(parent, mimeType, displayName); in createDocument() [all …]
|
/frameworks/base/packages/PackageInstaller/src/com/android/packageinstaller/ |
D | TemporaryFileManager.java | 26 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/pm/ |
D | PackageAbiHelperImpl.java | 48 import java.io.File; 55 final File codePath = new File(codePathString); in calculateBundledApkRoot() 56 final File codeRoot; in calculateBundledApkRoot() 73 String[] parts = fullPath.split(File.separator); in calculateBundledApkRoot() 75 codeRoot = new File(parts[1] + File.separator + parts[2]); in calculateBundledApkRoot() 84 File f = codePath.getCanonicalFile(); in calculateBundledApkRoot() 85 File parent = f.getParentFile(); // non-null because codePath is a file in calculateBundledApkRoot() 86 File tmp; in calculateBundledApkRoot() 110 final File codeFile = new File(codePath); in deriveCodePathName() 135 File appLib32InstallDir) { in getNativeLibraryPaths() [all …]
|