Merge "Remove DocumentsContract.ACTION_BROWSE."

This commit is contained in:
Garfield Tan
2017-03-02 00:35:54 +00:00
committed by Android (Google) Code Review
3 changed files with 18 additions and 9 deletions

View File

@@ -68,8 +68,10 @@ public class MusicViewHolderController implements FileViewHolderController {
@Override
public void onClick(Fragment fragment) {
Intent intent = new Intent(DocumentsContract.ACTION_BROWSE);
intent.setData(DocumentsContract.buildRootUri(AUTHORITY_MEDIA, "audio_root"));
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(
DocumentsContract.buildRootUri(AUTHORITY_MEDIA, "audio_root"),
DocumentsContract.Root.MIME_TYPE_ITEM);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.putExtra(Intent.EXTRA_USER_ID, mUser);
Utils.launchIntent(fragment, intent);

View File

@@ -483,20 +483,26 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
} break;
case R.string.storage_detail_images: {
intent = new Intent(DocumentsContract.ACTION_BROWSE);
intent.setData(DocumentsContract.buildRootUri(AUTHORITY_MEDIA, "images_root"));
intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(
DocumentsContract.buildRootUri(AUTHORITY_MEDIA, "images_root"),
DocumentsContract.Root.MIME_TYPE_ITEM);
intent.addCategory(Intent.CATEGORY_DEFAULT);
} break;
case R.string.storage_detail_videos: {
intent = new Intent(DocumentsContract.ACTION_BROWSE);
intent.setData(DocumentsContract.buildRootUri(AUTHORITY_MEDIA, "videos_root"));
intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(
DocumentsContract.buildRootUri(AUTHORITY_MEDIA, "videos_root"),
DocumentsContract.Root.MIME_TYPE_ITEM);
intent.addCategory(Intent.CATEGORY_DEFAULT);
} break;
case R.string.storage_detail_audio: {
intent = new Intent(DocumentsContract.ACTION_BROWSE);
intent.setData(DocumentsContract.buildRootUri(AUTHORITY_MEDIA, "audio_root"));
intent = new Intent(DocumentsContract.Root.MIME_TYPE_ITEM);
intent.setDataAndType(
DocumentsContract.buildRootUri(AUTHORITY_MEDIA, "audio_root"),
DocumentsContract.Root.MIME_TYPE_ITEM);
intent.addCategory(Intent.CATEGORY_DEFAULT);
} break;