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

Skip to content
Commit 182f0eba authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Update a stale comment in IMMS constructor

This is a follow up CL to my previous CL [1] 7 years ago, which was
part of our effort on speeding up the system boot process by postponing
unnecessary tasks from InputMethodManagerService's constructor to later
phases.

Here is a brief history of the comment in question

  // InputMethodSettingsRepository should be initialized before
  // buildInputMethodListLocked

It was added on Oct 2010 when InputMethodSettings was introduced [2].
At that time, the code was as follows.

  // mSettings should be created before buildInputMethodListLocked
  mSettings = new InputMethodSettings(
      context.getContentResolver(), mMethodMap, mMethodList);
  buildInputMethodListLocked(mMethodList, mMethodMap);
  mSettings.enableAllIMEsIfThereIsNoEnabledIME();

The comment was a bit redundant but was not inconsistent at least.

After my CL [1], we no longer call buildInputMethodListLocked from the
IMMS constructor, and that's when the comment became stale.  Ideally I
should have updated the comment alongside.

The next chance I could have updated the comment was when I decided to
not reuse the same instance in InputMethodManagerService#mSettings but
rather re-create a new instance every time it needed to be updated [3].
After that CL [3], it became more obvous that IMMS#mSettings remains to
be empty until the system hits IMMS#systemReady(). It was already the
case even before that CL [3] though.

Finally I have replaced

  InputMethodManagerService#mSettings

in favor of InputMethodSettingsRepository [4], with mechanically
replacing this stale and confusing comment without thinking twice
whether the comment was still valid or not.

We may probably revisit the behavior of

  InputMethodSettingsRepository.initialize()

in a subsequent CL, as it still has some questionable logic, but I
believe the revised comment in this CL would remain valid at least
for a while.

This is just a comment change. There must be no behavior change.

 [1]: I5b37c450db4b25b3e635b6d634293a34eec8b9d4
      7924782c
 [2]: Icd0f13de396ce286ff6563e8c2775d53bcdacbf3
      d87c2594
 [3]: I52297912d0b66e5e40b6a624c35427a377dc7b1b
      a56463ba
 [4]: Ic0dd655fbd86b8ccce2b3298b4c70359a468f9ec
      8130073e

Bug: 305849394
Bug: 347693610
Test: presubmit
Flag: EXEMPT refactor
Change-Id: Ia2095de2b565a324d3cb55c9054f1352f10cd747
parent 0bf84c39
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment