@RestrictTo(LIBRARY_GROUP)
    @RequiresApi(23)
    @Nullable
    public static IconCompat createFromIcon(@NonNull Icon icon) {
        Preconditions.checkNotNull(icon);
        switch (getType(icon)) {
            case TYPE_RESOURCE:
                return createWithResource(null, getResPackage(icon), getResId(icon));
            case TYPE_URI:
                return createWithContentUri(getUri(icon));
        }
        IconCompat iconCompat = new IconCompat(TYPE_UNKNOWN);
        iconCompat.mObj1 = icon;
        return iconCompat;
    }
Creates an IconCompat from an Icon.

@hide
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/compat/IconCompat.java