Example usage for android.os.storage VolumeInfo getDescription

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

Introduction

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

Prototype

@UnsupportedAppUsage
    public @Nullable String getDescription() 

Source Link

Usage

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

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

    mFormatAsPublicDiskId = diskId;/*from   w w w  . j a va  2s .co  m*/
    if (!TextUtils.isEmpty(volumeId)) {
        final VolumeInfo info = mStorageManager.findVolumeById(volumeId);
        if (info != null) {
            mFormatDiskDesc = mStorageManager.getBestVolumeDescription(info);
        }
    }
    if (TextUtils.isEmpty(mFormatDiskDesc)) {
        final DiskInfo info = mStorageManager.findDiskById(diskId);
        if (info != null) {
            mFormatDiskDesc = info.getDescription();
        }
    }
    SettingsStorageService.formatAsPublic(this, diskId);
}