Add a music apps view to the Storage Settings.

When you tap the Music & Audio preference, it takes you a
hybridized applications view. In this view, there also is
a line item which defines the amount of storage used by
audio files on the device. Using the new storage query, we
can add this information very quickly to the view.

Bug: 33199077
Test: Settings robo tests
Change-Id: If51cba0b3de20805543a39049367eb13613081e7
This commit is contained in:
Daniel Nishi
2017-01-19 14:03:57 -08:00
parent a40d72b9e9
commit 31027dae93
11 changed files with 424 additions and 51 deletions

View File

@@ -533,7 +533,7 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
if (intent != null) {
intent.putExtra(Intent.EXTRA_USER_ID, userId);
launchIntent(this, intent);
Utils.launchIntent(this, intent);
return true;
}
return super.onPreferenceTreeClick(pref);
@@ -670,20 +670,6 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
return total;
}
private static void launchIntent(Fragment fragment, Intent intent) {
try {
final int userId = intent.getIntExtra(Intent.EXTRA_USER_ID, -1);
if (userId == -1) {
fragment.startActivity(intent);
} else {
fragment.getActivity().startActivityAsUser(intent, new UserHandle(userId));
}
} catch (ActivityNotFoundException e) {
Log.w(TAG, "No activity found for " + intent);
}
}
private final StorageEventListener mStorageListener = new StorageEventListener() {
@Override
public void onVolumeStateChanged(VolumeInfo vol, int oldState, int newState) {
@@ -815,7 +801,7 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
launchIntent(OtherInfoFragment.this, intent);
Utils.launchIntent(OtherInfoFragment.this, intent);
}
});
builder.setNegativeButton(android.R.string.cancel, null);