compat/src/main/java/androidx/core/content/pm/ShortcutManagerCompat.java
public static boolean isRequestPinShortcutSupported(@NonNull Context context) {
        if (Build.VERSION.SDK_INT >= 26) {
            return context.getSystemService(ShortcutManager.class).isRequestPinShortcutSupported();
        }

        if (ContextCompat.checkSelfPermission(context, INSTALL_SHORTCUT_PERMISSION)
                != PackageManager.PERMISSION_GRANTED) {
            return false;
        }
        for (ResolveInfo info : context.getPackageManager().queryBroadcastReceivers(
                new Intent(ACTION_INSTALL_SHORTCUT), 0)) {
            String permission = info.activityInfo.permission;
            if (TextUtils.isEmpty(permission) || INSTALL_SHORTCUT_PERMISSION.equals(permission)) {
                return true;
            }
        }
        return false;
    }
/**
     * @return {@code true} if the launcher supports {@link #requestPinShortcut},
     * {@code false} otherwise
     */
@return  true if the launcher supports  #requestPinShortcut,
false otherwise
@return true if the launcher supports #requestPinShortcut false otherwise
public static boolean isRequestPinShortcutSupported(@NonNull Context context) {
        if (Build.VERSION.SDK_INT >= 26) {
            return context.getSystemService(ShortcutManager.class).isRequestPinShortcutSupported();
        }
        if (ContextCompat.checkSelfPermission(context, INSTALL_SHORTCUT_PERMISSION)
                != PackageManager.PERMISSION_GRANTED) {
            return false;
        }
        for (ResolveInfo info : context.getPackageManager().queryBroadcastReceivers(
                new Intent(ACTION_INSTALL_SHORTCUT), 0)) {
            String permission = info.activityInfo.permission;
            if (TextUtils.isEmpty(permission) || INSTALL_SHORTCUT_PERMISSION.equals(permission)) {
                return true;
            }
        }
        return false;
    }
public static boolean isRequestPinShortcutSupported ( @ NonNull Context context ) { if ( Build . VERSION . SDK_INT >= 26 ) { return context . getSystemService ( ShortcutManager . class ) . isRequestPinShortcutSupported ( ) ; } if ( ContextCompat . checkSelfPermission ( context , INSTALL_SHORTCUT_PERMISSION ) != PackageManager . PERMISSION_GRANTED ) { return false ; } for ( ResolveInfo info : context . getPackageManager ( ) . queryBroadcastReceivers ( new Intent ( ACTION_INSTALL_SHORTCUT ) , 0 ) ) { String permission = info . activityInfo . permission ; if ( TextUtils . isEmpty ( permission ) || INSTALL_SHORTCUT_PERMISSION . equals ( permission ) ) { return true ; } } return false ; }
@return {@code true} if the launcher supports {@link #requestPinShortcut},
 {@code false} otherwise
@return { @code true } if the launcher supports { @link #requestPinShortcut } { @code false } otherwise