private Set<Integer> getMethodIds(Dex dex, Set<Integer> memberNameIndexes, int declaringType) {
    Set<Integer> subtypes = findAssignableTypes(dex, declaringType);

    Set<Integer> methods = new HashSet<Integer>();
    int methodIndex = 0;
    for (MethodId method : dex.methodIds()) {
      if (memberNameIndexes.contains(method.getNameIndex())
          && subtypes.contains(method.getDeclaringClassIndex())) {
        methods.add(methodIndex);
      }
      methodIndex++;
    }
    return methods;
  }
Returns the methods with {@code memberNameIndex} declared by {@code declaringType} and its
subtypes.
android/android_framework/dex-maker/src/main/java/com/android/dx/command/findusages/FindUsages.java