/** This method must be invoked on the UI thread. */ public static void initEmbeddedMode() { if (sInstance != null || !sReservedActivities.isEmpty()) return; Log.d(TAG, "Init embedded mode"); XWalkCoreWrapper provisionalInstance = new XWalkCoreWrapper(null, -1); if (!provisionalInstance.findEmbeddedCore()) { Assert.fail("Please have your activity extend XWalkActivity for shared mode"); } sInstance = provisionalInstance; sInstance.initXWalkCore(); }
public static int attachXWalkCore(Context context) { Assert.assertNotNull(sReservedObjects); Assert.assertNull(sInstance); Log.d(TAG, "Attach xwalk core"); sProvisionalInstance = new XWalkCoreWrapper(context, -1); if (!sProvisionalInstance.findEmbeddedCore()) { int status = sProvisionalInstance.mCoreStatus; if (!sProvisionalInstance.findSharedCore()) { if (sProvisionalInstance.mCoreStatus != XWalkLibraryInterface.STATUS_NOT_FOUND) { status = sProvisionalInstance.mCoreStatus; } Log.d(TAG, "core status: " + status); return status; } } return sProvisionalInstance.mCoreStatus; }