Fix the intent to launch storage details.
Test: Manual tests & robo tests. Bug: 37164357 Change-Id: Ia73a6286edadb9c9e1691dcc0c9e391ce2981dee
This commit is contained in:
@@ -484,28 +484,13 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
|
|||||||
|
|
||||||
} break;
|
} break;
|
||||||
case R.string.storage_detail_images: {
|
case R.string.storage_detail_images: {
|
||||||
intent = new Intent(Intent.ACTION_VIEW);
|
intent = getIntentForStorage(AUTHORITY_MEDIA, "images_root");
|
||||||
intent.setDataAndType(
|
|
||||||
DocumentsContract.buildRootUri(AUTHORITY_MEDIA, "images_root"),
|
|
||||||
DocumentsContract.Root.MIME_TYPE_ITEM);
|
|
||||||
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case R.string.storage_detail_videos: {
|
case R.string.storage_detail_videos: {
|
||||||
intent = new Intent(Intent.ACTION_VIEW);
|
intent = getIntentForStorage(AUTHORITY_MEDIA, "videos_root");
|
||||||
intent.setDataAndType(
|
|
||||||
DocumentsContract.buildRootUri(AUTHORITY_MEDIA, "videos_root"),
|
|
||||||
DocumentsContract.Root.MIME_TYPE_ITEM);
|
|
||||||
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case R.string.storage_detail_audio: {
|
case R.string.storage_detail_audio: {
|
||||||
intent = new Intent(DocumentsContract.Root.MIME_TYPE_ITEM);
|
intent = getIntentForStorage(AUTHORITY_MEDIA, "audio_root");
|
||||||
intent.setDataAndType(
|
|
||||||
DocumentsContract.buildRootUri(AUTHORITY_MEDIA, "audio_root"),
|
|
||||||
DocumentsContract.Root.MIME_TYPE_ITEM);
|
|
||||||
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case R.string.storage_detail_system: {
|
case R.string.storage_detail_system: {
|
||||||
SystemInfoFragment.show(this);
|
SystemInfoFragment.show(this);
|
||||||
@@ -546,6 +531,16 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
|
|||||||
return super.onPreferenceTreeClick(pref);
|
return super.onPreferenceTreeClick(pref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Intent getIntentForStorage(String authority, String root) {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||||
|
intent.setDataAndType(
|
||||||
|
DocumentsContract.buildRootUri(authority, root),
|
||||||
|
DocumentsContract.Root.MIME_TYPE_ITEM);
|
||||||
|
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
||||||
|
|
||||||
|
return intent;
|
||||||
|
}
|
||||||
|
|
||||||
private final MeasurementReceiver mReceiver = new MeasurementReceiver() {
|
private final MeasurementReceiver mReceiver = new MeasurementReceiver() {
|
||||||
@Override
|
@Override
|
||||||
public void onDetailsChanged(MeasurementDetails details) {
|
public void onDetailsChanged(MeasurementDetails details) {
|
||||||
|
Reference in New Issue
Block a user