Fix test 674-hiddenapi when debuggable.
The runtime warns for debuggable apps even when access to an API is
allowed. Update the expectations of this test accordingly.
This requires exposing Runtime::IsJavaDebuggable to the java code so
it knows what to expect.
Test: $ art/test.py -b --host --debuggable -t 674-hiddenapi
Bug: 79914966
Change-Id: I339f205d7153cf7b1c12dc06813c768608921684
diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc
index 7f7b524..6c82019 100644
--- a/runtime/native/dalvik_system_VMRuntime.cc
+++ b/runtime/native/dalvik_system_VMRuntime.cc
@@ -185,6 +185,10 @@
return Runtime::Current()->IsNativeDebuggable();
}
+static jboolean VMRuntime_isJavaDebuggable(JNIEnv*, jobject) {
+ return Runtime::Current()->IsJavaDebuggable();
+}
+
static jobjectArray VMRuntime_properties(JNIEnv* env, jobject) {
DCHECK(WellKnownClasses::java_lang_String != nullptr);
@@ -702,6 +706,7 @@
NATIVE_METHOD(VMRuntime, getTargetHeapUtilization, "()F"),
FAST_NATIVE_METHOD(VMRuntime, isDebuggerActive, "()Z"),
FAST_NATIVE_METHOD(VMRuntime, isNativeDebuggable, "()Z"),
+ NATIVE_METHOD(VMRuntime, isJavaDebuggable, "()Z"),
NATIVE_METHOD(VMRuntime, nativeSetTargetHeapUtilization, "(F)V"),
FAST_NATIVE_METHOD(VMRuntime, newNonMovableArray, "(Ljava/lang/Class;I)Ljava/lang/Object;"),
FAST_NATIVE_METHOD(VMRuntime, newUnpaddedArray, "(Ljava/lang/Class;I)Ljava/lang/Object;"),