Remove unused class FixedStorageProviderBase
@@ -156,91 +156,6 @@ public class StorageManager {
void onUnmount(String providerId);
}
- /**
- * Base provider class for providers that rely on well-known path to check
- * for storage availability.
- *
- * <p>
- * Since solely checking for paths can be unsafe, this class allows to check
- * for device compatibility using {@link #supportsVendor()}. If the vendor
- * specific check fails, the provider won't be able to provide any valid
- * File handle, regardless of the path existence.
- * </p>
- *
- * <p>
- * Moreover, this class validates the denoted storage path against mount
- * points using {@link StorageManager#isMountPoint(File)}.
- * </p>
- */
- public abstract static class FixedStorageProviderBase implements StorageProvider {
- /**
- * The root of the denoted storage. Used for mount points checking.
- */
- private File mRoot;
-
- /**
- * Chosen base directory
- */
- private File mApplicationDir;
-
- @Override
- public void init(final Context context) {
- mRoot = computeRoot(context);
- // use <STORAGE_ROOT>/k9
- mApplicationDir = new File(mRoot, "k9");
- }
-
- /**
- * Vendor specific checks
- *
- * @return Whether this provider supports the underlying vendor specific
- * storage
- */
- protected abstract boolean supportsVendor();
-
- @Override
- public boolean isReady(Context context) {
- try {
- final File root = mRoot.getCanonicalFile();
- return isMountPoint(root)
- && Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState());
- } catch (IOException e) {
- Timber.w(e, "Specified root isn't ready: %s", mRoot);
- return false;
- }
- }
-
- @Override
- public final boolean isSupported(Context context) {
- return mRoot.isDirectory() && supportsVendor();
- }
-
- @Override
- public File getDatabase(Context context, String id) {
- return new File(mApplicationDir, id + ".db");
- }
-
- @Override
- public File getAttachmentDirectory(Context context, String id) {
- return new File(mApplicationDir, id + ".db_att");
- }
-
- @Override
- public final File getRoot(Context context) {
- return mRoot;
- }
-
- /**
- * Retrieve the well-known storage root directory from the actual
- * implementation.
- *
- * @param context
- * Never <code>null</code>.
- * @return Never <code>null</code>.
- */
- protected abstract File computeRoot(Context context);
- }
-
/**
* Strategy to access the always available internal storage.
*
