StoragePathProvider { public String getDirPath(StorageSubdirectory subdirectory) { return storageStateProvider.isScopedStorageUsed() ? getScopedStorageDirPath(subdirectory) : getUnscopedStorageDirPath(subdirectory); } StoragePathProvider();  StoragePathProvider(StorageStateProvider storageStateProvider); String[] getOdkDirPaths(); String getScopedStorageRootDirPath(); String getUnscopedStorageRootDirPath(); String getUnscopedStorageDirPath(StorageSubdirectory subdirectory); String getDirPath(StorageSubdirectory subdirectory); String getStorageRootDirPath(); String getTmpFilePath(); String getTmpDrawFilePath(); String getInstanceDbPath(String filePath); String getAbsoluteInstanceFilePath(String filePath); String getFormDbPath(String filePath); String getAbsoluteFormFilePath(String filePath); String getCacheDbPath(String filePath); String getAbsoluteCacheFilePath(String filePath); String getRelativeFilePath(String dirPath, String filePath); @SuppressWarnings("PMD.DoNotHardCodeSDCard") String getRelativeMapLayerPath(String path); String getAbsoluteOfflineMapLayerPath(String path);  }
@Test public void getFormsDirWithUnscopedStorageTest() { mockUsingUnscopedStorage(); assertThat(storagePathProvider.getDirPath(StorageSubdirectory.FORMS), is("/storage/emulated/0/odk/forms")); }
@Test public void getFormsDirWithScopedStorageTest() { mockUsingScopedStorage(); assertThat(storagePathProvider.getDirPath(StorageSubdirectory.FORMS), is("/storage/emulated/0/Android/data/org.odk.collect.android/files/forms")); }
@Test public void getInstancesDirWithUnscopedStorageTest() { mockUsingUnscopedStorage(); assertThat(storagePathProvider.getDirPath(StorageSubdirectory.INSTANCES), is("/storage/emulated/0/odk/instances")); }
@Test public void getInstancesDirWithScopedStorageTest() { mockUsingScopedStorage(); assertThat(storagePathProvider.getDirPath(StorageSubdirectory.INSTANCES), is("/storage/emulated/0/Android/data/org.odk.collect.android/files/instances")); }
@Test public void getMetadataDirWithUnscopedStorageTest() { mockUsingUnscopedStorage(); assertThat(storagePathProvider.getDirPath(StorageSubdirectory.METADATA), is("/storage/emulated/0/odk/metadata")); }
@Test public void getMetadataDirWithScopedStorageTest() { mockUsingScopedStorage(); assertThat(storagePathProvider.getDirPath(StorageSubdirectory.METADATA), is("/storage/emulated/0/Android/data/org.odk.collect.android/files/metadata")); }
@Test public void getCacheDirWithUnscopedStorageTest() { mockUsingUnscopedStorage(); assertThat(storagePathProvider.getDirPath(StorageSubdirectory.CACHE), is("/storage/emulated/0/odk/.cache")); }
@Test public void getCacheDirWithScopedStorageTest() { mockUsingScopedStorage(); assertThat(storagePathProvider.getDirPath(StorageSubdirectory.CACHE), is("/storage/emulated/0/Android/data/org.odk.collect.android/files/.cache")); }
@Test public void getLayersDirWithUnscopedStorageTest() { mockUsingUnscopedStorage(); assertThat(storagePathProvider.getDirPath(StorageSubdirectory.LAYERS), is("/storage/emulated/0/odk/layers")); }
@Test public void getLayersDirWithScopedStorageTest() { mockUsingScopedStorage(); assertThat(storagePathProvider.getDirPath(StorageSubdirectory.LAYERS), is("/storage/emulated/0/Android/data/org.odk.collect.android/files/layers")); }
@Test public void getSettingsDirWithUnscopedStorageTest() { mockUsingUnscopedStorage(); assertThat(storagePathProvider.getDirPath(StorageSubdirectory.SETTINGS), is("/storage/emulated/0/odk/settings")); }
@Test public void getSettingsDirWithScopedStorageTest() { mockUsingScopedStorage(); assertThat(storagePathProvider.getDirPath(StorageSubdirectory.SETTINGS), is("/storage/emulated/0/Android/data/org.odk.collect.android/files/settings")); }