Deprecate VMStack.getCallingClassLoader() and VMStack.getStackClass1().

Both methods are unused since f0346c9fa808f2addccebbfb3552129e7e21a56e
because all of the previously existing callers meant to call
Reflection.getCallerClass() instead.

This CL removes neither of the two methods because:

 1.) getCallingClassLoader() is used by too many apps and can't be
     removed without further investigation.
 2.) getStackClass1() is used by the only test for getStackClass2(),
     which in turn is still used by Reflection.getCallerClass().
     If/when Reflection.getCallerClass() gets implemented separately
     (with slightly different semantics) and getStackClass2() is
     either removed or gets its own test, getStackClass1() could
     be removed.

Bug: 111850480
Test: Treehugger

Change-Id: Ice4b4b7d1ec576eb1304d36dcde1cb5e06845c47
diff --git a/libart/src/main/java/dalvik/system/VMStack.java b/libart/src/main/java/dalvik/system/VMStack.java
index ca29579..3729bf3 100644
--- a/libart/src/main/java/dalvik/system/VMStack.java
+++ b/libart/src/main/java/dalvik/system/VMStack.java
@@ -30,15 +30,21 @@
      *
      * @return the requested class loader, or {@code null} if this is the
      *         bootstrap class loader.
+     * @deprecated Use {@code ClassLoader.getClassLoader(sun.reflect.Reflection.getCallerClass())}.
+     *         Note that that can return {@link BootClassLoader} on Android where the RI
+     *         would have returned null.
      */
     @FastNative
+    @Deprecated
     native public static ClassLoader getCallingClassLoader();
 
     /**
      * Returns the class of the caller's caller.
      *
      * @return the requested class, or {@code null}.
+     * @deprecated Use {@link sun.reflect.Reflection#getCallerClass()}.
      */
+    @Deprecated
     public static Class<?> getStackClass1() {
         return getStackClass2();
     }
diff --git a/ojluni/src/main/java/java/lang/Class.java b/ojluni/src/main/java/java/lang/Class.java
index 4586d53..f792248 100644
--- a/ojluni/src/main/java/java/lang/Class.java
+++ b/ojluni/src/main/java/java/lang/Class.java
@@ -779,6 +779,8 @@
         if (isPrimitive()) {
             return null;
         }
+        // Android-note: The RI returns null in the case where Android returns BootClassLoader.
+        // Noted in http://b/111850480#comment3
         return (classLoader == null) ? BootClassLoader.getInstance() : classLoader;
     }