summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/ApplicationPackageManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/app/ApplicationPackageManager.java')
-rw-r--r--core/java/android/app/ApplicationPackageManager.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java
index 90293a4..07eee12 100644
--- a/core/java/android/app/ApplicationPackageManager.java
+++ b/core/java/android/app/ApplicationPackageManager.java
@@ -1571,9 +1571,15 @@ final class ApplicationPackageManager extends PackageManager {
final VolumeInfo currentVol = getPrimaryStorageCurrentVolume();
final List<VolumeInfo> vols = storage.getVolumes();
final List<VolumeInfo> candidates = new ArrayList<>();
- for (VolumeInfo vol : vols) {
- if (Objects.equals(vol, currentVol) || isPrimaryStorageCandidateVolume(vol)) {
- candidates.add(vol);
+ if (Objects.equals(StorageManager.UUID_PRIMARY_PHYSICAL,
+ storage.getPrimaryStorageUuid()) && currentVol != null) {
+ // TODO: support moving primary physical to emulated volume
+ candidates.add(currentVol);
+ } else {
+ for (VolumeInfo vol : vols) {
+ if (Objects.equals(vol, currentVol) || isPrimaryStorageCandidateVolume(vol)) {
+ candidates.add(vol);
+ }
}
}
return candidates;
@@ -1590,12 +1596,7 @@ final class ApplicationPackageManager extends PackageManager {
return false;
}
- // We can move to public volumes on legacy devices
- if ((vol.getType() == VolumeInfo.TYPE_PUBLIC) && vol.getDisk().isDefaultPrimary()) {
- return true;
- }
-
- // Otherwise we can move to any private volume
+ // We can move to any private volume
return (vol.getType() == VolumeInfo.TYPE_PRIVATE);
}