diff --git a/core/modules/system/src/Tests/Theme/ThemeTest.php b/core/modules/system/src/Tests/Theme/ThemeTest.php
index 9dc3f97..c0da0a7 100644
--- a/core/modules/system/src/Tests/Theme/ThemeTest.php
+++ b/core/modules/system/src/Tests/Theme/ThemeTest.php
@@ -208,11 +208,11 @@ function testListThemes() {
     $themes = $theme_handler->listInfo();
 
     $themes = \Drupal::service('theme_handler')->listInfo();
-    // Check if drupal_theme_access() retrieves enabled themes properly from
-    // ThemeHandlerInterface::listInfo().
-    $this->assertTrue(drupal_theme_access('test_theme'), 'Installed theme detected');
+    // Check if \Drupal::service('access_check.theme')->checkAccess() retrieves
+    // enabled themes properly from ThemeHandlerInterface::listInfo().
+    $this->assertTrue(\Drupal::service('access_check.theme')->checkAccess(('test_theme'), 'Installed theme detected');
 
-    $this->assertTrue(drupal_theme_access('test_theme'), 'Enabled theme detected');
+    $this->assertTrue(\Drupal::service('access_check.theme')->checkAccess(('test_theme'), 'Enabled theme detected');
     // Check if ThemeHandlerInterface::listInfo() returns disabled themes.
     // Check for base theme and subtheme lists.
     $base_theme_list = array('test_basetheme' => 'Theme test base theme');
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 007595e..3733977 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -312,7 +312,7 @@ function system_theme_suggestions_field(array $variables) {
  * Menu item access callback - only installed themes can be accessed.
  */
 function _system_themes_access($theme) {
-  return \Drupal::currentUser()->hasPermission('administer themes') && drupal_theme_access($theme);
+  return \Drupal::currentUser()->hasPermission('administer themes') && \Drupal::service('access_check.theme')->checkAccess($theme);
 }
 
 /**
