private static String getStorageVolumeStats(Object service, Object storageVolume, String path) {
try {
Class<? extends Object> StorageVolumeClass = storageVolume.getClass();
Method getState = StorageVolumeClass.getMethod("getState");
return (String) getState.invoke(storageVolume);
} catch (Exception e) {
try {
Class IMountService = service.getClass();
Method getVolumeState = IMountService.getMethod("getVolumeState", String.class);
return (String) getVolumeState.invoke(service, path);
} catch (Exception e1) {
e1.printStackTrace();
}
}
return Environment.MEDIA_UNMOUNTABLE;
}
SDCardUtils.java 文件源码
java
阅读 53
收藏 0
点赞 0
评论 0
项目:Accessibility
作者:
评论列表
文章目录