Merge "Shows "This device" for default internal storage" into sc-dev am: 8b5913ba18 am: e7e25f12f1

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14609996

Change-Id: I493ded0f0cfd753f9072d8095231bbebe9b3fdda
This commit is contained in:
Arc Wang
2021-05-21 06:50:27 +00:00
committed by Automerger Merge Worker
2 changed files with 24 additions and 2 deletions

View File

@@ -26,6 +26,8 @@ import android.os.storage.VolumeInfo;
import android.os.storage.VolumeRecord;
import android.text.TextUtils;
import com.android.settings.R;
import java.io.File;
/**
@@ -44,8 +46,15 @@ public class StorageEntry implements Comparable<StorageEntry>, Parcelable {
mVolumeInfo = volumeInfo;
mUnsupportedDiskInfo = null;
mMissingVolumeRecord = null;
mVolumeInfoDescription = context.getSystemService(StorageManager.class)
.getBestVolumeDescription(mVolumeInfo);
if (isDefaultInternalStorage()) {
// Shows "This device" for default internal storage.
mVolumeInfoDescription = context.getResources()
.getString(R.string.storage_default_internal_storage);
} else {
mVolumeInfoDescription = context.getSystemService(StorageManager.class)
.getBestVolumeDescription(mVolumeInfo);
}
}
public StorageEntry(@NonNull DiskInfo diskInfo) {