Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

droid: Only load libxbmc.so from the first loaded java class

  • Loading branch information...
commit ca93bec13a4bcc214cec032efa2f5218ce2c9fcf 1 parent f871f79
Cory Fields authored
5 tools/android/packaging/xbmc/src/org/xbmc/xbmc/Splash.java
View
@@ -31,6 +31,11 @@
public class Splash extends Activity {
+ static
+ {
+ System.loadLibrary("xbmc");
+ }
+
public enum State {
Uninitialized, InError, Checking, Caching, StartingXBMC
}
4 tools/android/packaging/xbmc/src/org/xbmc/xbmc/XBMCBroadcastReceiver.java
View
@@ -7,10 +7,6 @@
public class XBMCBroadcastReceiver extends BroadcastReceiver
{
native void ReceiveIntent(Intent intent);
- static
- {
- System.loadLibrary("xbmc");
- }
@Override
public void onReceive(Context context, Intent intent)

2 comments on commit ca93bec

Chris Browet
Collaborator

That doesn't work.
I get
E/AndroidRuntime( 785): java.lang.UnsatisfiedLinkError: Native method not found: org.xbmc.xbmc.XBMCBroadcastReceiver.ReceiveIntent:(Landroid/content/Intent;)V`
when the receiver is actually invoked simply because the intent is recived, whether xbmc is launched or not.
As libxbmc.so is never loaded, JNI_OnLoad is not called, neither is CAndroidJNIManager::Load, thus neither CAndroidJNIManager::RegisterClass and CBroadcastReceiver is not even instanciated.

Cory Fields
Owner

This is racy, and probably doing different things on different devices. It will depend on the entry-point (clicking xbmc icon vs auto-start vs media handler). But you are certainly correct that it's busted in general.

As mentioned in your PR, i have a rewrite that addresses the bigger JNI issues. Sorry for all the back/forth on this stuff, hopefully we're closing in on a working solution :)

Please sign in to comment.
Something went wrong with that request. Please try again.