content: package androidx.core.accessibilityservice;
  
  import android.accessibilityservice.AccessibilityServiceInfo;
  import android.content.pm.PackageManager;
  import android.os.Build;
  
  public final class AccessibilityServiceInfoCompat {
      public static final int CAPABILITY_CAN_FILTER_KEY_EVENTS = 8;
      public static final int CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY = 4;
      public static final int CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION = 2;
      public static final int CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT = 1;
      public static final int FEEDBACK_ALL_MASK = -1;
      public static final int FEEDBACK_BRAILLE = 32;
      public static final int FLAG_INCLUDE_NOT_IMPORTANT_VIEWS = 2;
      public static final int FLAG_REPORT_VIEW_IDS = 16;
      public static final int FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY = 8;
      public static final int FLAG_REQUEST_FILTER_KEY_EVENTS = 32;
      public static final int FLAG_REQUEST_TOUCH_EXPLORATION_MODE = 4;
  
      private AccessibilityServiceInfoCompat() {
      }
  
      public static String capabilityToString(int capability) {
          switch (capability) {
              case 1:
                  return "CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT";
              case 2:
                  return "CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION";
              case 4:
                  return "CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY";
              case 8:
                  return "CAPABILITY_CAN_FILTER_KEY_EVENTS";
              default:
                  return "UNKNOWN";
          }
      }
  
      public static String feedbackTypeToString(int feedbackType) {
          StringBuilder sb = new StringBuilder();
          sb.append("[");
          while (feedbackType > 0) {
              int numberOfTrailingZeros = 1 << Integer.numberOfTrailingZeros(feedbackType);
              feedbackType &= ~numberOfTrailingZeros;
              if (sb.length() > 1) {
                  sb.append(", ");
              }
              switch (numberOfTrailingZeros) {
                  case 1:
                      sb.append("FEEDBACK_SPOKEN");
                      break;
                  case 2:
                      sb.append("FEEDBACK_HAPTIC");
                      break;
                  case 4:
                      sb.append("FEEDBACK_AUDIBLE");
                      break;
                  case 8:
                      sb.append("FEEDBACK_VISUAL");
                      break;
                  case 16:
                      sb.append("FEEDBACK_GENERIC");
                      break;
              }
          }
          sb.append("]");
          return sb.toString();
      }
  
      public static String flagToString(int flag) {
          switch (flag) {
              case 1:
                  return "DEFAULT";
              case 2:
                  return "FLAG_INCLUDE_NOT_IMPORTANT_VIEWS";
              case 4:
                  return "FLAG_REQUEST_TOUCH_EXPLORATION_MODE";
              case 8:
                  return "FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY";
              case 16:
                  return "FLAG_REPORT_VIEW_IDS";
              case 32:
                  return "FLAG_REQUEST_FILTER_KEY_EVENTS";
              default:
                  return null;
          }
      }
  
      public static int getCapabilities(AccessibilityServiceInfo info) {
          return Build.VERSION.SDK_INT >= 18 ? info.getCapabilities() : info.getCanRetrieveWindowContent() ? 1 : 0;
      }
  
      public static String loadDescription(AccessibilityServiceInfo info, PackageManager packageManager) {
          return Build.VERSION.SDK_INT >= 16 ? info.loadDescription(packageManager) : info.getDescription();
      }
  }
  