summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator.cpp
diff options
context:
space:
mode:
authorYohei Yukawa <yukawa@google.com>2018-11-19 21:54:10 -0800
committerYohei Yukawa <yukawa@google.com>2018-11-19 21:54:10 -0800
commitfbc5547e5f02c4f4ee1c2a0fa71de1ac96d9eb0f (patch)
tree218803786ea38e41b8535eb23810f901636de118 /tools/aapt2/java/JavaClassGenerator.cpp
parent7e06f2beca62e412b764edb750142e545d114856 (diff)
Remove dependency on TreeMap from getSortedInputMethodAndSubtypeList()
InputMethodAndSubtypeList#getSortedInputMethodAndSubtypeList() currently sorts ImeSubtypeListItem as follows: 1. Create a sorted list of IMEs by TreeMap with the sorting key imi.loadLabel(mPm) + "/" + imi.getId() 2. Generate list of ImeSubtypeListItem objects. 3. Do stable sort ImeSubtypeListItem lists with the following order mImeName mIsSystemLocale mIsSystemLanguage mSubtypeName 4. Return the sorted ImeSubtypeListItem list. Since in the step 2 everything is done sequentially and the result for each IME will not be affected by other IMEs, we can in theory unify the step 1 into the step 3 so that we can perform sorting only once. In order to avoid unnecessary behavior change in this CL, with this CL the step 1 will be removed and the sorting order in the step 3 will be updated as follows: mImeName mIsSystemLocale mIsSystemLanguage mSubtypeName mImi.getId() This should be sufficient to preserve the current behavior because: a) if two ImeSubtypeListItem items were not classified as the same in the step 3, the step 1 basically did not matter and, b) if two ImeSubtypeListItem items were classified as the same in the step 3, those two items would have preserved the sort order in the step 1. Here mImeName == imi.loadLabel(mPm) so if this is the case only mImi.getId() matters in this scenario. Therefore this CL should not have any user-visible behavior change. Fix: 64612471 Test: atest InputMethodSubtypeSwitchingControllerTest Change-Id: I4204275f1fc2040d98b9c55a38ab8b8d50e65126
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
0 files changed, 0 insertions, 0 deletions