Blend in force adoptable flag when set.

Bug: 19993667
Change-Id: Ic7f348d171a89e889281b7efb1aa0cbade048975
This commit is contained in:
Jeff Sharkey
2015-04-21 12:14:03 -07:00
parent eba260d6d3
commit 74acbbb2cd
3 changed files with 9 additions and 1 deletions

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;
}