Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 554c18f

Browse files
committed
Move resolveInfosById instantiations to cacheResolveInfos
1 parent 55ee3eb commit 554c18f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shell/platform/android/io/flutter/plugin/text/ProcessTextPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public ProcessTextPlugin(@NonNull ProcessTextChannel processTextChannel) {
4949
@Override
5050
public Map<String, String> queryTextActions() {
5151
if (resolveInfosById == null) {
52-
resolveInfosById = new HashMap<String, ResolveInfo>();
5352
cacheResolveInfos();
5453
}
5554
Map<String, String> result = new HashMap<String, String>();
@@ -104,6 +103,8 @@ public void processTextAction(
104103
}
105104

106105
private void cacheResolveInfos() {
106+
resolveInfosById = new HashMap<String, ResolveInfo>();
107+
107108
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
108109
return;
109110
}
@@ -117,7 +118,6 @@ private void cacheResolveInfos() {
117118
infos = packageManager.queryIntentActivities(intent, 0);
118119
}
119120

120-
resolveInfosById.clear();
121121
for (ResolveInfo info : infos) {
122122
final String id = info.activityInfo.name;
123123
final String label = info.loadLabel(packageManager).toString();

0 commit comments

Comments
 (0)