Revert "Do not show UI hidden API warning for exempt apps but print into log"

This reverts commit e5bc69765d685bcbd3d98a3b792f6d90e4e3dabc.

Reason for revert: This is no longer required

Change-Id: I80d4a866916a77032e205257d6f920b928fb876f
diff --git a/runtime/hidden_api.h b/runtime/hidden_api.h
index 6b42259..05e68e6 100644
--- a/runtime/hidden_api.h
+++ b/runtime/hidden_api.h
@@ -106,8 +106,7 @@
           member->GetAccessFlags(), HiddenApiAccessFlags::kWhitelist));
     }
     WarnAboutMemberAccess(member);
-    if ((action == kAllowButWarnAndToast && runtime->ShouldSetHiddenApiWarningFlag()) ||
-        runtime->ShouldAlwaysSetHiddenApiWarningFlag()) {
+    if (action == kAllowButWarnAndToast || runtime->ShouldAlwaysSetHiddenApiWarningFlag()) {
       Runtime::Current()->SetPendingHiddenApiWarning(true);
     }
     return false;
diff --git a/runtime/native/dalvik_system_ZygoteHooks.cc b/runtime/native/dalvik_system_ZygoteHooks.cc
index a57bf99..648a464 100644
--- a/runtime/native/dalvik_system_ZygoteHooks.cc
+++ b/runtime/native/dalvik_system_ZygoteHooks.cc
@@ -348,12 +348,7 @@
 
   DCHECK(!is_system_server || !do_hidden_api_checks)
       << "SystemServer should be forked with DISABLE_HIDDEN_API_CHECKS";
-
-  // Skip checks only if this is the system server. Show UI warnings if not
-  // exempt from hidden API checks. This is a temporary configuration for
-  // dogfood builds.
-  Runtime::Current()->SetHiddenApiChecksEnabled(!is_system_server);
-  Runtime::Current()->SetUseHiddenApiWarningFlag(do_hidden_api_checks);
+  Runtime::Current()->SetHiddenApiChecksEnabled(do_hidden_api_checks);
 
   // Clear the hidden API warning flag, in case it was set.
   Runtime::Current()->SetPendingHiddenApiWarning(false);
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index e910df6..25d83df 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -266,7 +266,6 @@
       is_low_memory_mode_(false),
       safe_mode_(false),
       do_hidden_api_checks_(true),
-      use_hidden_api_warning_flag_(true),
       pending_hidden_api_warning_(false),
       dedupe_hidden_api_warnings_(true),
       always_set_hidden_api_warning_flag_(false),
diff --git a/runtime/runtime.h b/runtime/runtime.h
index 8b468e9..7ab9be5 100644
--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -528,14 +528,6 @@
     return do_hidden_api_checks_;
   }
 
-  void SetUseHiddenApiWarningFlag(bool value) {
-    use_hidden_api_warning_flag_ = value;
-  }
-
-  bool ShouldSetHiddenApiWarningFlag() const {
-    return use_hidden_api_warning_flag_;
-  }
-
   void SetPendingHiddenApiWarning(bool value) {
     pending_hidden_api_warning_ = value;
   }
@@ -1000,9 +992,6 @@
   // Whether access checks on hidden API should be performed.
   bool do_hidden_api_checks_;
 
-  // Whether hidden API UI warning flag should be set or not.
-  bool use_hidden_api_warning_flag_;
-
   // Whether the application has used an API which is not restricted but we
   // should issue a warning about it.
   bool pending_hidden_api_warning_;