android:fix DoricActivity be called externally

This commit is contained in:
pengfei.zhou 2020-04-18 10:36:30 +08:00 committed by osborn
parent bc8e815b05
commit a386c548ec
2 changed files with 9 additions and 6 deletions

View File

@ -5,10 +5,9 @@
<application> <application>
<activity <activity
android:name="pub.doric.DoricActivity" android:name="pub.doric.DoricActivity"
android:exported="false"
android:theme="@style/Theme.Design.Light.NoActionBar"> android:theme="@style/Theme.Design.Light.NoActionBar">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
</activity> </activity>

View File

@ -16,6 +16,8 @@
package pub.doric.loader; package pub.doric.loader;
import android.text.TextUtils;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
@ -53,10 +55,12 @@ public class DoricJSLoaderManager {
} }
public AsyncResult<String> loadJSBundle(String source) { public AsyncResult<String> loadJSBundle(String source) {
Collection<IDoricJSLoader> jsLoaders = getJSLoaders(); if (!TextUtils.isEmpty(source)) {
for (IDoricJSLoader jsLoader : jsLoaders) { Collection<IDoricJSLoader> jsLoaders = getJSLoaders();
if (jsLoader.filter(source)) { for (IDoricJSLoader jsLoader : jsLoaders) {
return jsLoader.request(source); if (jsLoader.filter(source)) {
return jsLoader.request(source);
}
} }
} }
AsyncResult<String> ret = new AsyncResult<>(); AsyncResult<String> ret = new AsyncResult<>();