title: ContentResolver invalid column error on Android Q (SDK 29)
body: <p>Our Android application relies heavily on queries on the ContentResolver to get and manage photos and videos stored on the device. We are aware of the obvious changes in Android Q regarding the DATA fields and the scoped storage. However, we experience some weird issues on our Pixel 2 for queries, that use more complex expressions in the SQL projection. For example we do something like this:</p>
  
  <pre><code>final String[] projection = {MediaStore.MediaColumns._ID,
                                       MediaStore.MediaColumns.DATA,
                                       MediaStore.MediaColumns.MIME_TYPE,
                                       getDateColumn(target, sortMode),
                                       MediaStore.MediaColumns.TITLE,
                                       "rtrim(" + MediaStore.MediaColumns.DATA + ", replace(" +
                                       MediaStore.MediaColumns.DATA + ", '/', '')) as " + COLUMN_DIRECTORY,
                                       "substr(" + MediaStore.MediaColumns.DATA + ", " + "length(rtrim(" +
                                       MediaStore.MediaColumns.DATA + ", replace(" + MediaStore.MediaColumns.DATA +
                                       ", '/', '')) )" + ")" + "as " + COLUMN_FILENAME,
                                       MediaStore.MediaColumns.DISPLAY_NAME,
                                       MediaStore.MediaColumns.DATE_ADDED};
  </code></pre>
  
  <p>Which used to work absolutely fine up until now. On the latest Android Q version however, we get the following exception for every query that uses projections that are not the pure column names:</p>
  
  <pre><code>2019-09-26 15:54:56.733 30276-30659/? E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #4
      Process: xxxx, PID: 30276
      java.lang.RuntimeException: An error occurred while executing doInBackground()
          at android.os.AsyncTask$4.done(AsyncTask.java:399)
          at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
          at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
          at java.util.concurrent.FutureTask.run(FutureTask.java:271)
          at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
          at java.lang.Thread.run(Thread.java:919)
       Caused by: java.lang.IllegalArgumentException: Invalid column rtrim(_data, replace(_data, '/', '')) as directory
          at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:170)
          at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140)
          at android.content.ContentProviderProxy.query(ContentProviderNative.java:423)
          at android.content.ContentResolver.query(ContentResolver.java:944)
          at android.content.ContentResolver.query(ContentResolver.java:880)
          at android.content.ContentResolver.query(ContentResolver.java:836)
          ...
  </code></pre>
  
  <p>Are these kind of projections forbidden now? Or are we missing something?
  Thanks in advance!</p>