Refactor input code for require_kernel_config parameter

As part of the next commit to allow kl files to specify a required
kernel config, some small refactorings were done. Move those here to a
separate CL to make it easier to review.

Merge conflict resolution:
Needed to make some small changes to account for the lack of ag/13538321
in aosp repo. These are related to "NamedEnum" API change.

Bug: 228005926
Test: atest libinput_tests
Merged-In: Iab06bb6ef44807308ee2b3e6b8a0c780bb748f09
Change-Id: Iab06bb6ef44807308ee2b3e6b8a0c780bb748f09
(cherry picked from commit 5ed8eaab67ad7ec3ac1110d696f5d89596a5a887)
diff --git a/include/input/KeyLayoutMap.h b/include/input/KeyLayoutMap.h
index b2bd535..d1925f4 100644
--- a/include/input/KeyLayoutMap.h
+++ b/include/input/KeyLayoutMap.h
@@ -21,7 +21,6 @@
 #include <stdint.h>
 #include <utils/Errors.h>
 #include <utils/KeyedVector.h>
-#include <utils/RefBase.h>
 #include <utils/Tokenizer.h>
 
 #include <input/InputDevice.h>
@@ -66,7 +65,6 @@
 class KeyLayoutMap {
 public:
     static base::Result<std::shared_ptr<KeyLayoutMap>> load(const std::string& filename);
-    static base::Result<std::shared_ptr<KeyLayoutMap>> load(Tokenizer* tokenizer);
     static base::Result<std::shared_ptr<KeyLayoutMap>> loadContents(const std::string& filename,
                                                                     const char* contents);
 
@@ -84,6 +82,8 @@
     virtual ~KeyLayoutMap();
 
 private:
+    static base::Result<std::shared_ptr<KeyLayoutMap>> load(Tokenizer* tokenizer);
+
     struct Key {
         int32_t keyCode;
         uint32_t flags;