code: public static boolean isLocalContactUri(Uri uri) {
      return isLocalContentUri(uri)
          && ContactsContract.AUTHORITY.equals(uri.getAuthority())
          && !uri.getPath().startsWith(LOCAL_CONTACT_IMAGE_URI.getPath());
    }
docs: Checks if the given URI is a general Contact URI, and not a specific display photo.
  
  @param uri the URI to check
  @return true if the uri is a Contact URI, and is not already specifying a display photo.