summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Yohei Yukawa <yukawa@google.com> 2024-06-20 14:02:51 -0700
committer Yohei Yukawa <yukawa@google.com> 2024-06-21 02:48:16 +0000
commit1ce603c3c2ec479742021d9c7b8ba0d5ae4cac70 (patch)
tree460e4ac2a2200d582c8c7d193a73fbc43cb52240 /libs/androidfw/StringPool.cpp
parent3daf8e93753f0a4c4bdf0543792c4ed615166096 (diff)
Add a test mode to SecureSettingsWrapper
This is a preparation before moving InputMethodManagerService#mHardwareKeyboardShortcutController to UserData so that each user can keep maintaining its own instance. The issue is that currently UserDataRepositoryTest does not mock anything around secure settings and UserManagerInternal, which means that when it triggers logic that internally accesses to SecureSettingsWrapper, it ends up throwing NullPointerException as LocalServices.getService(UserManagerInternal.class) returns null, and even if we mocked UserManagerInternal, we still face a problem on how SecureSettingsWrapper should be have when the unit test passes a nonexistent user (e.g. 1). As an intermediate solution, this CL introduces an official fake implementation of SecureSettingsWrapper, which basically forwards all the read/write operations to an on memory dictionary rather than exposing the real data. This should be sufficient for now. Bug: 305849394 Test: presubmit Flag: TEST_ONLY Change-Id: I7cdef44c32871d65d9d2ce2bcdf321cc912d9992
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions