[Panlingual] Improve performance of displaying app list in Settings.

- Use existed ApplicationInfo to get needed info.
 - Add unittest to AppLocaleUtil.java

Bug: b/238054165
Bug: b/231904717
Test: Maunal test passed
Test: atest passed
Change-Id: I23f354c366b45d4b684184b3366aeab913bcd3c8
This commit is contained in:
tom hsu
2022-10-25 16:26:55 +08:00
parent 862e9b3040
commit 8bd5e2a52f
7 changed files with 97 additions and 82 deletions

View File

@@ -55,8 +55,7 @@ public class AppStateLocaleBridge extends AppStateBaseBridge {
AppInfoByProfiles appInfoByProfiles = getAppInfo(UserHandle.getUserId(uid));
app.extraInfo = AppLocaleUtil.canDisplayLocaleUi(appInfoByProfiles.mContextAsUser,
app.info.packageName,
appInfoByProfiles.mListInfos) ? Boolean.TRUE : Boolean.FALSE;
app.info, appInfoByProfiles.mListInfos) ? Boolean.TRUE : Boolean.FALSE;
}
@Override
@@ -67,8 +66,7 @@ public class AppStateLocaleBridge extends AppStateBaseBridge {
AppInfoByProfiles appInfoByProfiles = getAppInfo(UserHandle.getUserId(app.info.uid));
app.extraInfo = AppLocaleUtil.canDisplayLocaleUi(appInfoByProfiles.mContextAsUser,
app.info.packageName,
appInfoByProfiles.mListInfos) ? Boolean.TRUE : Boolean.FALSE;
app.info, appInfoByProfiles.mListInfos) ? Boolean.TRUE : Boolean.FALSE;
}
}