@@ -51,11 +51,11 @@ public void onStateUpdate(SplitInstallSessionState state) {
5151 {
5252 Log .e (
5353 TAG ,
54- String .format ("Module \" %s\" (sessionId %d) install failed with: %s" ,
54+ String .format (
55+ "Module \" %s\" (sessionId %d) install failed with: %s" ,
5556 sessionIdToName .get (state .sessionId ()),
5657 state .sessionId (),
57- state .errorCode ())
58- );
58+ state .errorCode ()));
5959 flutterJNI .dynamicFeatureInstallFailure (
6060 sessionIdToName .get (state .sessionId ()),
6161 sessionIdToLoadingUnitId .get (state .sessionId ()),
@@ -69,10 +69,10 @@ public void onStateUpdate(SplitInstallSessionState state) {
6969 {
7070 Log .e (
7171 TAG ,
72- String .format ("Module \" %s\" (sessionId %d) install successfully." ,
72+ String .format (
73+ "Module \" %s\" (sessionId %d) install successfully." ,
7374 sessionIdToName .get (state .sessionId ()),
74- state .sessionId ())
75- );
75+ state .sessionId ()));
7676 loadAssets (
7777 sessionIdToName .get (state .sessionId ()),
7878 sessionIdToLoadingUnitId .get (state .sessionId ()));
@@ -90,71 +90,71 @@ public void onStateUpdate(SplitInstallSessionState state) {
9090 {
9191 Log .e (
9292 TAG ,
93- String .format ("Module \" %s\" (sessionId %d) install canceled." ,
93+ String .format (
94+ "Module \" %s\" (sessionId %d) install canceled." ,
9495 sessionIdToName .get (state .sessionId ()),
95- state .sessionId ())
96- );
96+ state .sessionId ()));
9797 sessionIdToName .remove (state .sessionId ());
9898 break ;
9999 }
100100 case SplitInstallSessionStatus .CANCELING :
101101 {
102102 Log .e (
103103 TAG ,
104- String .format ("Module \" %s\" (sessionId %d) install canceling." ,
104+ String .format (
105+ "Module \" %s\" (sessionId %d) install canceling." ,
105106 sessionIdToName .get (state .sessionId ()),
106- state .sessionId ())
107- );
107+ state .sessionId ()));
108108 break ;
109109 }
110110 case SplitInstallSessionStatus .PENDING :
111111 {
112112 Log .e (
113113 TAG ,
114- String .format ("Module \" %s\" (sessionId %d) install pending." ,
114+ String .format (
115+ "Module \" %s\" (sessionId %d) install pending." ,
115116 sessionIdToName .get (state .sessionId ()),
116- state .sessionId ())
117- );
117+ state .sessionId ()));
118118 break ;
119119 }
120120 case SplitInstallSessionStatus .REQUIRES_USER_CONFIRMATION :
121121 {
122122 Log .e (
123123 TAG ,
124- String .format ("Module \" %s\" (sessionId %d) install requires user confirmation." ,
124+ String .format (
125+ "Module \" %s\" (sessionId %d) install requires user confirmation." ,
125126 sessionIdToName .get (state .sessionId ()),
126- state .sessionId ())
127- );
127+ state .sessionId ()));
128128 break ;
129129 }
130130 case SplitInstallSessionStatus .DOWNLOADING :
131131 {
132132 Log .e (
133133 TAG ,
134- String .format ("Module \" %s\" (sessionId %d) downloading." ,
134+ String .format (
135+ "Module \" %s\" (sessionId %d) downloading." ,
135136 sessionIdToName .get (state .sessionId ()),
136- state .sessionId ())
137- );
137+ state .sessionId ()));
138138 break ;
139139 }
140140 case SplitInstallSessionStatus .DOWNLOADED :
141141 {
142142 Log .e (
143143 TAG ,
144- String .format ("Module \" %s\" (sessionId %d) downloaded." ,
144+ String .format (
145+ "Module \" %s\" (sessionId %d) downloaded." ,
145146 sessionIdToName .get (state .sessionId ()),
146- state .sessionId ())
147- );
147+ state .sessionId ()));
148148 break ;
149149 }
150150 case SplitInstallSessionStatus .INSTALLING :
151151 {
152152 Log .e (
153153 TAG ,
154- String .format ("Module \" %s\" (sessionId %d) installing." ,
154+ String .format (
155+ "Module \" %s\" (sessionId %d) installing." ,
155156 sessionIdToName .get (state .sessionId ()),
156- state .sessionId ())
157- );
157+ state .sessionId ()));
158158 break ;
159159 }
160160 default :
@@ -259,7 +259,7 @@ public void loadDartLibrary(String moduleName, int loadingUnitId) {
259259 String pathAbi = abi .replace ("-" , "_" ); // abis are represented with underscores in paths.
260260
261261 // TODO(garyq): Optimize this apk/file discovery process to use less i/o and be more
262- // performant.
262+ // performant and robust .
263263
264264 // Search directly in APKs first
265265 List <String > apkPaths = new ArrayList ();
@@ -276,8 +276,8 @@ public void loadDartLibrary(String moduleName, int loadingUnitId) {
276276 continue ;
277277 }
278278 String name = file .getName ();
279- if (name .substring ( name . length () - 4 ). equals (".apk" )
280- && name .substring ( 0 , moduleName . length ()). equals (moduleName )
279+ if (name .endsWith (".apk" )
280+ && name .startsWith (moduleName )
281281 && name .contains (pathAbi )) {
282282 apkPaths .add (file .getAbsolutePath ());
283283 continue ;
0 commit comments