content: package com.alexvt.whisperinput.speak.provider;
  
  import android.content.ContentProvider;
  import android.content.ContentValues;
  import android.database.Cursor;
  import android.net.Uri;
  import android.os.ParcelFileDescriptor;
  
  import java.io.File;
  import java.io.FileNotFoundException;
  import java.io.IOException;
  
  public class FileContentProvider extends ContentProvider {
  
      public static final String AUTHORITY = "com.alexvt.whisperinput.speak.provider.FileContentProvider";
  
      @Override
      public boolean onCreate() {
          return false;
      }
  
      @Override
      public Cursor query(Uri uri, String[] strings, String s, String[] strings2, String s2) {
          return null;
      }
  
      @Override
      public String getType(Uri uri) {
          return null;
      }
  
      @Override
      public Uri insert(Uri uri, ContentValues contentValues) {
          return null;
      }
  
      @Override
      public int delete(Uri uri, String s, String[] strings) {
          return 0;
      }
  
      @Override
      public int update(Uri uri, ContentValues contentValues, String s, String[] strings) {
          return 0;
      }
  
      public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
          File dir = getContext().getFilesDir();
          File file = new File(dir, uri.getLastPathSegment());
          try {
              if (!file.getCanonicalPath().startsWith(dir.getCanonicalPath())) {
                  throw new IllegalArgumentException();
              }
          } catch (IOException e) {
              throw new IllegalArgumentException();
          }
          return ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
      }
  
  }