diff options
author | Jeff Sharkey <jsharkey@android.com> | 2015-04-21 19:44:59 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-21 19:45:02 +0000 |
commit | e0ef7e8c60566bad4cbe0140b98e9b1ccef72929 (patch) | |
tree | 0bffc47c031dbec8af25c3f66340953c95f39d64 | |
parent | 753f90081e2a522ce33fbb1620ba10f727901683 (diff) | |
parent | 74acbbb2cd367c6e78db7de5118ff9dd56da61d0 (diff) | |
download | frameworks_base-e0ef7e8c60566bad4cbe0140b98e9b1ccef72929.zip frameworks_base-e0ef7e8c60566bad4cbe0140b98e9b1ccef72929.tar.gz frameworks_base-e0ef7e8c60566bad4cbe0140b98e9b1ccef72929.tar.bz2 |
Merge "Blend in force adoptable flag when set."
-rw-r--r-- | core/java/android/os/storage/DiskInfo.java | 3 | ||||
-rw-r--r-- | core/java/android/os/storage/StorageManager.java | 2 | ||||
-rw-r--r-- | services/core/java/com/android/server/MountService.java | 5 |
3 files changed, 9 insertions, 1 deletions
diff --git a/core/java/android/os/storage/DiskInfo.java b/core/java/android/os/storage/DiskInfo.java index 9f38de8..64f2a05 100644 --- a/core/java/android/os/storage/DiskInfo.java +++ b/core/java/android/os/storage/DiskInfo.java @@ -68,6 +68,9 @@ public class DiskInfo implements Parcelable { if (TextUtils.isEmpty(label)) { return false; } + if (label.equalsIgnoreCase("ata")) { + return false; + } if (label.toLowerCase().contains("generic")) { return false; } diff --git a/core/java/android/os/storage/StorageManager.java b/core/java/android/os/storage/StorageManager.java index efa3ef2..f101352 100644 --- a/core/java/android/os/storage/StorageManager.java +++ b/core/java/android/os/storage/StorageManager.java @@ -69,6 +69,8 @@ public class StorageManager { /** {@hide} */ public static final String PROP_PRIMARY_PHYSICAL = "ro.vold.primary_physical"; + /** {@hide} */ + public static final String PROP_FORCE_ADOPTABLE = "persist.fw.force_adoptable"; /** {@hide} */ public static final int FLAG_ALL_METADATA = 1 << 0; diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java index 649fcde..f88802a 100644 --- a/services/core/java/com/android/server/MountService.java +++ b/services/core/java/com/android/server/MountService.java @@ -823,7 +823,10 @@ class MountService extends IMountService.Stub case VoldResponseCode.DISK_CREATED: { if (cooked.length != 3) break; final String id = cooked[1]; - final int flags = Integer.parseInt(cooked[2]); + int flags = Integer.parseInt(cooked[2]); + if (SystemProperties.getBoolean(StorageManager.PROP_FORCE_ADOPTABLE, false)) { + flags |= DiskInfo.FLAG_ADOPTABLE; + } mDisks.put(id, new DiskInfo(id, flags)); break; } |