use of android.mtp.MtpStorageInfo in project android_frameworks_base by DirtyUnicorns.
the class MtpManager method getRoots.
private MtpRoot[] getRoots(int deviceId) throws IOException {
final MtpDevice device = getDevice(deviceId);
synchronized (device) {
final int[] storageIds = ensureNotNull(device.getStorageIds(), "Failed to obtain storage IDs.");
final ArrayList<MtpRoot> roots = new ArrayList<>();
for (int i = 0; i < storageIds.length; i++) {
final MtpStorageInfo info = device.getStorageInfo(storageIds[i]);
if (info == null) {
continue;
}
roots.add(new MtpRoot(device.getDeviceId(), info));
}
return roots.toArray(new MtpRoot[roots.size()]);
}
}
Aggregations