code: private void inferCaller() {
          needToInferCaller = false;
          // Android-changed: Use VMStack.getThreadStackTrace.
          /* J2ObjC modified.
          StackTraceElement[] stack = VMStack.getThreadStackTrace(Thread.currentThread());
          */
          StackTraceElement[] stack = Thread.currentThread().getStackTrace();
          int depth = stack.length;
  
          boolean lookingForLogger = true;
          for (int ix = 0; ix < depth; ix++) {
              // Calling getStackTraceElement directly prevents the VM
              // from paying the cost of building the entire stack frame.
              //
              // Android-changed: Use value from getThreadStackTrace.
              StackTraceElement frame = stack[ix];
              String cname = frame.getClassName();
              boolean isLoggerImpl = isLoggerImplFrame(cname);
              if (lookingForLogger) {
                  // Skip all frames until we have found the first logger frame.
                  if (isLoggerImpl) {
                      lookingForLogger = false;
                  }
              } else {
                  if (!isLoggerImpl) {
                      // skip reflection call
                      if (!cname.startsWith("java.lang.reflect.") && !cname.startsWith("sun.reflect.")) {
                         // We've found the relevant frame.
                         setSourceClassName(cname);
                         setSourceMethodName(frame.getMethodName());
                         return;
                      }
                  }
              }
          }
          // We haven't found a suitable frame, so just punt.  This is
          // OK as we are only committed to making a "best effort" here.
      }
docs: Private method to infer the caller's class and method names