Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf701d44 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Inline InputMethodUtils#getStringForUser

With my previous commit [1], we can safely inline

  InputMethodUtils#getStringForUser(),

which is used in only one place.

 [1]: I1a9a09655bd63fc5d8cd1811f82c04001d21c22d

Bug: 309837937
Test: presubmit
Change-Id: Ie621bedbe2ce65d14d5d49d612828aea2606084c
parent 23d665cf
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -330,17 +330,11 @@ final class InputMethodUtils {

        @Nullable
        private String getString(@NonNull String key, @Nullable String defaultValue) {
            return getStringForUser(key, defaultValue, mCurrentUserId);
        }

        @Nullable
        private String getStringForUser(
                @NonNull String key, @Nullable String defaultValue, @UserIdInt int userId) {
            final String result;
            if (mCopyOnWrite && mCopyOnWriteDataStore.containsKey(key)) {
                result = mCopyOnWriteDataStore.get(key);
            } else {
                result = Settings.Secure.getStringForUser(mResolver, key, userId);
                result = Settings.Secure.getStringForUser(mResolver, key, mCurrentUserId);
            }
            return result != null ? result : defaultValue;
        }