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>
<activity
android:name="pub.doric.DoricActivity"
android:exported="false"
android:theme="@style/Theme.Design.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

View File

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