ContactsPhotoRequestHandler.java 文件源码

java
阅读 34 收藏 0 点赞 0 评论 0

项目:GitHub 作者:
private InputStream getInputStream(Request data) throws IOException {
  ContentResolver contentResolver = context.getContentResolver();
  Uri uri = data.uri;
  switch (matcher.match(uri)) {
    case ID_LOOKUP:
      uri = ContactsContract.Contacts.lookupContact(contentResolver, uri);
      if (uri == null) {
        return null;
      }
      // Resolved the uri to a contact uri, intentionally fall through to process the resolved uri
    case ID_CONTACT:
      return openContactPhotoInputStream(contentResolver, uri, true);
    case ID_THUMBNAIL:
    case ID_DISPLAY_PHOTO:
      return contentResolver.openInputStream(uri);
    default:
      throw new IllegalStateException("Invalid uri: " + uri);
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号