Don't dirty access flags due to hidden api logging.

The logging only applies to debuggable apps, so skip updating access
flags if we're running a non-debuggable app.

Test: imgdiag
Bug: 162110941
Change-Id: Ie0c2862405558eef939a37d585f8aaae74262516
diff --git a/runtime/hidden_api.cc b/runtime/hidden_api.cc
index 365bace..e1d0f70 100644
--- a/runtime/hidden_api.cc
+++ b/runtime/hidden_api.cc
@@ -638,8 +638,9 @@
     }
 
     // If this access was not denied, flag member as SDK and skip
-    // the warning the next time the member is accessed.
-    if (!deny_access) {
+    // the warning the next time the member is accessed. Don't update for
+    // non-debuggable apps as this has a memory cost.
+    if (!deny_access && runtime->IsJavaDebuggable()) {
       MaybeUpdateAccessFlags(runtime, member, kAccPublicApi);
     }
   }