Example usage for android.os.storage DiskInfo getDescription

List of usage examples for android.os.storage DiskInfo getDescription

Introduction

In this page you can find the example usage for android.os.storage DiskInfo getDescription.

Prototype

@UnsupportedAppUsage
    public @Nullable String getDescription() 

Source Link

Usage

From source file:com.android.tv.settings.device.storage.FormatActivity.java

@Override
public void onRequestFormatAsPrivate(String diskId) {
    final FormattingProgressFragment fragment = FormattingProgressFragment.newInstance();
    getFragmentManager().beginTransaction().replace(android.R.id.content, fragment).commit();

    mFormatAsPrivateDiskId = diskId;/*from w  ww .j  av  a2 s . c om*/
    final List<VolumeInfo> volumes = mStorageManager.getVolumes();
    for (final VolumeInfo volume : volumes) {
        if ((volume.getType() == VolumeInfo.TYPE_PRIVATE || volume.getType() == VolumeInfo.TYPE_PUBLIC)
                && TextUtils.equals(volume.getDiskId(), diskId)) {
            mFormatDiskDesc = mStorageManager.getBestVolumeDescription(volume);
        }
    }
    if (TextUtils.isEmpty(mFormatDiskDesc)) {
        final DiskInfo info = mStorageManager.findDiskById(diskId);
        if (info != null) {
            mFormatDiskDesc = info.getDescription();
        }
    }
    SettingsStorageService.formatAsPrivate(this, diskId);
}