Loading src/com/android/documentsui/sorting/SortModel.java +12 −0 Original line number Diff line number Diff line Loading @@ -17,9 +17,12 @@ package com.android.documentsui.sorting; import static com.android.documentsui.base.Shared.DEBUG; import static com.android.documentsui.base.Shared.ENABLE_OMC_API_FEATURES; import static com.android.documentsui.base.Shared.VERBOSE; import android.annotation.IntDef; import android.annotation.Nullable; import android.content.ContentResolver; import android.database.Cursor; import android.os.Parcel; import android.os.Parcelable; Loading Loading @@ -220,6 +223,15 @@ public class SortModel implements Parcelable { } public Cursor sortCursor(Cursor cursor) { if (ENABLE_OMC_API_FEATURES && cursor.getExtras().containsKey(ContentResolver.QUERY_ARG_SORT_COLUMNS)) { if (VERBOSE) Log.i(TAG, "Cursor is pre-sorted by provider. Skipping sort. Booya!"); // TODO: assert that the contents of QUERY_ARG_SORT_COLUMNS // matches the sort dimension...once we're returning any pre-sorted results. return cursor; } if (mSortedDimension != null) { return new SortingCursorWrapper(cursor, mSortedDimension); } else { Loading Loading
src/com/android/documentsui/sorting/SortModel.java +12 −0 Original line number Diff line number Diff line Loading @@ -17,9 +17,12 @@ package com.android.documentsui.sorting; import static com.android.documentsui.base.Shared.DEBUG; import static com.android.documentsui.base.Shared.ENABLE_OMC_API_FEATURES; import static com.android.documentsui.base.Shared.VERBOSE; import android.annotation.IntDef; import android.annotation.Nullable; import android.content.ContentResolver; import android.database.Cursor; import android.os.Parcel; import android.os.Parcelable; Loading Loading @@ -220,6 +223,15 @@ public class SortModel implements Parcelable { } public Cursor sortCursor(Cursor cursor) { if (ENABLE_OMC_API_FEATURES && cursor.getExtras().containsKey(ContentResolver.QUERY_ARG_SORT_COLUMNS)) { if (VERBOSE) Log.i(TAG, "Cursor is pre-sorted by provider. Skipping sort. Booya!"); // TODO: assert that the contents of QUERY_ARG_SORT_COLUMNS // matches the sort dimension...once we're returning any pre-sorted results. return cursor; } if (mSortedDimension != null) { return new SortingCursorWrapper(cursor, mSortedDimension); } else { Loading