@IconType
    @RequiresApi(23)
    private static int getType(@NonNull Icon icon) {
        if (Build.VERSION.SDK_INT >= 28) {
            return icon.getType();
        }
        try {
            return (int) icon.getClass().getMethod("getType").invoke(icon);
        } catch (IllegalAccessException e) {
            Log.e(TAG, "Unable to get icon type " + icon, e);
            return TYPE_UNKNOWN;
        } catch (InvocationTargetException e) {
            Log.e(TAG, "Unable to get icon type " + icon, e);
            return TYPE_UNKNOWN;
        } catch (NoSuchMethodException e) {
            Log.e(TAG, "Unable to get icon type " + icon, e);
            return TYPE_UNKNOWN;
        }
    }
Gets the type of the icon provided.
<p>
Note that new types may be added later, so callers should guard against other
types being returned. Returns {@link #TYPE_UNKNOWN} when the type cannot be
determined.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/compat/IconCompat.java